diff --git a/Dockerfile b/Dockerfile index cf10bf4..e353c40 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,6 +1,9 @@ FROM debian:bookworm-slim -RUN groupadd --system --gid 10001 netfishing \ +RUN DEBIAN_FRONTEND=noninteractive apt-get update \ + && DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends tzdata \ + && rm -rf /var/lib/apt/lists/* \ + && groupadd --system --gid 10001 netfishing \ && useradd --system --uid 10001 --gid netfishing \ --home-dir /var/lib/netfishing-server netfishing \ && install -d -o netfishing -g netfishing \ diff --git a/README.md b/README.md index 3f2d0ea..6abaaba 100644 --- a/README.md +++ b/README.md @@ -61,7 +61,11 @@ sudo ./scripts/rollback-native.sh ``` Copy `config/server.cfg.example` to `/etc/netfishing-server.cfg` and adjust the -room name, UDP port, player limit, and public-listing preference. Forward the +room name, UDP port, player limit, and public-listing preference. Set `TZ` in +`/etc/netfishing-server.env` to an IANA timezone such as `America/New_York` when +the server's world should follow that region's wall clock and daylight-saving +rules; the packaged default is `UTC`. The timezone must be present before the +server process starts, so restart the service after changing it. Forward the configured UDP port through the host firewall and router when accepting Internet players. @@ -135,8 +139,8 @@ docker compose up -d ``` Set values such as `NETFISHING_SERVER_NAME`, `NETFISHING_SERVER_PORT`, -`NETFISHING_SERVER_MAX_PLAYERS`, `NETFISHING_SERVER_PUBLIC`, and the optional -comma-separated `NETFISHING_SERVER_OPERATORS` in a local `.env` file. The +`NETFISHING_SERVER_MAX_PLAYERS`, `NETFISHING_SERVER_PUBLIC`, `TZ`, and the +optional comma-separated `NETFISHING_SERVER_OPERATORS` in a local `.env` file. The Compose service runs without Linux capabilities, uses a read-only root filesystem, and stores persistent state in a named volume. diff --git a/compose.yaml b/compose.yaml index 413342c..50a8fcd 100644 --- a/compose.yaml +++ b/compose.yaml @@ -18,6 +18,7 @@ services: NETFISHING_SERVER_PUBLIC: "${NETFISHING_SERVER_PUBLIC:-false}" NETFISHING_DISCOVERY_URL: "${NETFISHING_DISCOVERY_URL:-https://discovery.netfishing.org}" NETFISHING_DATA_DIR: /var/lib/netfishing-server + TZ: "${TZ:-UTC}" NETFISHING_SERVER_OPERATORS: "${NETFISHING_SERVER_OPERATORS:-}" volumes: - netfishing-server-data:/var/lib/netfishing-server diff --git a/config/netfishing-server.env.example b/config/netfishing-server.env.example index 78d7c16..dbabf24 100644 --- a/config/netfishing-server.env.example +++ b/config/netfishing-server.env.example @@ -5,4 +5,5 @@ NETFISHING_SERVER_MAX_PLAYERS=8 NETFISHING_SERVER_PUBLIC=false NETFISHING_DISCOVERY_URL=https://discovery.netfishing.org NETFISHING_DATA_DIR=/var/lib/netfishing-server +TZ=UTC NETFISHING_SERVER_OPERATORS= diff --git a/systemd/netfishing-server.service b/systemd/netfishing-server.service index 3cae181..7e936a0 100644 --- a/systemd/netfishing-server.service +++ b/systemd/netfishing-server.service @@ -8,6 +8,7 @@ Type=simple User=netfishing Group=netfishing WorkingDirectory=/opt/netfishing-server/current +Environment=TZ=UTC EnvironmentFile=-/etc/netfishing-server.env ExecStart=/opt/netfishing-server/current/NETfishingServer.x86_64 -- --config=/etc/netfishing-server.cfg Restart=on-failure