From c9c5c41f8c0a4fbad41b90be7217beb3d9efd90d Mon Sep 17 00:00:00 2001 From: Paul Sinclair Date: Wed, 20 Jan 2021 14:04:38 -0500 Subject: [PATCH 1/4] =?UTF-8?q?=E2=9C=A8=20Add=20envvar=20option?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- bookstack/config.json | 9 ++++++++- bookstack/rootfs/etc/services.d/php-fpm/run | 7 +++++++ 2 files changed, 15 insertions(+), 1 deletion(-) diff --git a/bookstack/config.json b/bookstack/config.json index b46ef70..66516e9 100644 --- a/bookstack/config.json +++ b/bookstack/config.json @@ -17,6 +17,7 @@ "80/tcp": "Web interface" }, "options": { + "envvars": [], "ssl": false, "certfile": "fullchain.pem", "keyfile": "privkey.pem" @@ -31,6 +32,12 @@ "log_level": "list(trace|debug|info|notice|warning|error|fatal)?", "certfile": "str", "keyfile": "str", - "ssl": "bool" + "ssl": "bool", + "envvars": [ + { + "name": "str", + "value": "str" + } + ] } } diff --git a/bookstack/rootfs/etc/services.d/php-fpm/run b/bookstack/rootfs/etc/services.d/php-fpm/run index 9065ec0..471ec9d 100644 --- a/bookstack/rootfs/etc/services.d/php-fpm/run +++ b/bookstack/rootfs/etc/services.d/php-fpm/run @@ -11,6 +11,13 @@ export DB_PASSWORD export DB_PORT export DB_USERNAME +for envvar in $(bashio::config 'envvars|keys'); do + name=$(bashio::config "envvars[${envvar}].name") + value=$(bashio::config "envvars[${envvar}].value") + bashio::log.debug "Setting Env Variable ${name} to ${value}" + export "${name}=${value}" +done + APP_KEY=$(cat /data/bookstack/appkey.txt) if bashio::config.has_value 'remote_mysql_host';then From d3dd983d3b72fedf9cb288db18a09c40bc442032 Mon Sep 17 00:00:00 2001 From: Paul Sinclair Date: Wed, 20 Jan 2021 14:04:58 -0500 Subject: [PATCH 2/4] =?UTF-8?q?=F0=9F=93=9A=20Update=20docs=20for=20new=20?= =?UTF-8?q?option?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- bookstack/DOCS.md | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) diff --git a/bookstack/DOCS.md b/bookstack/DOCS.md index 36ed32b..e617b63 100644 --- a/bookstack/DOCS.md +++ b/bookstack/DOCS.md @@ -25,6 +25,9 @@ log_level: info ssl: false certfile: fullchain.pem keyfile: privkey.pem +envvars: + - name: SESSION_COOKIE_NAME + value: bookstack_session ``` **Note**: _This is just an example, don't copy and paste it! Create your own!_ @@ -91,6 +94,26 @@ Only applies if a remote MYSQL database is used, the password of the above user. Only applies if a remote MYSQL database is used, the port that the database server is listening on. +### Option: `envvars` + +This allows the setting of Environment Variables to control Bookstack +configuration as documented at: + + + +**Note**: _Changing these options can possibly cause issues with you instance. +USE AT YOUR OWN RISK!_ + +These are case sensitive. Items set by specific configuration will take +precedence. + +#### Sub-option: `name` + +The name of the environment variable to set. + +#### Sub-option: `value` + +The value of the environment variable to set. ## Database usage By default, Bookstack will automatically use and configure the Home Assistant From 24180f378d91e6252ebe1a7447481ae0d5f8c81d Mon Sep 17 00:00:00 2001 From: Paul Sinclair Date: Wed, 20 Jan 2021 14:11:27 -0500 Subject: [PATCH 3/4] =?UTF-8?q?=E2=9C=8F=20Fix=20linting?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- bookstack/DOCS.md | 1 + 1 file changed, 1 insertion(+) diff --git a/bookstack/DOCS.md b/bookstack/DOCS.md index e617b63..b4c7f4f 100644 --- a/bookstack/DOCS.md +++ b/bookstack/DOCS.md @@ -114,6 +114,7 @@ The name of the environment variable to set. #### Sub-option: `value` The value of the environment variable to set. + ## Database usage By default, Bookstack will automatically use and configure the Home Assistant From 518fb7c5a8d8f067fb6c6fc75f2bb1b4123111b6 Mon Sep 17 00:00:00 2001 From: Paul Sinclair Date: Wed, 20 Jan 2021 14:33:34 -0500 Subject: [PATCH 4/4] =?UTF-8?q?=E2=9C=8F=20Linting=20for=20Prettier?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- bookstack/DOCS.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/bookstack/DOCS.md b/bookstack/DOCS.md index b4c7f4f..f56a388 100644 --- a/bookstack/DOCS.md +++ b/bookstack/DOCS.md @@ -99,12 +99,12 @@ server is listening on. This allows the setting of Environment Variables to control Bookstack configuration as documented at: - + **Note**: _Changing these options can possibly cause issues with you instance. USE AT YOUR OWN RISK!_ -These are case sensitive. Items set by specific configuration will take +These are case sensitive and any items set by specific configuration will take precedence. #### Sub-option: `name`