feat: add env variable to disable caddy (#797)

This commit is contained in:
Zyanido
2025-04-05 16:45:55 +02:00
committed by GitHub
parent 7d005db4e1
commit 27fca64a69
2 changed files with 12 additions and 6 deletions

View File

@@ -50,4 +50,5 @@ Environment variables that are only available when running Pingvin Share with Do
| Variable | Default Value | Description |
| ----------------- | ------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `TRUST_PROXY` | `false` | Whether Pingvin Share is behind a reverse proxy. If set to `true`, the `X-Forwarded-For` header is trusted. |
| `CADDY_DISABLED` | `false` | Configures if Pingvin Share is starting built-in Caddy. If set to `true`, Caddy will not be started. If disabled, you must configure your reverse proxy to correctly map all paths. Refer to the [official Caddyfile](https://github.com/stonith404/pingvin-share/blob/main/reverse-proxy/Caddyfile) for guidance. |
| `PUID` and `PGID` | `1000` | The user and group ID of the user who should run Pingvin Share inside the Docker container and owns the files that are mounted with the volume. You can get the `PUID` and `GUID` of your user on your host machine by using the command `id`. For more information see [this article](https://docs.linuxserver.io/general/understanding-puid-and-pgid/#using-the-variables). |

View File

@@ -3,12 +3,17 @@
# Copy default logo to the frontend public folder if it doesn't exist
cp -rn /tmp/img/* /opt/app/frontend/public/img
if [ "$CADDY_DISABLED" != "true" ]; then
# Start Caddy
echo "Starting Caddy..."
if [ "$TRUST_PROXY" = "true" ]; then
caddy start --adapter caddyfile --config /opt/app/reverse-proxy/Caddyfile.trust-proxy &
else
caddy start --adapter caddyfile --config /opt/app/reverse-proxy/Caddyfile &
fi
else
echo "Caddy is disabled. Skipping..."
fi
# Run the frontend server
PORT=3333 HOSTNAME=0.0.0.0 node frontend/server.js &