mirror of
https://github.com/alexbelgium/hassio-addons.git
synced 2026-06-20 14:29:14 +02:00
emby ssl
This commit is contained in:
21
emby/root/etc/cont-init.d/93-nginx.sh
Normal file
21
emby/root/etc/cont-init.d/93-nginx.sh
Normal file
@@ -0,0 +1,21 @@
|
||||
#!/usr/bin/with-contenv bashio
|
||||
|
||||
###############
|
||||
# SSL SETTING #
|
||||
###############
|
||||
|
||||
declare admin_port
|
||||
declare protocol=http
|
||||
|
||||
# Generate Ingress configuration
|
||||
if bashio::config.true 'ssl'; then
|
||||
bashio::config.require.ssl
|
||||
protocol=https
|
||||
certfile=$(bashio::config 'certfile')
|
||||
keyfile=$(bashio::config 'keyfile')
|
||||
address=$(bashio::addon.ip_address)
|
||||
sed -i "s|%%interface%%|$address|g" /etc/nginx/templates/ssl.gtpl
|
||||
sed -i "s|%%certfile%%|/ssl/$certfile|g" /etc/nginx/templates/ssl.gtpl
|
||||
sed -i "s|%%certkey%%|/ssl/$keyfile|g" /etc/nginx/templates/ssl.gtpl
|
||||
mv /etc/nginx/templates/ssl.gtpl /etc/nginx/servers/ssl.conf
|
||||
fi
|
||||
Reference in New Issue
Block a user