Skip to content

Commit

Permalink
Merge pull request #132 from AxisCommunications/sync-20240530-1
Browse files Browse the repository at this point in the history
sync 20240530 1
  • Loading branch information
pataxis committed May 30, 2024
2 parents 2b2dd74 + dfa8bbe commit 29987c7
Show file tree
Hide file tree
Showing 7 changed files with 141 additions and 58 deletions.
36 changes: 36 additions & 0 deletions .github/lint-device-urls.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
#!/bin/bash

ret=0
base_url="192.168.0.90"
exclude_dir_list="\
--exclude-dir=.github \
--exclude-dir=src \
--exclude-dir=_site \
--exclude-dir=capture \
--exclude=test.sh \
"
allowed_patterns="\
\`$base_url\` \
$base_url<space> \
$base_url/index.html \
$base_url/axis-cgi \
@$base_url \
"

# Set +e to not having to handle the grep exit status
__url_grep_list=$(grep -nir "$base_url" $exclude_dir_list | \
grep -vE "$base_url(\`| |/axis-cgi|/index.html#)" | \
grep -vE "@$base_url" || :)
[ -z "$__url_grep_list" ] || {
printf '\n%s\n%s\n\n' \
"## Error - The following device URLs are not matching allowed patterns" \
"$__url_grep_list"
printf "## Allowed patterns (Including URLs prefixed http://):\n"
for pattern in $allowed_patterns
do
printf '%s\n' "* $pattern"
done
printf "\nA typical error is to copy the redirected URL that include e.g. product specific string 'camera'\n"
ret=1
}
exit $ret
3 changes: 3 additions & 0 deletions .github/workflows/lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,9 @@ jobs:
ret=1
}
exit $ret
- name: Check that device URLs have approved structure
run: |
.github/lint-device-urls.sh
- run: cat .github/super-linter.env >> "$GITHUB_ENV"
- name: Lint Code Base
uses: super-linter/super-linter/slim@v5
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -111,15 +111,15 @@ After obtaining the credentials, it's ready to make the actual VAPIX call. The A

2. Generate and set credentials:

The credentials obtained from the D-Bus call are concatenated and then added to the cURL request.
The credentials obtained from the D-Bus call are concatenated and then added to the curl request.

```c
curl_easy_setopt(curl, CURLOPT_USERPWD, credentials);
```

3. Set the authentication method and make the VAPIX call:

Here, basic access authentication is used, and then the actual cURL request is made.
Here, basic access authentication is used, and then the actual curl request is made.

```c
curl_easy_setopt(curl, CURLOPT_HTTPAUTH, CURLAUTH_ANY);
Expand Down Expand Up @@ -149,15 +149,15 @@ Example response:
('id:a0-testuser, pass:MH757eGZdsyBuAbhAQ3j2ZtRNg9xchEg',)
```

Make a VAPIX request on local virtual host 127.0.0.12 with the given credentials using cURL.
Make a VAPIX request on local virtual host 127.0.0.12 with the given credentials using `curl`.

Example

```bash
curl -s -u '<id:pass>' http://127.0.0.12/axis-cgi/applications/list.cgi
curl -s -u <id>:<pass> http://127.0.0.12/axis-cgi/applications/list.cgi
```

Where `id` and `pass` are the credentials obtained from the GDBus call. This cURL command sends an HTTP GET request to the specified VAPIX endpoint with the required authentication.
Where `id` and `pass` are the credentials obtained from the GDBus call. This `curl` command sends an HTTP GET request to the specified VAPIX endpoint with the required authentication.

## Limitations

Expand Down
21 changes: 10 additions & 11 deletions docs/acap-sdk-version-3/get-started/set-up-the-device.md
Original file line number Diff line number Diff line change
Expand Up @@ -33,18 +33,14 @@ You can enable SSH on an Axis device either through the device's web interface o

#### In the old web interface

1. Depending on you AXIS OS version, go to

- 10.5 and earlier: `http://192.168.0.90/#settings/system/tools/plainconfig`
- 10.6 and later: `http://192.168.0.90/aca/index.html#settings/system/tools/plainconfig`

2. Click **Network**.
3. Under **SSH**, select **Enabled**.
4. Scroll to the bottom of the page and click **Save**.
1. Go to `http://192.168.0.90/index.html#settings/system/tools/plainconfig`
2. Click on **Network** in the list
3. Under **SSH** select **Enabled**
4. Scroll to the bottom of the page and click button **Save**

#### In the new web interface

1. Go to `http://192.168.0.90/camera/index.html#/system/plainConfig`.
1. Go to `http://192.168.0.90/index.html#/system/plainConfig`.
2. Select the **Network** group from the drop-down menu.
3. Under **Network/SSH**, select **Enabled**.
4. Scroll to the bottom of the page and click **Save**.
Expand All @@ -54,7 +50,7 @@ You can enable SSH on an Axis device either through the device's web interface o
In this example we're using curl, and more options may be required depending on your network setup:

```sh
curl -u '<username>:<password>' "<http://192.168.0.90/axis-cgi/admin/param.cgi?action=update&Network.SSH.Enabled=yes>"
curl --anyauth -u <username>:<password> "http://192.168.0.90/axis-cgi/admin/param.cgi?action=update&Network.SSH.Enabled=yes"
```

## Setup the device on the network
Expand Down Expand Up @@ -123,9 +119,12 @@ http://192.168.0.90/axis-cgi/basicdeviceinfo.cgi
To extract the messages, use the CGI from a terminal, using the credentials set in the network configuration:

```sh
curl --anyauth "*" -u [username]:[password] 192.168.0.90/axis-cgi/basicdeviceinfo.cgi --data "{\"apiVersion\":\"1.0\",\"context\":\"Client defined request ID\",\"method\":\"getAllProperties\"}"
curl --anyauth -u <username>:<password> "http://192.168.0.90/axis-cgi/basicdeviceinfo.cgi" --data '{"apiVersion":"1.0","context":"Client defined request ID","method":"getAllProperties"}'
```

> To get a pretty-print of the JSON response from the curl call, the program
> `jq` can be used by appending the following snippet `<curl command> | jq`
The following response contains architecture `"Architecture": "armv7hf"`, and firmware version `"Version": "9.50.1"`:

```json
Expand Down
10 changes: 5 additions & 5 deletions docs/develop/VAPIX-access-for-ACAP-applications.md
Original file line number Diff line number Diff line change
Expand Up @@ -104,15 +104,15 @@ After obtaining the credentials, it's ready to make the actual VAPIX call. The A

2. Generate and set credentials:

The credentials obtained from the D-Bus call are concatenated and then added to the cURL request.
The credentials obtained from the D-Bus call are concatenated and then added to the curl request.

```c
curl_easy_setopt(curl, CURLOPT_USERPWD, credentials);
```

3. Set the authentication method and make the VAPIX call:

Here, basic access authentication is used, and then the actual cURL request is made.
Here, basic access authentication is used, and then the actual curl request is made.

```c
curl_easy_setopt(curl, CURLOPT_HTTPAUTH, CURLAUTH_ANY);
Expand Down Expand Up @@ -142,15 +142,15 @@ Example response:
('id:a0-testuser, pass:MH757eGZdsyBuAbhAQ3j2ZtRNg9xchEg',)
```

Make a VAPIX request on local virtual host 127.0.0.12 with the given credentials using cURL.
Make a VAPIX request on local virtual host 127.0.0.12 with the given credentials using `curl`.

Example

```bash
curl -s -u '<id:pass>' http://127.0.0.12/axis-cgi/applications/list.cgi
curl -s -u <id>:<pass> http://127.0.0.12/axis-cgi/applications/list.cgi
```

Where `id` and `pass` are the credentials obtained from the GDBus call. This cURL command sends an HTTP GET request to the specified VAPIX endpoint with the required authentication.
Where `id` and `pass` are the credentials obtained from the GDBus call. This `curl` command sends an HTTP GET request to the specified VAPIX endpoint with the required authentication.

## Limitations

Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,77 @@
---
layout: page
grand_parent: Get started
parent: Set up developer environment
title: Set up device - advanced
nav_order: 3
---

# Set up device - advanced topics

- [Access the device through SSH](#access-the-device-through-ssh)

## Access the device through SSH

This section shows how to setup and log in to a device through Secure Shell
Protocol (SSH) to run command-line operations in AXIS OS.

### Enable SSH

SSH is by default disabled on Axis devices, but can be enabled either through
the device's web interface or by calling a VAPIX API from command-line.

#### Through new web interface

1. Go to `http://192.168.0.90/index.html#system/plainConfig`
2. Select the **Network** group from the drop-down menu
3. Under **Network / SSH** select **Enabled**
4. Scroll to the bottom of the page and click button **Save**

#### Through old web interface

1. Go to `http://192.168.0.90/index.html#settings/system/tools/plainconfig`
2. Click on **Network** in the list
3. Under **SSH** select **Enabled**
4. Scroll to the bottom of the page and click button **Save**

#### Through command-line

This is exemplified using `curl`:

> More options may be required depending on your network setup.
```sh
curl -u '<username>:<password>' --anyauth "http://192.168.0.90/axis-cgi/admin/param.cgi?action=update&Network.SSH.Enabled=yes"
```

### Create an SSH user

> - Prior to AXIS OS 11.5 it's only possible to SSH as `root` user.
> - From AXIS OS 11.5 it's possible to create a non-root SSH user.
> - After AXIS OS 12.0 it will not be possible to SSH to an Axis device as
> `root` user.
#### Through web interface

1. Go to the following URL:
- AXIS OS < 11.6 `http://192.168.0.90/index.html#system/users`
- AXIS OS >= 11.6 `http://192.168.0.90/index.html#system/accounts`
2. Find the field on the web page called:
- AXIS OS < 11.6 **SSH users**
- AXIS OS >= 11.6 **SSH accounts**
3. Click the `+` icon with text **Add SSH user**
4. Follow the instructions in the dialog to create an SSH user.

### Connect to the device

To connect to the Axis device through SSH, it's required to install a program
that can communicate via SSH. This will be exemplified using `ssh` and a
non-root SSH user called `my-ssh-user`.

> The SSH user needs to be created on the device before connecting to the
> device, see [Create an SSH user](create-an-ssh-user).
```sh
ssh my-ssh-user@192.168.0.90
my-ssh-user@axis-aabbcc112233:~#
```
42 changes: 5 additions & 37 deletions docs/get-started/set-up-developer-environment/set-up-device.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,36 +30,6 @@ For more information about how to find and assign IP addresses, go to [How to as
2. Enter the username and password. If you access the device for the first time, you must set the root password. See [Set a new password for the root account](#set-a-new-password-for-the-root-account).
3. The live view page opens in your browser.

### Access the device through SSH

You can enable SSH on an Axis device either through the device's web interface or by calling a VAPIX API from command-line.

#### Through old web interface

1. Go to the following URL:
- AXIS OS < 10.6 `http://192.168.0.90/#settings/system/tools/plainconfig`
- AXIS OS >= 10.6 `http://192.168.0.90/aca/index.html#settings/system/tools/plainconfig`
2. Click on **Network** in the list
3. Under **SSH** select **Enabled**
4. Scroll to the bottom of the page and click button **Save**

#### Through new web interface

1. Go to `http://192.168.0.90/camera/index.html#/system/plainConfig`
2. Select the **Network** group from the drop-down menu
3. Under **Network / SSH** select **Enabled**
4. Scroll to the bottom of the page and click button **Save**

#### Through command-line

This is exemplified using `curl`:

```sh
curl -u '<username>:<password>' "http://192.168.0.90/axis-cgi/admin/param.cgi?action=update&Network.SSH.Enabled=yes"
```

> More options may be required depending on your network setup.
## Setup the device on the network

Some extra steps can be followed to make sure the device is ready to be used and connected to the network.
Expand Down Expand Up @@ -125,10 +95,13 @@ http://192.168.0.90/axis-cgi/basicdeviceinfo.cgi
To extract the messages, use the CGI from a terminal, using the credentials set in the network configuration:

```sh
curl --anyauth '*' -u '<username>:<password>' 192.168.0.90/axis-cgi/basicdeviceinfo.cgi --data '{"apiVersion":"1.0","context":"Client defined request ID","method":"getAllProperties"}'
curl --anyauth -u <username>:<password> "http://192.168.0.90/axis-cgi/basicdeviceinfo.cgi" --data '{"apiVersion":"1.0","context":"Client defined request ID","method":"getAllProperties"}'
```

The following response contains architecture `"Architecture": "armv7hf"`, and AXIS OS version `"Version": "9.50.1"`:
> To get a pretty-print of the JSON response from the curl call, the program
> `jq` can be used by appending the following snippet `<curl command> | jq`
The following response contains architecture `"Architecture": "armv7hf"`, and firmware version `"Version": "9.50.1"`:

```json
{
Expand Down Expand Up @@ -158,11 +131,6 @@ The following response contains architecture `"Architecture": "armv7hf"`, and AX

Axis offers product firmware (AXIS OS) management according to the active track or the long-term support (LTS) tracks. Regardless of the track chosen, it is recommended to upgrade AXIS OS regularly in order to get the latest security updates. AXIS OS can be upgraded using AXIS Device Manager, AXIS Camera Station, AXIS Companion, HTTP or FTP.

> If using AXIS A1001 in cluster mode, make sure to upgrade all controllers.
> Either all at a time using AXIS Device Manager or straight after each other
> using the web interface or FTP. The entire cluster should always be on the
> same firmware
### AXIS Device Manager or AXIS Camera Station

1. Go to the **Device Manager Tab** in Axis Device Manager or **Configuration Tab > Devices - Management** in AXIS Camera Station.
Expand Down

0 comments on commit 29987c7

Please sign in to comment.