Skip to content

Commit

Permalink
Merge remote branch 'upstreamrepo/main'
Browse files Browse the repository at this point in the history
  • Loading branch information
pataxis committed Jun 18, 2024
2 parents 29987c7 + 65e177f commit 214c501
Show file tree
Hide file tree
Showing 7 changed files with 72 additions and 33 deletions.
83 changes: 58 additions & 25 deletions .github/lint-device-urls.sh
Original file line number Diff line number Diff line change
@@ -1,36 +1,69 @@
#!/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" ] || {
#-------------------------------------------------------------------------------
# Functions
#-------------------------------------------------------------------------------

print_section() {
local sep40="----------------------------------------"
printf '\n\n%s\n%s\n%s\n' "$sep40$sep40" " $*" "$sep40$sep40"
}

check_device_ip_paths() {
local ret=0
local __url_grep_list=
local base_url="192.168.0.90"
local exclude_dir_list="\
--exclude-dir=.github \
--exclude-dir=.git \
--exclude-dir=src \
--exclude-dir=_site \
--exclude-dir=capture \
"
local allowed_patterns="\
\`$base_url\` \
$base_url<end-of-line> \
$base_url<space> \
$base_url: \
$base_url/index.html#[a-z] \
$base_url/axis-cgi \
$base_url/local \
@$base_url \
"

print_section "Check that device URLs follow allowed pattern"

# shellcheck disable=SC2086
__url_grep_list=$(grep -nir "$base_url" $exclude_dir_list |
grep -vE "$base_url(\`|$| |:|/axis-cgi|/index.html#[a-z]|/local)" |
grep -vE "@$base_url" || :)

if [ "$__url_grep_list" ]; then
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
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
else
printf "* All device URLs follow pattern\n"
fi

return $ret
}
exit $ret

#-------------------------------------------------------------------------------
# Main
#-------------------------------------------------------------------------------

exit_value=0
found_error=no

if ! check_device_ip_paths; then found_error=yes; fi

[ "$found_error" = no ] || exit_value=1

exit $exit_value
13 changes: 9 additions & 4 deletions .textlintrc
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,16 @@
"rules": {
"terminology": {
"defaultTerms": true,
"exclude": ["bug[- ]fix(es)?", "bugfix$1"],
"exclude": [
"bug[- ]fix(es)?",
"walk-through"
],
"terms": [
["bug[-]fix(es)?", "bug fix$1"],
["bugfix(es)?", "bug fix$1"]
],
},
["bugfix(es)?", "bug fix$1"],
["walkthrough", "walk-through"],
["ax(|is)(| )os", "AXIS OS"]
]
}
}
}
2 changes: 1 addition & 1 deletion docs/acap-sdk-version-3/api/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ The API supports products with the following chips:

The VdoStream API was introduced in API version 3.0.

| Axis OS version | VdoStream API version | New functions added |
| AXIS OS version | VdoStream API version | New functions added |
| --------------- | --------------------- | ------------------- |
| 10.2 | 2.3.13 | `vdo_stream_snapshot`<br>`vdo_stream_set_framerate`<br>`vdo_channel_get_filtered`|
| 10.3 | 3.0.0 | - |
Expand Down
2 changes: 1 addition & 1 deletion docs/acap-sdk-version-3/get-started/set-up-the-device.md
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ You can enable SSH on an Axis device either through the device's web interface o

#### In the new web interface

1. Go to `http://192.168.0.90/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 Down
1 change: 1 addition & 0 deletions docs/develop/application-project-structure.md
Original file line number Diff line number Diff line change
Expand Up @@ -168,6 +168,7 @@ see [Manifest schemas](manifest-schemas/).
| Required embedded development version | acapPackageConf.<br>setup.<br>embeddedSdkVersion[^2] | REQEMBDEVVERSION | Specifies the minimum required embedded development version that the device running the application must support. The version is dependent on the set APIs used in the application. |
| Application specific setting page | acapPackageConf.<br>configuration.<br>settingPage | SETTINGSPAGEFILE | Specifies the HTML page for custom settings, to be used by for instance device management software, allowing a user to browse the application settings page. The file must be in a directory called `html` in the application project. |
| Supported CGI endpoints | acapPackageConf.<br>configuration.<br>httpConfig[].name | HTTPCGIPATHS and file | CGI path relative to application web root |
| Package custom files in application | N/A | OTHERFILES | This option in package.conf has been replaced by a [build tool](build-install-run#build-tool) option and is not part of manifest.json. An example `acap-build . -a file1 -a file2` |
| | acapPackageConf.<br>configuration.<br>httpConfig[].type | | CGI implementation type, e.g. transferCgi |
| | acapPackageConf.<br>configuration.<br>httpConfig[].access | | Access policy for calling the CGI |
| Product integrated application parameters | acapPackageConf.<br>configuration.<br>paramConfig[].default | file: param.conf | Parameter default value |
Expand Down
2 changes: 1 addition & 1 deletion docs/develop/build-install-run.md
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ For help on using the build tool, run `acap-build -h`.
> was used for configuration. It has since been replaced by
> **manifest.json**. If any additional files were previously listed in **OTHERFILES**
> in the package.conf file, these now need to be listed as input to the acap-build
> command using the flag -a, for example `acap-build ./ -a file1 -a file2`.
> command using the flag -a, for example `acap-build . -a file1 -a file2`.
> - For the ACAP application package to be supported in older AXIS OS, a
> **package.conf** file is generated and included in the EAP file. Although it’s
> the manifest file that is the base setup file for the ACAP application when
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ 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).
> device, see [Create an SSH user](#create-an-ssh-user).
```sh
ssh my-ssh-user@192.168.0.90
Expand Down

0 comments on commit 214c501

Please sign in to comment.