mirror of
https://github.com/NginxProxyManager/nginx-proxy-manager.git
synced 2025-08-03 16:03:38 +00:00
make image smaller + allow long passwd + dep updates + fix compression/misspellings
Signed-off-by: Zoey <zoey@z0ey.de>
This commit is contained in:
16
.github/workflows/docker-latest.yml
vendored
16
.github/workflows/docker-latest.yml
vendored
@@ -1,35 +1,27 @@
|
||||
name: Docker push develop to latest
|
||||
|
||||
on:
|
||||
workflow_dispatch:
|
||||
|
||||
jobs:
|
||||
docker:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v3
|
||||
|
||||
- name: Login to DockerHub
|
||||
if: github.event_name != 'pull_request'
|
||||
uses: docker/login-action@v2
|
||||
with:
|
||||
username: ${{ secrets.DOCKER_USERNAME }}
|
||||
password: ${{ secrets.DOCKER_PASSWORD }}
|
||||
|
||||
- name: Login to GitHub Container Registry
|
||||
uses: docker/login-action@v2
|
||||
with:
|
||||
registry: ghcr.io
|
||||
username: ${{ secrets.DOCKER_USERNAME }}
|
||||
password: ${{ github.token }}
|
||||
|
||||
- name: Push develop to latest
|
||||
run: |
|
||||
docker buildx imagetools create --tag ${{ secrets.DOCKER_USERNAME }}/${{ github.event.repository.name }}:latest ${{ secrets.DOCKER_USERNAME }}/${{ github.event.repository.name }}:${{ github.ref_name }}
|
||||
docker buildx imagetools create --tag ghcr.io/${{ secrets.DOCKER_USERNAME }}/${{ github.event.repository.name }}:latest ghcr.io/${{ secrets.DOCKER_USERNAME }}/${{ github.event.repository.name }}:${{ github.ref_name }}
|
||||
|
||||
docker buildx imagetools create --tag ${{ secrets.DOCKER_USERNAME }}/${{ github.event.repository.name }}:latest ${{ secrets.DOCKER_USERNAME }}/${{ github.event.repository.name }}:${{ github.ref_name }}
|
||||
docker buildx imagetools create --tag ghcr.io/${{ secrets.DOCKER_USERNAME }}/${{ github.event.repository.name }}:latest ghcr.io/${{ secrets.DOCKER_USERNAME }}/${{ github.event.repository.name }}:${{ github.ref_name }}
|
||||
- name: Show Nginx version
|
||||
run: |
|
||||
docker run --rm --entrypoint nginx ${{ secrets.DOCKER_USERNAME }}/${{ github.event.repository.name }}:latest -V
|
||||
docker run --rm --entrypoint nginx ghcr.io/${{ secrets.DOCKER_USERNAME }}/${{ github.event.repository.name }}:latest -V
|
||||
docker run --rm --entrypoint nginx ${{ secrets.DOCKER_USERNAME }}/${{ github.event.repository.name }}:latest -V
|
||||
docker run --rm --entrypoint nginx ghcr.io/${{ secrets.DOCKER_USERNAME }}/${{ github.event.repository.name }}:latest -V
|
||||
|
51
.github/workflows/docker.yml
vendored
51
.github/workflows/docker.yml
vendored
@@ -1,12 +1,11 @@
|
||||
name: Build Docker Image
|
||||
|
||||
on:
|
||||
workflow_run:
|
||||
workflows: ["Build frontend"]
|
||||
types:
|
||||
- completed
|
||||
push:
|
||||
branches:
|
||||
branches:
|
||||
- develop
|
||||
paths:
|
||||
- .github/workflows/docker.yml
|
||||
@@ -14,84 +13,68 @@ on:
|
||||
- backend/**
|
||||
- rootfs/**
|
||||
workflow_dispatch:
|
||||
|
||||
jobs:
|
||||
backend-test:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v3
|
||||
|
||||
- uses: actions/setup-node@v3
|
||||
with:
|
||||
node-version: 18
|
||||
|
||||
- name: Test Backend
|
||||
run: |
|
||||
sudo npm install --global cross-env
|
||||
sudo pip install certbot
|
||||
sudo mkdir -p /usr/local/nginx/conf/conf.d/include /data/tls/certbot /tmp/acme-challenge
|
||||
sudo touch /usr/local/nginx/conf/conf.d/include/ip_ranges.conf
|
||||
sudo cp rootfs/etc/tls/certbot.ini /data/tls/certbot/config.ini
|
||||
mv global backend
|
||||
cd backend
|
||||
npm install --force
|
||||
sudo nginx
|
||||
cross-env NODE_ENV=production sudo -E timeout 30 node --abort_on_uncaught_exception --max_old_space_size=250 index.js || if [ "$?" == "124" ]; then exit 0; else exit 1; fi
|
||||
|
||||
sudo pip install certbot
|
||||
sudo mkdir -p /usr/local/nginx/conf/conf.d/include /data/tls/certbot /tmp/acme-challenge
|
||||
sudo touch /usr/local/nginx/conf/conf.d/include/ip_ranges.conf
|
||||
sudo cp rootfs/etc/tls/certbot.ini /data/tls/certbot/config.ini
|
||||
mv global backend
|
||||
cd backend
|
||||
npm install --force
|
||||
sudo nginx
|
||||
NODE_ENV=production sudo -E timeout 30 node --abort_on_uncaught_exception --max_old_space_size=250 index.js || if [ "$?" == "124" ]; then exit 0; else exit 1; fi
|
||||
- name: Kill workflow
|
||||
if: failure()
|
||||
run: |
|
||||
curl -X POST https://api.github.com/repos/${{ github.repository }}/actions/runs/${{ github.run_id }}/cancel --header "authorization: Bearer ${{ secrets.GITHUB_TOKEN }}"
|
||||
|
||||
curl -X POST https://api.github.com/repos/${{ github.repository }}/actions/runs/${{ github.run_id }}/cancel --header "authorization: Bearer ${{ secrets.GITHUB_TOKEN }}"
|
||||
build:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v3
|
||||
|
||||
- name: Load frontend from cache
|
||||
uses: actions/cache/restore@v3
|
||||
with:
|
||||
path: frontend/dist
|
||||
key: frontend
|
||||
|
||||
- name: Set up QEMU
|
||||
uses: docker/setup-qemu-action@v2
|
||||
with:
|
||||
with:
|
||||
platforms: arm64 #all
|
||||
|
||||
- name: Set up Docker Buildx
|
||||
id: buildx
|
||||
uses: docker/setup-buildx-action@v2
|
||||
with:
|
||||
driver-opts: env.BUILDKIT_STEP_LOG_MAX_SIZE=-1
|
||||
|
||||
- name: Login to DockerHub
|
||||
uses: docker/login-action@v2
|
||||
with:
|
||||
username: ${{ secrets.DOCKER_USERNAME }}
|
||||
password: ${{ secrets.DOCKER_PASSWORD }}
|
||||
|
||||
- name: Login to GitHub Container Registry
|
||||
uses: docker/login-action@v2
|
||||
with:
|
||||
registry: ghcr.io
|
||||
username: ${{ secrets.DOCKER_USERNAME }}
|
||||
password: ${{ github.token }}
|
||||
|
||||
- name: Build
|
||||
uses: docker/build-push-action@v3
|
||||
uses: docker/build-push-action@v4
|
||||
with:
|
||||
context: .
|
||||
file: ./Dockerfile
|
||||
platforms: linux/amd64,linux/arm64 #,linux/amd64/v2,linux/amd64/v3,linux/amd64/v4 #,linux/ppc64le,linux/s390x,linux/386,linux/arm/v7,linux/arm/v6
|
||||
push: ${{ github.ref == 'refs/heads/develop' }}
|
||||
tags: |
|
||||
ghcr.io/${{ secrets.DOCKER_USERNAME }}/${{ github.event.repository.name }}:${{ github.ref_name }}
|
||||
${{ secrets.DOCKER_USERNAME }}/${{ github.event.repository.name }}:${{ github.ref_name }}
|
||||
|
||||
tags: "ghcr.io/${{ secrets.DOCKER_USERNAME }}/${{ github.event.repository.name }}:${{ github.ref_name }}\n${{ secrets.DOCKER_USERNAME }}/${{ github.event.repository.name }}:${{ github.ref_name }}\n \n"
|
||||
- name: show version
|
||||
run: |
|
||||
docker run --rm --entrypoint nginx ${{ secrets.DOCKER_USERNAME }}/${{ github.event.repository.name }}:${{ github.ref_name }} -V
|
||||
docker run --rm --entrypoint nginx ghcr.io/${{ secrets.DOCKER_USERNAME }}/${{ github.event.repository.name }}:${{ github.ref_name }} -V
|
||||
run: |
|
||||
docker run --rm --entrypoint nginx ${{ secrets.DOCKER_USERNAME }}/${{ github.event.repository.name }}:${{ github.ref_name }} -V
|
||||
docker run --rm --entrypoint nginx ghcr.io/${{ secrets.DOCKER_USERNAME }}/${{ github.event.repository.name }}:${{ github.ref_name }} -V
|
||||
|
27
.github/workflows/frontend.yml
vendored
27
.github/workflows/frontend.yml
vendored
@@ -1,38 +1,33 @@
|
||||
name: Build frontend
|
||||
|
||||
on:
|
||||
push:
|
||||
branches:
|
||||
branches:
|
||||
- develop
|
||||
paths:
|
||||
- .github/workflows/frontend.yml
|
||||
- frontend/**
|
||||
- global/**
|
||||
workflow_dispatch:
|
||||
|
||||
jobs:
|
||||
build:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v3
|
||||
|
||||
- uses: actions/setup-node@v3
|
||||
with:
|
||||
node-version: 18
|
||||
|
||||
- name: Prepair frontend
|
||||
- name: Prepare frontend
|
||||
run: |
|
||||
curl https://api.github.com/repos/${{ github.repository }}/actions/caches?key=frontend -X DELETE --header "authorization: Bearer ${{ secrets.GITHUB_TOKEN }}"
|
||||
export NODE_OPTIONS=--openssl-legacy-provider
|
||||
npm install --global yarn
|
||||
cd frontend
|
||||
sed -i "s|\"0.0.0\"|\""$(cat ../global/.version)"\"|g" package.json
|
||||
yarn --no-lockfile install
|
||||
yarn --no-lockfile build
|
||||
mkdir dist/.well-known
|
||||
cp ../security.txt dist/.well-known
|
||||
|
||||
export NODE_OPTIONS=--openssl-legacy-provider
|
||||
npm install --global yarn
|
||||
cd frontend
|
||||
sed -i "s|\"0.0.0\"|\""$(cat ../global/.version)"\"|g" package.json
|
||||
yarn --no-lockfile install
|
||||
yarn --no-lockfile build
|
||||
mkdir dist/.well-known
|
||||
cp ../security.txt dist/.well-known
|
||||
curl https://api.github.com/repos/${{ github.repository }}/actions/caches?key=frontend -X DELETE --header "authorization: Bearer ${{ secrets.GITHUB_TOKEN }}"
|
||||
- name: Cache frontend
|
||||
uses: actions/cache/save@v3
|
||||
with:
|
||||
|
2
.github/workflows/json.yml
vendored
2
.github/workflows/json.yml
vendored
@@ -1,10 +1,8 @@
|
||||
name: JSON check
|
||||
|
||||
on:
|
||||
push:
|
||||
pull_request:
|
||||
workflow_dispatch:
|
||||
|
||||
jobs:
|
||||
test-json:
|
||||
runs-on: ubuntu-latest
|
||||
|
@@ -1,5 +1,4 @@
|
||||
name: Build PR
|
||||
|
||||
on:
|
||||
pull_request:
|
||||
paths:
|
||||
@@ -9,91 +8,75 @@ on:
|
||||
- backend/**
|
||||
- global/**
|
||||
- rootfs/**
|
||||
|
||||
jobs:
|
||||
backend-test:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v3
|
||||
|
||||
- uses: actions/setup-node@v3
|
||||
with:
|
||||
node-version: 18
|
||||
|
||||
- name: Test Backend
|
||||
run: |
|
||||
sudo npm install --global cross-env
|
||||
sudo pip install certbot
|
||||
sudo mkdir -p /usr/local/nginx/conf/conf.d/include /data/tls/certbot /tmp/acme-challenge
|
||||
sudo touch /usr/local/nginx/conf/conf.d/include/ip_ranges.conf
|
||||
sudo cp rootfs/etc/tls/certbot.ini /data/tls/certbot/config.ini
|
||||
mv global backend
|
||||
cd backend
|
||||
npm install --force
|
||||
sudo nginx
|
||||
cross-env NODE_ENV=production sudo -E timeout 30 node --abort_on_uncaught_exception --max_old_space_size=250 index.js || if [ "$?" == "124" ]; then exit 0; else exit 1; fi
|
||||
|
||||
sudo pip install certbot
|
||||
sudo mkdir -p /usr/local/nginx/conf/conf.d/include /data/tls/certbot /tmp/acme-challenge
|
||||
sudo touch /usr/local/nginx/conf/conf.d/include/ip_ranges.conf
|
||||
sudo cp rootfs/etc/tls/certbot.ini /data/tls/certbot/config.ini
|
||||
mv global backend
|
||||
cd backend
|
||||
npm install --force
|
||||
sudo nginx
|
||||
NODE_ENV=production sudo -E timeout 30 node --abort_on_uncaught_exception --max_old_space_size=250 index.js || if [ "$?" == "124" ]; then exit 0; else exit 1; fi
|
||||
- name: Kill workflow
|
||||
if: failure()
|
||||
run: |
|
||||
curl -X POST https://api.github.com/repos/${{ github.repository }}/actions/runs/${{ github.run_id }}/cancel --header "authorization: Bearer ${{ secrets.GITHUB_TOKEN }}"
|
||||
|
||||
curl -X POST https://api.github.com/repos/${{ github.repository }}/actions/runs/${{ github.run_id }}/cancel --header "authorization: Bearer ${{ secrets.GITHUB_TOKEN }}"
|
||||
build:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v3
|
||||
|
||||
- uses: actions/setup-node@v3
|
||||
with:
|
||||
node-version: 18
|
||||
|
||||
- name: Prepair frontend
|
||||
- name: Prepare frontend
|
||||
run: |
|
||||
export NODE_OPTIONS=--openssl-legacy-provider
|
||||
npm install --global yarn
|
||||
cd frontend
|
||||
sed -i "s|\"0.0.0\"|\""$(cat ../global/.version)"\"|g" package.json
|
||||
yarn --no-lockfile install
|
||||
yarn --no-lockfile build
|
||||
mkdir dist/.well-known
|
||||
cp ../security.txt dist/.well-known
|
||||
|
||||
export NODE_OPTIONS=--openssl-legacy-provider
|
||||
npm install --global yarn
|
||||
cd frontend
|
||||
sed -i "s|\"0.0.0\"|\""$(cat ../global/.version)"\"|g" package.json
|
||||
yarn --no-lockfile install
|
||||
yarn --no-lockfile build
|
||||
mkdir dist/.well-known
|
||||
cp ../security.txt dist/.well-known
|
||||
- name: Set up QEMU
|
||||
uses: docker/setup-qemu-action@v2
|
||||
with:
|
||||
with:
|
||||
platforms: arm64 #all
|
||||
|
||||
- name: Set up Docker Buildx
|
||||
id: buildx
|
||||
uses: docker/setup-buildx-action@v2
|
||||
with:
|
||||
driver-opts: env.BUILDKIT_STEP_LOG_MAX_SIZE=-1
|
||||
|
||||
- name: Login to GitHub Container Registry
|
||||
uses: docker/login-action@v2
|
||||
with:
|
||||
registry: ghcr.io
|
||||
username: ${{ secrets.DOCKER_USERNAME }}
|
||||
password: ${{ github.token }}
|
||||
|
||||
- name: Set PR-Number
|
||||
id: pr
|
||||
run: echo "pr=$(echo pr-${{ github.ref_name }} | sed "s/refs\/pull\/://g" | sed "s/\/merge//g")" >> $GITHUB_OUTPUT
|
||||
|
||||
run: echo "pr=$(echo pr-${{ github.ref_name }} | sed "s|refs/pull/:||g" | sed "s|/merge||g")" >> $GITHUB_OUTPUT
|
||||
- name: Build
|
||||
uses: docker/build-push-action@v3
|
||||
uses: docker/build-push-action@v4
|
||||
with:
|
||||
context: .
|
||||
file: ./Dockerfile
|
||||
platforms: linux/amd64,linux/arm64 #,linux/amd64/v2,linux/amd64/v3,linux/amd64/v4 #,linux/ppc64le,linux/s390x,linux/386,linux/arm/v7,linux/arm/v6
|
||||
push: ${{ github.event_name == 'pull_request' }}
|
||||
tags: ghcr.io/${{ secrets.DOCKER_USERNAME }}/${{ github.event.repository.name }}:${{ steps.pr.outputs.pr }}
|
||||
|
||||
- name: show version
|
||||
run: docker run --rm --entrypoint nginx ghcr.io/${{ secrets.DOCKER_USERNAME }}/${{ github.event.repository.name }}:${{ steps.pr.outputs.pr }} -V
|
||||
|
||||
- name: add comment
|
||||
uses: mshick/add-pr-comment@v2
|
||||
with:
|
16
.github/workflows/shellcheck.yml
vendored
16
.github/workflows/shellcheck.yml
vendored
@@ -1,19 +1,17 @@
|
||||
name: Shellcheck
|
||||
|
||||
on:
|
||||
push:
|
||||
pull_request:
|
||||
workflow_dispatch:
|
||||
|
||||
jobs:
|
||||
shellcheck:
|
||||
name: Check Shell
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v3
|
||||
- name: Run Shellcheck
|
||||
uses: ludeeus/action-shellcheck@master
|
||||
with:
|
||||
check_together: 'yes'
|
||||
env:
|
||||
SHELLCHECK_OPTS: --shell sh
|
||||
- uses: actions/checkout@v3
|
||||
- name: Run Shellcheck
|
||||
uses: ludeeus/action-shellcheck@master
|
||||
with:
|
||||
check_together: 'yes'
|
||||
env:
|
||||
SHELLCHECK_OPTS: --shell sh
|
||||
|
2
.github/workflows/spellcheck.yml
vendored
2
.github/workflows/spellcheck.yml
vendored
@@ -11,4 +11,4 @@ jobs:
|
||||
uses: reviewdog/action-misspell@v1
|
||||
with:
|
||||
github_token: ${{ secrets.github_token }}
|
||||
locale: "US"
|
||||
locale: "US"
|
||||
|
20
.github/workflows/yq.yml
vendored
Normal file
20
.github/workflows/yq.yml
vendored
Normal file
@@ -0,0 +1,20 @@
|
||||
name: yq
|
||||
on:
|
||||
workflow_dispatch:
|
||||
jobs:
|
||||
yq:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v3
|
||||
with:
|
||||
token: ${{ secrets.YQ }}
|
||||
- name: update workflows
|
||||
run: for workflow in .github/workflows/*.yml; do yq "$workflow" | tee "$workflow".tmp && mv "$workflow".tmp "$workflow"; done
|
||||
- name: push changes
|
||||
run: |
|
||||
git config user.name "GitHub"
|
||||
git config user.email "noreply@github.com"
|
||||
git add -A
|
||||
git diff-index --quiet HEAD || git commit -sm "yq"
|
||||
git push
|
Reference in New Issue
Block a user