diff --git a/.github/super-linter.env b/.github/super-linter.env new file mode 100644 index 0000000..e92b53a --- /dev/null +++ b/.github/super-linter.env @@ -0,0 +1,8 @@ +LINTER_RULES_PATH=/ +VALIDATE_ALL_CODEBASE=true +IGNORE_GITIGNORED_FILES=true +VALIDATE_CLANG_FORMAT=true +VALIDATE_DOCKERFILE_HADOLINT=true +VALIDATE_JSON=true +VALIDATE_MARKDOWN=true +VALIDATE_YAML=true diff --git a/.github/workflows/super-linter.yml b/.github/workflows/super-linter.yml index 48ff7ba..2c0c4ea 100644 --- a/.github/workflows/super-linter.yml +++ b/.github/workflows/super-linter.yml @@ -13,17 +13,11 @@ jobs: with: fetch-depth: 0 + - name: Setup Environment + run: cat .github/super-linter.env >> "$GITHUB_ENV" + - name: Lint Code Base - uses: github/super-linter/slim@v5 + uses: super-linter/super-linter/slim@v5 env: - LINTER_RULES_PATH: / - VALIDATE_ALL_CODEBASE: false DEFAULT_BRANCH: main GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - SSH_KEY: ${{ secrets.SSH_PRIVATE_KEY }} - IGNORE_GITIGNORED_FILES: true - VALIDATE_CLANG_FORMAT: true - VALIDATE_DOCKERFILE_HADOLINT: true - VALIDATE_JSON: true - VALIDATE_MARKDOWN: true - VALIDATE_YAML: true diff --git a/.hadolint.yaml b/.hadolint.yaml new file mode 100644 index 0000000..ca359d0 --- /dev/null +++ b/.hadolint.yaml @@ -0,0 +1,4 @@ +--- +ignored: + # Pin versions in 'apt-get install'. + - DL3008 diff --git a/.markdownlint.yaml b/.markdownlint.yaml index 9c37cb9..22b68f9 100644 --- a/.markdownlint.yaml +++ b/.markdownlint.yaml @@ -1,4 +1,6 @@ --- +# Line length MD013: line_length: 100 +# First line in a file should be a top-level heading MD041: false diff --git a/Dockerfile b/Dockerfile index 6565566..2187042 100644 --- a/Dockerfile +++ b/Dockerfile @@ -5,7 +5,6 @@ ARG BUILD_DIR=/usr/local/src/server-acap FROM $SDK_IMAGE:$ACAP_SDK_VERSION-$ARCH AS builder ARG BUILD_DIR -# hadolint ignore=DL3008 RUN DEBIAN_FRONTEND=noninteractive \ apt-get update && \ apt-get install -y --no-install-recommends \ diff --git a/LINT.md b/LINT.md index 36ece70..e2bc76c 100644 --- a/LINT.md +++ b/LINT.md @@ -1,7 +1,7 @@ # Lint of code base This repo uses the -[super-linter](https://github.com/github/super-linter) +[super-linter](https://github.com/super-linter/super-linter) to check the code base syntax and format on different file types. ## Linters in GitHub Action @@ -21,13 +21,8 @@ which is possible since it is available as a container. Using docker run --rm \ -v "$PWD":/tmp/lint \ -e RUN_LOCAL=true \ - -e LINTER_RULES_PATH=/ \ - -e VALIDATE_CLANG_FORMAT=true \ - -e VALIDATE_DOCKERFILE_HADOLINT=true \ - -e VALIDATE_JSON=true \ - -e VALIDATE_MARKDOWN=true \ - -e VALIDATE_YAML=true \ - github/super-linter:slim-v4 + --env-file .github/super-linter.env \ + ghcr.io/super-linter/super-linter:slim-v5 ``` ## Run super-linter interactively @@ -39,8 +34,9 @@ with Docker: docker run -it --rm \ -v "$PWD":/tmp/lint \ -w /tmp/lint \ + --env-file .github/super-linter.env \ --entrypoint /bin/bash \ - github/super-linter:slim-v4 + ghcr.io/super-linter/super-linter:slim-v5 ``` Then from the container terminal, the following commands can lint the the code diff --git a/README.md b/README.md index cb4ef22..ef526ec 100644 --- a/README.md +++ b/README.md @@ -18,9 +18,10 @@ it actually is to integrate any Axis device in an OPC UA system. ![Architectural overview](images/acap_architecture.svg) -*Please note that even if this ACAP would fit right into your usecase, its -purpose is above all to serve as an example and boilerplate rather than being -ready for production.* +> [!NOTE] +> Even if this application would fit right into your usecase, its purpose is +> above all to serve as an example and boilerplate rather than being ready for +> production. ## Build @@ -59,10 +60,10 @@ DOCKER_BUILDKIT=1 docker build --build-arg ARCH=aarch64 -o type=local,dest=. . ### Manual installation and configuration -Upload the ACAP file (the file with the `.eap` extension for the camera's -architecture) through the camera's web UI: *Apps->Add app* +Upload the ACAP application file (the file with the `.eap` extension for the +camera's architecture) through the camera's web UI: *Apps->Add app* -The OPC UA Server port (default is 4840) can be set through the ACAP's +The OPC UA Server port (default is 4840) can be set through the application's parameter settings, found in the three vertical dots menu: ![Web UI Screenshot](images/web_ui_open_param_settings.png) @@ -73,8 +74,8 @@ parameter settings, found in the three vertical dots menu: Use the camera's [applications/upload.cgi](https://www.axis.com/vapix-library/subjects/t10102231/section/t10036126/display?section=t10036126-t10010609) -to upload the ACAP file (the file with the `.eap` extension for the camera's -architecture): +to upload the ACAP application file (the file with the `.eap` extension for the +camera's architecture): ```sh curl -k --anyauth -u root: \ @@ -84,7 +85,7 @@ curl -k --anyauth -u root: \ To [start (or stop/restart/remove)](https://www.axis.com/vapix-library/subjects/t10102231/section/t10036126/display?section=t10036126-t10010606) -the ACAP, you can make a call like this: +the application, you can make a call like this: ```sh curl -k --anyauth -u root: \ @@ -120,7 +121,8 @@ curl -k --anyauth -u root: \ Attach an OPC UA client to the port set in the ACAP. The client will then be able to read the values (and their timestamps) from the ACAP's OPC UA server. -The ACAP will also log the values in the camera's syslog. +> [!NOTE] +> The application will also log the values in the camera's syslog. ## License diff --git a/renovate.json b/renovate.json index 996cf27..5db72dd 100644 --- a/renovate.json +++ b/renovate.json @@ -1,20 +1,6 @@ { - "$schema": "https://docs.renovatebot.com/renovate-schema.json", - "extends": [ - "config:base" - ], - "labels": ["dependencies"], - "packageRules": [ - { - "updateTypes": ["minor", "patch", "pin", "digest"], - "automerge": true - } - ], - "rebaseWhen": "behind-base-branch", - "vulnerabilityAlerts": { - "labels": ["security"] - }, - "stabilityDays": 3, - "prCreation": "not-pending", - "dependencyDashboard": false + "$schema": "https://docs.renovatebot.com/renovate-schema.json", + "extends": [ + "config:recommended" + ] }