mirror of
https://github.com/alexbelgium/hassio-addons.git
synced 2026-05-24 17:51:49 +02:00
bashio::config.require.ssl
This commit is contained in:
@@ -7,6 +7,9 @@ if bashio::config.true 'use_own_certs'; then
|
|||||||
CERTFILE=$(bashio::config 'certfile')
|
CERTFILE=$(bashio::config 'certfile')
|
||||||
KEYFILE=$(bashio::config 'keyfile')
|
KEYFILE=$(bashio::config 'keyfile')
|
||||||
|
|
||||||
|
# Validate ssl
|
||||||
|
bashio::config.require.ssl
|
||||||
|
|
||||||
#Check if files exist
|
#Check if files exist
|
||||||
echo "... checking if referenced files exist"
|
echo "... checking if referenced files exist"
|
||||||
[ ! -f /ssl/"$CERTFILE" ] && bashio::log.fatal "... use_own_certs is true but certificate /ssl/$CERTFILE not found" && bashio::exit.nok
|
[ ! -f /ssl/"$CERTFILE" ] && bashio::log.fatal "... use_own_certs is true but certificate /ssl/$CERTFILE not found" && bashio::exit.nok
|
||||||
|
|||||||
@@ -2,6 +2,8 @@
|
|||||||
# shellcheck shell=bash
|
# shellcheck shell=bash
|
||||||
|
|
||||||
if bashio::config.true 'ssl'; then
|
if bashio::config.true 'ssl'; then
|
||||||
|
# Validate ssl
|
||||||
|
bashio::config.require.ssl
|
||||||
|
|
||||||
# Adapt nginx template
|
# Adapt nginx template
|
||||||
certfile=$(bashio::config 'certfile')
|
certfile=$(bashio::config 'certfile')
|
||||||
@@ -9,11 +11,6 @@ if bashio::config.true 'ssl'; then
|
|||||||
sed -i "s#%%certfile%%#${certfile}#g" /etc/nginx/servers/direct.conf
|
sed -i "s#%%certfile%%#${certfile}#g" /etc/nginx/servers/direct.conf
|
||||||
sed -i "s#%%keyfile%%#${keyfile}#g" /etc/nginx/servers/direct.conf
|
sed -i "s#%%keyfile%%#${keyfile}#g" /etc/nginx/servers/direct.conf
|
||||||
|
|
||||||
# Check if files exist
|
|
||||||
echo "... checking if referenced certificates exist"
|
|
||||||
[ ! -f /ssl/"$certfile" ] && bashio::log.fatal "... use_own_certs is true but certificate /ssl/$certfile not found" && bashio::exit.nok
|
|
||||||
[ ! -f /ssl/"$keyfile" ] && bashio::log.fatal "... use_own_certs is true but certificate /ssl/$keyfile not found" && bashio::exit.nok
|
|
||||||
|
|
||||||
# Configure URL
|
# Configure URL
|
||||||
if bashio::config.has_value "PAPERLESS_URL"; then
|
if bashio::config.has_value "PAPERLESS_URL"; then
|
||||||
bashio::log.warning "Ssl enabled, your site will be available at $(bashio::config "PAPERLESS_URL"). Don't forget to enable the https alternative port in the addon options."
|
bashio::log.warning "Ssl enabled, your site will be available at $(bashio::config "PAPERLESS_URL"). Don't forget to enable the https alternative port in the addon options."
|
||||||
|
|||||||
Reference in New Issue
Block a user