diff --git a/.github/actionlint.yaml b/.github/actionlint.yaml new file mode 100644 index 0000000..447aaa1 --- /dev/null +++ b/.github/actionlint.yaml @@ -0,0 +1,6 @@ +paths: + .github/workflows/**/*.{yml,yaml}: + ignore: + - '"inputs" section is alias node but mapping node is expected' + - '"paths" section must be sequence node but got alias node with "" tag' + - '"paths-ignore" section must be sequence node but got alias node with "" tag' diff --git a/.github/workflows/build.yaml b/.github/workflows/build.yaml index 5c50ffc..b506d67 100644 --- a/.github/workflows/build.yaml +++ b/.github/workflows/build.yaml @@ -14,7 +14,7 @@ jobs: build: name: "Build" runs-on: ubuntu-latest - timeout-minutes: 10 + timeout-minutes: 15 permissions: contents: write @@ -22,23 +22,23 @@ jobs: steps: - name: "Checkout" - uses: actions/checkout@v5 + uses: actions/checkout@v6 - name: "Docker Login" - uses: docker/login-action@v3 + uses: docker/login-action@v4 with: registry: ghcr.io username: ${{ vars.GHCR_USER }} password: ${{ secrets.GHCR_PASS }} - name: "Setup Buildx" - uses: docker/setup-buildx-action@v3 + uses: docker/setup-buildx-action@v4 with: platforms: linux/amd64,linux/arm64 - name: "Generate Version Tags" id: version - uses: cssnr/update-version-tags-action@v1 + uses: cssnr/update-version-tags-action@v2 with: prefix: "" release: true @@ -52,7 +52,7 @@ jobs: - name: "Generate Docker Tags" id: tags - uses: cssnr/docker-tags-action@v1 + uses: cssnr/docker-tags-action@v2 with: images: "ghcr.io/${{ github.repository }}" tags: ${{ steps.version.outputs.tags }} @@ -76,8 +76,11 @@ jobs: run: | echo "NGINX_VERSION: ${{ steps.semver.outputs.release }}" + - name: "Setup QEMU" + uses: docker/setup-qemu-action@v4 + - name: "Build and Push" - uses: docker/build-push-action@v6 + uses: docker/build-push-action@v7 with: context: src push: true diff --git a/.github/workflows/issue.yaml b/.github/workflows/issue.yaml new file mode 100644 index 0000000..7e0ac4f --- /dev/null +++ b/.github/workflows/issue.yaml @@ -0,0 +1,43 @@ +name: "Issue" + +on: + issues: + types: [opened] + +jobs: + issue: + name: "Issue" + runs-on: ubuntu-latest + timeout-minutes: 5 + permissions: + contents: write + steps: + - name: "Checkout" + uses: actions/checkout@v6 + + - name: "Create App Token" + if: ${{ !github.event.release.prerelease }} + id: app + uses: actions/create-github-app-token@v3 + with: + app-id: 146360 + private-key: ${{ secrets.APP_PRIVATE_KEY }} + owner: "cssnr" + repositories: "docker-nginx-proxy" + + - name: "AI Issue" + uses: smashedr/ai-issue-action@master + env: + GOOGLE_GENERATIVE_AI_API_KEY: ${{ secrets.GOOGLE_GENERATIVE_AI_API_KEY }} + with: + token: ${{ steps.app.outputs.token }} + model: gemini-2.5-flash + instructions: | + You are a helpful assistant responding to a GitHub Issue created by user @${{ github.actor }} + in the repository ${{ github.server_url }}/${{ github.repository }} + Provide initial triage and troubleshooting steps, then gather any additional information needed to proceed. + Respond using your general knowledge of docker iamges and the following knowledge files: + file: | + README.md + tail: | + _Response generated by the [AI Issue Action](https://github.com/smashedr/ai-issue-action)._ diff --git a/.github/workflows/labeler.yaml b/.github/workflows/labeler.yaml index eb36453..95030e5 100644 --- a/.github/workflows/labeler.yaml +++ b/.github/workflows/labeler.yaml @@ -3,6 +3,10 @@ name: "PR Labeler" on: pull_request_target: +concurrency: + group: ${{ github.workflow }}-${{ github.ref }} + cancel-in-progress: true + jobs: labeler: name: "Labeler" @@ -15,7 +19,7 @@ jobs: steps: - name: "Checkout Configs" - uses: actions/checkout@v5 + uses: actions/checkout@v6 with: repository: cssnr/configs ref: master diff --git a/.github/workflows/lint.yaml b/.github/workflows/lint.yaml index ab7cfa0..193053b 100644 --- a/.github/workflows/lint.yaml +++ b/.github/workflows/lint.yaml @@ -21,10 +21,10 @@ jobs: steps: - name: "Checkout" - uses: actions/checkout@v5 + uses: actions/checkout@v6 - name: "Setup Node 24" - uses: actions/setup-node@v5 + uses: actions/setup-node@v6 with: node-version: 24 @@ -36,31 +36,21 @@ jobs: echo "::endgroup::" npx prettier --check . - - name: "Yamllint" + - name: "yamllint" if: ${{ !cancelled() }} env: - CONFIG: "{extends: relaxed, ignore: [node_modules/], rules: {line-length: {max: 119}}}" + CONFIG: .github/yamllint.yaml run: | echo "::group::List Files" - yamllint -d '${{ env.CONFIG }}' --list-files . + yamllint -c "${{ env.CONFIG }}" --list-files . echo "::endgroup::" - yamllint -d '${{ env.CONFIG }}' . + yamllint -c "${{ env.CONFIG }}" . - - name: "Actionlint" + - name: "actionlint" if: ${{ !cancelled() }} - run: | - echo "::group::Download" - loc=$(curl -sI https://github.com/rhysd/actionlint/releases/latest | grep -i '^location:') - echo "loc: ${loc}" - tag=$(echo "${loc}" | sed -E 's|.*/tag/v?(.*)|\1|' | tr -d '\t\r\n') - echo "tag: ${tag}" - url="https://github.com/rhysd/actionlint/releases/latest/download/actionlint_${tag}_linux_amd64.tar.gz" - echo "url: ${url}" - curl -sL "${url}" | tar xz -C "${RUNNER_TEMP}" actionlint - file "${RUNNER_TEMP}/actionlint" - "${RUNNER_TEMP}/actionlint" --version - echo "::endgroup::" - "${RUNNER_TEMP}/actionlint" -color -verbose -shellcheck= -pyflakes= + uses: cssnr/actionlint-action@v1 + with: + shellcheck_opts: -e SC2129 - name: "Hadolint" if: ${{ !cancelled() }} diff --git a/.github/yamllint.yaml b/.github/yamllint.yaml new file mode 100644 index 0000000..ccf5e5e --- /dev/null +++ b/.github/yamllint.yaml @@ -0,0 +1,7 @@ +extends: relaxed + +ignore-from-file: .gitignore + +rules: + line-length: + max: 120 diff --git a/.gitignore b/.gitignore index 325abbd..1e435e1 100644 --- a/.gitignore +++ b/.gitignore @@ -1,6 +1,10 @@ +# Generic .idea/ *.iml .vscode/ +cache/ +dist/ +build/ node_modules/ eslint_report.json .env diff --git a/.prettierrc.json b/.prettierrc.json index 564a197..577fddf 100644 --- a/.prettierrc.json +++ b/.prettierrc.json @@ -1,18 +1,20 @@ { - "trailingComma": "es5", + "$schema": "https://json.schemastore.org/prettierrc", "semi": false, "singleQuote": true, + "printWidth": 90, "overrides": [ { - "files": ["**/*.html", "**/*.yaml", "**/*.yml"], + "files": ["**/*.vue"], "options": { - "singleQuote": false + "printWidth": 120 } }, { - "files": ["**/*.js", "**/*.mjs", "**/*.css", "**/*.scss"], + "files": ["**/*.html", "**/*.yaml", "**/*.yml"], "options": { - "tabWidth": 4 + "singleQuote": false, + "printWidth": 120 } } ] diff --git a/build.sh b/build.sh index 9a139f6..0705740 100644 --- a/build.sh +++ b/build.sh @@ -30,6 +30,7 @@ VERSION="${1}" echo "${REGISTRY_HOST}/${REGISTRY_USER}/${REGISTRY_REPO}:latest" +#read -rp "Press to run docker build..." #if [ -z "${USERNAME}" ];then # read -rp "Username: " USERNAME diff --git a/src/10-update-config.sh b/src/10-update-config.sh index 3081d79..42a7567 100644 --- a/src/10-update-config.sh +++ b/src/10-update-config.sh @@ -27,8 +27,10 @@ if [ -n "${BASIC_AUTH}" ];then echo "BASIC_AUTH: ${BASIC_AUTH}" printf '%s' "${BASIC_AUTH}" > /etc/nginx/auth.users cat < /etc/nginx/conf.d/location.auth.conf -auth_basic "${BASIC_REALM:-Unauthorized}"; -auth_basic_user_file /etc/nginx/auth.users; +limit_except OPTIONS { + auth_basic "${BASIC_REALM:-Unauthorized}"; + auth_basic_user_file /etc/nginx/auth.users; +} EOF fi