From 27fca64a69067eaa094d1559ca1fee4f064d89a7 Mon Sep 17 00:00:00 2001 From: Zyanido <13342764+Zyanido@users.noreply.github.com> Date: Sat, 5 Apr 2025 16:45:55 +0200 Subject: [PATCH] feat: add env variable to disable caddy (#797) --- docs/docs/setup/configuration.md | 5 +++-- scripts/docker/entrypoint.sh | 13 +++++++++---- 2 files changed, 12 insertions(+), 6 deletions(-) diff --git a/docs/docs/setup/configuration.md b/docs/docs/setup/configuration.md index c615db9..c7eee2e 100644 --- a/docs/docs/setup/configuration.md +++ b/docs/docs/setup/configuration.md @@ -49,5 +49,6 @@ 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. | -| `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). | +| `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). | diff --git a/scripts/docker/entrypoint.sh b/scripts/docker/entrypoint.sh index b2b5c54..ce7ecd2 100644 --- a/scripts/docker/entrypoint.sh +++ b/scripts/docker/entrypoint.sh @@ -3,11 +3,16 @@ # Copy default logo to the frontend public folder if it doesn't exist cp -rn /tmp/img/* /opt/app/frontend/public/img -# Start Caddy -if [ "$TRUST_PROXY" = "true" ]; then - caddy start --adapter caddyfile --config /opt/app/reverse-proxy/Caddyfile.trust-proxy & +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 - caddy start --adapter caddyfile --config /opt/app/reverse-proxy/Caddyfile & + echo "Caddy is disabled. Skipping..." fi # Run the frontend server