diff --git a/README.md b/README.md index 0891014..206f380 100644 --- a/README.md +++ b/README.md @@ -5,7 +5,7 @@ It reads and writes the plugin's records table directly and keeps its own tables ## Requirements - MySQL or MariaDB with a `utf8mb4` database holding the plugin's `records` table. The application never creates or alters it. -- A dedicated database user with the least-privilege grants listed in the [source README](https://git.bjphoster.com/source/coredns-web-ui#mysql-grants). `DB_TABLE_PREFIX` must match the plugin's `table_prefix`. +- A dedicated database user with the least-privilege grants listed in the [source README](https://git.bjphoster.com/source/coredns-web-ui#mysql-grants). `CWUI_DB_TABLE_PREFIX` must match the plugin's `table_prefix`. ## Usage ```sh @@ -14,7 +14,7 @@ cp env.example .env docker compose up -d ``` -`TRUSTED_PROXIES` must cover the Træfik network, otherwise sessions and audit rows record Træfik's address as the client origin. +`CWUI_TRUSTED_PROXIES` must cover the Træfik network, otherwise sessions and audit rows record Træfik's address as the client origin. Create the first admin from the running container, then manage the other users from the web UI: ```sh @@ -27,7 +27,7 @@ docker compose exec coredns-web-ui /app help ``` ## Update -Set `COREDNS_WEBUI_VERSION` in `.env`, then: +Set `CWUI_VERSION` in `.env`, then: ```sh docker compose pull docker compose up -d diff --git a/docker-compose.yml b/docker-compose.yml index 1231eae..f4eae6d 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -1,25 +1,25 @@ --- services: coredns-web-ui: - image: git.bjphoster.com/source/coredns-web-ui:${COREDNS_WEBUI_VERSION} + image: git.bjphoster.com/source/coredns-web-ui:${CWUI_VERSION} restart: unless-stopped stop_grace_period: 30s environment: - - DB_HOST=${DB_HOST} - - DB_PORT=${DB_PORT} - - DB_USER=${DB_USER} - - DB_PASSWORD=${DB_PASSWORD} - - DB_NAME=${DB_NAME} - - DB_TLS=${DB_TLS} - - DB_TABLE_PREFIX=${DB_TABLE_PREFIX} + - DB_HOST=${CWUI_DB_HOST} + - DB_PORT=${CWUI_DB_PORT} + - DB_USER=${CWUI_DB_USER} + - DB_PASSWORD=${CWUI_DB_PASSWORD} + - DB_NAME=${CWUI_DB_NAME} + - DB_TLS=${CWUI_DB_TLS} + - DB_TABLE_PREFIX=${CWUI_DB_TABLE_PREFIX} - HTTP_ADDR=0.0.0.0 - HTTP_PORT=${TRAEFIK_SERVICE_PORT} - - LOG_LEVEL=${LOG_LEVEL} - - APP_NAME=${APP_NAME} - - COOKIE_SECURE=${COOKIE_SECURE} - - SESSION_IDLE_TIMEOUT=${SESSION_IDLE_TIMEOUT} - - SESSION_MAX_AGE=${SESSION_MAX_AGE} - - TRUSTED_PROXIES=${TRUSTED_PROXIES} + - LOG_LEVEL=${CWUI_LOG_LEVEL} + - APP_NAME=${CWUI_APP_NAME} + - COOKIE_SECURE=${CWUI_COOKIE_SECURE} + - SESSION_IDLE_TIMEOUT=${CWUI_SESSION_IDLE_TIMEOUT} + - SESSION_MAX_AGE=${CWUI_SESSION_MAX_AGE} + - TRUSTED_PROXIES=${CWUI_TRUSTED_PROXIES} labels: ### Section Træfik - traefik.enable=${TRAEFIK_ENABLED} diff --git a/env.example b/env.example index 92c03c5..0d7d848 100644 --- a/env.example +++ b/env.example @@ -10,18 +10,18 @@ TRAEFIK_CERTRESOLVER=letsencrypt TRAEFIK_MIDDLEWARES=hsts # coredns-web-ui -COREDNS_WEBUI_VERSION=0.0.1-alpha3 -DB_HOST=mysql.example.com -DB_PORT=3306 -DB_USER=coredns_webui -DB_PASSWORD=changeme -DB_NAME=coredns -DB_TLS=false -DB_TABLE_PREFIX=coredns_ -LOG_LEVEL=INFO -APP_NAME=CoreDNS Web UI -COOKIE_SECURE=true -SESSION_IDLE_TIMEOUT=1h -SESSION_MAX_AGE=12h +CWUI_VERSION=0.0.1-alpha3 +CWUI_DB_HOST=mysql.example.com +CWUI_DB_PORT=3306 +CWUI_DB_USER=coredns_webui +CWUI_DB_PASSWORD=changeme +CWUI_DB_NAME=coredns +CWUI_DB_TLS=false +CWUI_DB_TABLE_PREFIX=coredns_ +CWUI_LOG_LEVEL=INFO +CWUI_APP_NAME=CoreDNS Web UI +CWUI_COOKIE_SECURE=true +CWUI_SESSION_IDLE_TIMEOUT=1h +CWUI_SESSION_MAX_AGE=12h # CIDR of the Træfik network, so the client address comes from X-Forwarded-For -TRUSTED_PROXIES=172.16.0.0/12 +CWUI_TRUSTED_PROXIES=172.16.0.0/12