diff --git a/.github/workflows/publishBranchesPRs.yml b/.github/workflows/publishBranchesPRs.yml index 09148d8..34ca562 100644 --- a/.github/workflows/publishBranchesPRs.yml +++ b/.github/workflows/publishBranchesPRs.yml @@ -5,7 +5,7 @@ name: PR - Create and publish a Docker image on: pull_request: #push: - # branches: + # branches: # - '*' # - '!master' @@ -22,7 +22,7 @@ jobs: permissions: contents: read packages: write - # + # steps: - name: Checkout repository uses: actions/checkout@v3 @@ -36,7 +36,7 @@ jobs: # This step uses [docker/metadata-action](https://github.com/docker/metadata-action#about) to extract tags and labels that will be applied to the specified image. The `id` "meta" allows the output of this step to be referenced in a subsequent step. The `images` value provides the base name for the tags and labels. - name: Extract branch name shell: bash - run: echo "branch=${GITHUB_HEAD_REF:-${GITHUB_REF#refs/heads/}}" >> $GITHUB_OUTPUT + run: echo "branch=${GITHUB_HEAD_REF:-${GITHUB_REF#refs/heads/}}" >> "$GITHUB_OUTPUT" id: extract_branch - name: Extract metadata (tags, labels) for Docker id: meta diff --git a/.github/workflows/publishMaster.yml b/.github/workflows/publishMaster.yml index 8abddac..f4a7d21 100644 --- a/.github/workflows/publishMaster.yml +++ b/.github/workflows/publishMaster.yml @@ -4,7 +4,7 @@ name: Master - Create and publish a Docker image # Configures this workflow to run every time a change is pushed to the branch called `master`. on: push: - branches: ['master'] + branches: ["master"] # Defines two custom environment variables for the workflow. These are used for the Container registry domain, and a name for the Docker image that this workflow builds. env: @@ -19,7 +19,7 @@ jobs: permissions: contents: read packages: write - # + # steps: - name: Checkout repository uses: actions/checkout@v3 diff --git a/.github/workflows/publishTags.yml b/.github/workflows/publishTags.yml index 4dd9245..7785d1c 100644 --- a/.github/workflows/publishTags.yml +++ b/.github/workflows/publishTags.yml @@ -4,8 +4,8 @@ name: Tags - Create and publish a Docker image # Build when a tag is created on: push: - tags: - - '**' + tags: + - "**" # Defines two custom environment variables for the workflow. These are used for the Container registry domain, and a name for the Docker image that this workflow builds. env: @@ -20,7 +20,7 @@ jobs: permissions: contents: read packages: write - # + # steps: - name: Checkout repository uses: actions/checkout@v3 diff --git a/.github/workflows/superLinter.yml b/.github/workflows/superLinter.yml new file mode 100644 index 0000000..cb7586a --- /dev/null +++ b/.github/workflows/superLinter.yml @@ -0,0 +1,47 @@ +--- +# This workflow executes several linters on changed files based on languages used in your code base whenever +# you push a code or open a pull request. +# +# You can adjust the behavior by modifying this file. +# For more information, see: +# https://github.com/github/super-linter +name: Lint Code Base + +on: # yamllint disable-line rule:truthy + push: + branches: ["master"] + pull_request: + branches: ["master"] + +permissions: + contents: read + +jobs: + run-lint: + runs-on: ubuntu-latest + steps: + - name: Checkout code + uses: actions/checkout@v4 + with: + # Full git history is needed to get a proper list of changed files within `super-linter` + fetch-depth: 0 + + - name: Lint Code Base + uses: github/super-linter/slim@v7 + env: + DISABLE_ERRORS: true + VALIDATE_ALL_CODEBASE: false + VALIDATE_CHECKOV: false + VALIDATE_EDITORCONFIG: false + VALIDATE_JSCPD: false + VALIDATE_MARKDOWN: false + VALIDATE_PYTHON: true + VALIDATE_PYTHON_PYLINT: false + VALIDATE_YAML: false + VALIDATE_YAML_PRETTIER: false + DEFAULT_BRANCH: master + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + LINTER_RULES_PATH: / + DOCKERFILE_HADOLINT_FILE_NAME: .hadolint.yml + MARKDOWN_CONFIG_FILE: .markdown-lint.yml + YAML_LINTER_RULES: .yamllint.yml diff --git a/.hadolint.yml b/.hadolint.yml new file mode 100644 index 0000000..c390dfb --- /dev/null +++ b/.hadolint.yml @@ -0,0 +1,3 @@ +ignored: + - DL3008 # Pin versions in apt get install. Instead of `apt-get install ` use `apt-get install =` + - DL3018 # Pin versions in apk add. Instead of `apk add ` use `apk add =` diff --git a/.yamllint.yml b/.yamllint.yml new file mode 100644 index 0000000..fb06ff6 --- /dev/null +++ b/.yamllint.yml @@ -0,0 +1,11 @@ +extends: default + +rules: + document-start: disable + line-length: + max: 180 + level: warning + comments: + # Changed this to stop a mess between linters from Prettier (vscode) to yamllint + # - https://github.com/prettier/prettier/pull/10926 + min-spaces-from-content: 1 diff --git a/Dockerfile b/Dockerfile index 4127ff5..fa653d9 100644 --- a/Dockerfile +++ b/Dockerfile @@ -34,8 +34,8 @@ RUN wget --progress=dot:giga https://download.brother.com/welcome/dlf006652/brsc dpkg -i /tmp/brscan-skey-0.3.1-2.amd64.deb && \ rm /tmp/brscan-skey-0.3.1-2.amd64.deb -ADD files/runScanner.sh /opt/brother/runScanner.sh -ADD files/brscan-skey.config /opt/brother/scanner/brscan-skey/brscan-skey.config +COPY files/runScanner.sh /opt/brother/runScanner.sh +COPY files/brscan-skey.config /opt/brother/scanner/brscan-skey/brscan-skey.config COPY script /opt/brother/scanner/brscan-skey/script RUN cp /etc/lighttpd/conf-available/05-auth.conf /etc/lighttpd/conf-enabled/ diff --git a/html/active.php b/html/active.php index 2b3e4d5..a88f1cd 100644 --- a/html/active.php +++ b/html/active.php @@ -1,25 +1,25 @@ isProcessRunning('scanimage'), - 'waiting' => isProcessRunning('sleep'), - 'ocr' => isProcessRunning('curl') + 'scan' => isProcessRunning('scanimage'), + 'waiting' => isProcessRunning('sleep'), + 'ocr' => isProcessRunning('curl') ); @@ -27,4 +27,4 @@ function isProcessRunning($processName) { header('Content-Type: application/json; charset=utf-8'); echo json_encode($result); -?> \ No newline at end of file +?> diff --git a/html/download.php b/html/download.php index 45da56a..d2c8c68 100644 --- a/html/download.php +++ b/html/download.php @@ -1,23 +1,25 @@ \ No newline at end of file + +?> diff --git a/html/index.php b/html/index.php index ee283af..eb029ed 100644 --- a/html/index.php +++ b/html/index.php @@ -1,5 +1,5 @@ - - +