mirror of
https://github.com/alexbelgium/hassio-addons.git
synced 2026-05-31 04:44:05 +02:00
Update 03-nginx_ssl.sh
This commit is contained in:
@@ -8,7 +8,6 @@ qbittorrent_protocol="http"
|
|||||||
# SSL CONFIG #
|
# SSL CONFIG #
|
||||||
################
|
################
|
||||||
|
|
||||||
bashio::config.require.ssl
|
|
||||||
if bashio::config.true 'ssl'; then
|
if bashio::config.true 'ssl'; then
|
||||||
bashio::log.info "ssl enabled. If webui don't work, disable ssl or check your certificate paths"
|
bashio::log.info "ssl enabled. If webui don't work, disable ssl or check your certificate paths"
|
||||||
|
|
||||||
@@ -17,19 +16,21 @@ if bashio::config.true 'ssl'; then
|
|||||||
|
|
||||||
#set variables
|
#set variables
|
||||||
CERTFILE=$(bashio::config 'certfile')
|
CERTFILE=$(bashio::config 'certfile')
|
||||||
|
CERTFILE="${CERTFILE:-null}"
|
||||||
KEYFILE=$(bashio::config 'keyfile')
|
KEYFILE=$(bashio::config 'keyfile')
|
||||||
|
KEYFILE="${KEYFILE:-null}"
|
||||||
|
|
||||||
# Correct files
|
# Correct certificate file
|
||||||
if [ -f /config/qBittorrent/config/WebUICertificate.crt ]; then
|
if [ ! -f /ssl/"$CERTFILE" ]; then
|
||||||
bashio::log.warning "... you have a file in /config/qBittorrent/config/WebUICertificate.crt, it will be used instead of the CERFILE option"
|
bashio::log.warning "... CERTFILE option not found or valid, using self-generated /config/qBittorrent/config/WebUICertificate.crt"
|
||||||
else
|
else
|
||||||
sed -i "s|/config/qBittorrent/config/WebUICertificate.crt|/ssl/$CERTFILE|g" /etc/cont-init.d/04-qbittorrent-setup.sh
|
sed -i "s|/config/qBittorrent/config/WebUICertificate.crt|/ssl/$CERTFILE|g" /etc/cont-init.d/04-qbittorrent-setup.sh
|
||||||
sed -i "s|WebUICertificate.crt|$CERTFILE|g" /etc/cont-init.d/04-qbittorrent-setup.sh
|
sed -i "s|WebUICertificate.crt|$CERTFILE|g" /etc/cont-init.d/04-qbittorrent-setup.sh
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# Correct files
|
# Correct keyfile
|
||||||
if [ -f /config/qBittorrent/config/WebUIKey.key ]; then
|
if [ ! -f /ssl/"$KEYFILE" ]; then
|
||||||
bashio::log.warning "... you have a file in /config/qBittorrent/config/WebUIKey.key, it will be used instead of the KEYFILE option"
|
bashio::log.warning "... KEYFILE option not found or valid, using self-generated /config/qBittorrent/config/WebUICertificate.crt"
|
||||||
else
|
else
|
||||||
sed -i "s|/config/qBittorrent/config/WebUIKey.key|/ssl/$KEYFILE|g" /etc/cont-init.d/04-qbittorrent-setup.sh
|
sed -i "s|/config/qBittorrent/config/WebUIKey.key|/ssl/$KEYFILE|g" /etc/cont-init.d/04-qbittorrent-setup.sh
|
||||||
sed -i "s|WebUIKey.key|$KEYFILE|g" /etc/cont-init.d/04-qbittorrent-setup.sh
|
sed -i "s|WebUIKey.key|$KEYFILE|g" /etc/cont-init.d/04-qbittorrent-setup.sh
|
||||||
@@ -37,6 +38,7 @@ if bashio::config.true 'ssl'; then
|
|||||||
|
|
||||||
# Set nginx protocol
|
# Set nginx protocol
|
||||||
qbittorrent_protocol=https
|
qbittorrent_protocol=https
|
||||||
|
|
||||||
fi
|
fi
|
||||||
|
|
||||||
#################
|
#################
|
||||||
|
|||||||
Reference in New Issue
Block a user