diff --git a/README.md b/README.md index 1d28588..03eca2b 100644 --- a/README.md +++ b/README.md @@ -64,6 +64,7 @@ docker create \ -e PUID=1000 \ -e PGID=1000 \ -e TZ=Europe/London \ + -e WEBROOT=domoticz `#optional` \ -p 8080:8080 \ -p 6144:6144 \ -p 1443:1443 \ @@ -101,6 +102,7 @@ services: - PUID=1000 - PGID=1000 - TZ=Europe/London + - WEBROOT=domoticz #optional volumes: - :/config ports: @@ -124,6 +126,7 @@ Container images are configured using parameters passed at runtime (such as thos | `-e PUID=1000` | for UserID - see below for explanation | | `-e PGID=1000` | for GroupID - see below for explanation | | `-e TZ=Europe/London` | Specify a timezone to use EG Europe/London. | +| `-e WEBROOT=domoticz` | Sets webroot to domoticz for usage with subfolder reverse proxy. Not needed unless reverse proxying. | | `-v /config` | Where Domoticz stores config files and data. | | `--device ` | For passing through USB devices. | @@ -190,6 +193,7 @@ Below are the instructions for updating containers: ## Versions +* **30.03.19:** - Add env variable to set webroot. * **23.03.19:** - Switching to new Base images, shift to arm32v7 tag. * **19.02.19:** - Fix branch for version logic. * **11.02.19:** - Add pipeline logic and multi arch. diff --git a/readme-vars.yml b/readme-vars.yml index a5741ac..df9e1be 100644 --- a/readme-vars.yml +++ b/readme-vars.yml @@ -45,7 +45,9 @@ param_devices: cap_add_param: false # optional container parameters -opt_param_usage_include_env: false +opt_param_usage_include_env: true +opt_param_env_vars: + - { env_var: "WEBROOT", env_value: "domoticz", desc: "Sets webroot to domoticz for usage with subfolder reverse proxy. Not needed unless reverse proxying." } opt_param_usage_include_vols: false opt_param_usage_include_ports: false opt_param_device_map: false @@ -73,6 +75,7 @@ app_setup_block: | # changelog changelogs: + - { date: "30.03.19:", desc: "Add env variable to set webroot." } - { date: "23.03.19:", desc: "Switching to new Base images, shift to arm32v7 tag." } - { date: "19.02.19:", desc: "Fix branch for version logic." } - { date: "11.02.19:", desc: "Add pipeline logic and multi arch." } diff --git a/root/etc/services.d/domoticz/run b/root/etc/services.d/domoticz/run index 639436e..5430e8b 100644 --- a/root/etc/services.d/domoticz/run +++ b/root/etc/services.d/domoticz/run @@ -1,7 +1,11 @@ #!/usr/bin/with-contenv bash + +IFS=" " read -r -a RUN_ARRAY <<< "$WEBROOT" + exec \ s6-setuidgid abc /var/lib/domoticz/domoticz \ -sslwww 1443 \ -sslcert /config/keys/server_cert.pem \ -userdata /config/ \ - -dbase /config/domoticz.db + -dbase /config/domoticz.db \ + -webroot "${RUN_ARRAY[@]}"