From f20ac885b87e0a3747b04489bbd06fbf84574402 Mon Sep 17 00:00:00 2001 From: aceberg <1502200+aceberg@users.noreply.github.com> Date: Sat, 2 Nov 2024 01:01:38 +0700 Subject: [PATCH] Dockerfile: scratch -> alpine --- .github/workflows/main-docker-all.yml | 2 +- .goreleaser.yaml | 2 +- Dockerfile | 2 +- README.md | 2 +- configs/ForAuth.service | 12 ++++++++++++ configs/ForAuth@.service | 13 +++++++++++++ configs/install.sh | 5 +++++ configs/postinstall.sh | 3 +++ internal/web/templates/config.html | 10 +++++++--- 9 files changed, 44 insertions(+), 7 deletions(-) create mode 100644 configs/ForAuth.service create mode 100644 configs/ForAuth@.service create mode 100755 configs/install.sh create mode 100644 configs/postinstall.sh diff --git a/.github/workflows/main-docker-all.yml b/.github/workflows/main-docker-all.yml index 5d2a340..d0fb033 100644 --- a/.github/workflows/main-docker-all.yml +++ b/.github/workflows/main-docker-all.yml @@ -48,7 +48,7 @@ jobs: uses: docker/build-push-action@v6 with: context: . - platforms: linux/amd64,linux/arm/v7,linux/arm64 + platforms: linux/amd64,linux/arm/v7,linux/arm64,linux/arm/v6 push: true tags: | ${{ secrets.DOCKER_USERNAME }}/${{ env.IMAGE_NAME }}:v2 diff --git a/.goreleaser.yaml b/.goreleaser.yaml index 5943985..a54b961 100644 --- a/.goreleaser.yaml +++ b/.goreleaser.yaml @@ -29,7 +29,7 @@ builds: nfpms: - maintainer: aceberg - description: Session-cookie auth reverse proxy + description: Reverse proxy with session-cookie auth homepage: https://github.com/aceberg/ForAuth license: MIT section: utils diff --git a/Dockerfile b/Dockerfile index 314f2b7..b8e5aa2 100644 --- a/Dockerfile +++ b/Dockerfile @@ -5,7 +5,7 @@ COPY . /src RUN cd /src/cmd/ForAuth/ && CGO_ENABLED=0 go build -o /ForAuth . -FROM scratch +FROM alpine WORKDIR /data/ForAuth WORKDIR /app diff --git a/README.md b/README.md index e9c00cb..1059f7f 100644 --- a/README.md +++ b/README.md @@ -29,7 +29,7 @@ Configuration can be done through config file or environment variables | FA_HOST | Listen address for both Config and Proxy | 0.0.0.0 | | FA_PORT | Port for Proxy | 8800 | | FA_PORTCONF | Port for Config page | 8801 | -| FA_TARGET | Where to proxy after login (host:port). Example: `0.0.0.0:8840` | | +| FA_TARGET | Where to proxy after login (host:port). Example: `192.168.1.1:8840` | | | FA_THEME | Any theme name from https://bootswatch.com in lowcase or [additional](https://github.com/aceberg/aceberg-bootswatch-fork) (emerald, grass, grayscale, ocean, sand, wood)| united | | FA_COLOR | Background color: light or dark | dark | | FA_NODEPATH | Path to local JS and Themes ([node-bootstrap](https://github.com/aceberg/my-dockerfiles/tree/main/node-bootstrap)) | | diff --git a/configs/ForAuth.service b/configs/ForAuth.service new file mode 100644 index 0000000..04d01ac --- /dev/null +++ b/configs/ForAuth.service @@ -0,0 +1,12 @@ +[Unit] +Description=ForAuth +Documentation=https://github.com/aceberg/ForAuth +After=network-online.target +Wants=network-online.target + +[Service] +ExecStart=/usr/bin/forauth -d /etc/ForAuth/ +Restart=on-failure + +[Install] +WantedBy=multi-user.target \ No newline at end of file diff --git a/configs/ForAuth@.service b/configs/ForAuth@.service new file mode 100644 index 0000000..d7a4a6f --- /dev/null +++ b/configs/ForAuth@.service @@ -0,0 +1,13 @@ +[Unit] +Description=ForAuth +Documentation=https://github.com/aceberg/ForAuth +After=network-online.target +Wants=network-online.target + +[Service] +User=%i +ExecStart=/usr/bin/forauth -d /home/%i/.config/ForAuth/ +Restart=on-failure + +[Install] +WantedBy=multi-user.target \ No newline at end of file diff --git a/configs/install.sh b/configs/install.sh new file mode 100755 index 0000000..59121fb --- /dev/null +++ b/configs/install.sh @@ -0,0 +1,5 @@ +#!/bin/sh + +cp forauth /usr/bin/ +cp ForAuth.service /lib/systemd/system/ +cp ForAuth@.service /lib/systemd/system/ \ No newline at end of file diff --git a/configs/postinstall.sh b/configs/postinstall.sh new file mode 100644 index 0000000..e15db17 --- /dev/null +++ b/configs/postinstall.sh @@ -0,0 +1,3 @@ +#!/bin/sh + +systemctl daemon-reload \ No newline at end of file diff --git a/internal/web/templates/config.html b/internal/web/templates/config.html index 948dfd0..54195f3 100644 --- a/internal/web/templates/config.html +++ b/internal/web/templates/config.html @@ -10,7 +10,7 @@ - + @@ -104,8 +104,12 @@
-

If you find this app useful, please, donate

-

Commission you own app (Golang, HTML/JS). Contact and prices here

+

● Proxy Port - default 8800

+

● Config Port - config GUI can be reached on this port. Default 8801

+

● Target - where to proxy after login (host:port). Example: 192.168.1.1:8840

+

● Node path - path to local Fonts and Themes (node-bootstrap)

+

● Notify URL - provides notifications to Discord, Email, Gotify, Telegram and other services. Link to documentation

+

If you find this app useful, please, donate

Proxy HostHost