From 0ad84b34158b1997641c5dda3d77e51b67aa0ab0 Mon Sep 17 00:00:00 2001 From: PassiveLemon Date: Thu, 26 Dec 2024 16:17:02 -0500 Subject: [PATCH] Add 2 new flags --- docker/Dockerfile | 2 ++ docker/README.md | 2 ++ docker/entrypoint.sh | 9 +++++++-- 3 files changed, 11 insertions(+), 2 deletions(-) diff --git a/docker/Dockerfile b/docker/Dockerfile index bb87d4f..2099358 100644 --- a/docker/Dockerfile +++ b/docker/Dockerfile @@ -44,6 +44,7 @@ ENV ZEROTIER="false" ENV AUTORENEW="86400" ENV CFGUPGRADE="true" +ENV DB="auto" ENV DOCKER="true" ENV EARLYRENEW="30" ENV FASTGEOIP="false" @@ -52,6 +53,7 @@ ENV MDNSNAME="''" ENV NOAUTH="false" ENV PORT="8000" ENV SSHLB="false" +ENV UPDATE_GEOIP="false" ENV VERSION="false" ENV WEBFM="true" ENV WEBROOT="./www" diff --git a/docker/README.md b/docker/README.md index 96e27d2..dde85ac 100644 --- a/docker/README.md +++ b/docker/README.md @@ -73,6 +73,7 @@ Variables are the same as those in [Start Parameters](https://github.com/tobychu |:-|:-|:-| | `AUTORENEW` | `86400` (Integer) | ACME auto TLS/SSL certificate renew check interval. | | `CFGUPGRADE` | `true` (Boolean) | Enable auto config upgrade if breaking change is detected. | +| `DB` | `auto` (String) | Database backend to use (leveldb, boltdb, auto) Note that fsdb will be used on unsupported platforms like RISCV (default "auto"). | | `DOCKER` | `true` (Boolean) | Run Zoraxy in docker compatibility mode. | | `EARLYRENEW` | `30` (Integer) | Number of days to early renew a soon expiring certificate. | | `FASTGEOIP` | `false` (Boolean) | Enable high speed geoip lookup, require 1GB extra memory (Not recommend for low end devices). | @@ -81,6 +82,7 @@ Variables are the same as those in [Start Parameters](https://github.com/tobychu | `NOAUTH` | `false` (Boolean) | Disable authentication for management interface. | | `PORT` | `8000` (Integer) | Management web interface listening port | | `SSHLB` | `false` (Boolean) | Allow loopback web ssh connection (DANGER). | +| `UPDATE_GEOIP` | `false` (Boolean) | Download the latest GeoIP data and exit. | | `VERSION` | `false` (Boolean) | Show version of this server. | | `WEBFM` | `true` (Boolean) | Enable web file manager for static web server root folder. | | `WEBROOT` | `./www` (String) | Static web server root folder. Only allow change in start parameters. | diff --git a/docker/entrypoint.sh b/docker/entrypoint.sh index d39db70..106acc5 100644 --- a/docker/entrypoint.sh +++ b/docker/entrypoint.sh @@ -1,7 +1,10 @@ #!/usr/bin/env bash update-ca-certificates -echo "CA certificates updated" +echo "CA certificates updated." + +zoraxy -update_geoip=true +echo "Updated GeoIP data." if [ "$ZEROTIER" = "true" ]; then if [ ! -d "/opt/zoraxy/config/zerotier/" ]; then @@ -9,13 +12,14 @@ if [ "$ZEROTIER" = "true" ]; then fi ln -s /opt/zoraxy/config/zerotier/ /var/lib/zerotier-one zerotier-one -d - echo "ZeroTier daemon started" + echo "ZeroTier daemon started." fi echo "Starting Zoraxy..." exec zoraxy \ -autorenew="$AUTORENEW" \ -cfgupgrade="$CFGUPGRADE" \ + -db="$DB" \ -docker="$DOCKER" \ -earlyrenew="$EARLYRENEW" \ -fastgeoip="$FASTGEOIP" \ @@ -24,6 +28,7 @@ exec zoraxy \ -noauth="$NOAUTH" \ -port=:"$PORT" \ -sshlb="$SSHLB" \ + -update_geoip="$UPDATE_GEOIP" \ -version="$VERSION" \ -webfm="$WEBFM" \ -webroot="$WEBROOT" \