diff --git a/webtop_kde/CHANGELOG.md b/webtop_kde/CHANGELOG.md index a80dea7f0..17c932ac5 100644 --- a/webtop_kde/CHANGELOG.md +++ b/webtop_kde/CHANGELOG.md @@ -1,2 +1,2 @@ -- First version of Ubuntu KDE -- Use own ssl certificates +- First version of Ubuntu KDE +- Use own ssl certificates diff --git a/webtop_kde/config.json b/webtop_kde/config.json index baba6677a..25646c21c 100644 --- a/webtop_kde/config.json +++ b/webtop_kde/config.json @@ -93,7 +93,7 @@ "data_location": "/config/data", "certfile": "fullchain.pem", "keyfile": "privkey.pem", - "use_own_certs": false + "use_own_certs": true }, "panel_admin": false, "panel_icon": "mdi:monitor", @@ -103,8 +103,8 @@ "22/tcp": null, "23/tcp": null, "25/tcp": null, - "3000/tcp": 3000, - "3001/tcp": 3001, + "3000/tcp": null, + "3001/tcp": 3000, "3002/tcp": null, "53/tcp": null, "80/tcp": null @@ -116,7 +116,7 @@ "23/tcp": "TELNET", "25/tcp": "SMTP", "3000/tcp": "Web interface", - "3001/tcp": "Web interface ssl", + "3001/tcp": "Web interface https", "3002/tcp": "custom port 2", "53/tcp": "DNS", "80/tcp": "http" diff --git a/webtop_kde/rootfs/etc/cont-init.d/90-ssl.sh b/webtop_kde/rootfs/etc/cont-init.d/90-ssl.sh index 24313528c..783d08771 100644 --- a/webtop_kde/rootfs/etc/cont-init.d/90-ssl.sh +++ b/webtop_kde/rootfs/etc/cont-init.d/90-ssl.sh @@ -3,20 +3,19 @@ set -e if bashio::config.true 'use_own_certs'; then - bashio::log.green "Using referenced ssl certificates. Please remember to open the ssl port in the addon options" + bashio::log.green "Using referenced ssl certificates to connect with https. Please remember to open the ssl port in the addon options" CERTFILE=$(bashio::config 'certfile') KEYFILE=$(bashio::config 'keyfile') - # Validate ssl - bashio::config.require.ssl - #Check if 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/"$KEYFILE" ] && bashio::log.fatal "... use_own_certs is true but certificate /ssl/$KEYFILE not found" && bashio::exit.nok + if [ -f /ssl/"$CERTFILE" ] && [ -f /ssl/"$KEYFILE" ]; then + # Add ssl file + sed -i "s|/config/data/ssl/cert.pem|/ssl/$CERTFILE|g" "$NGINX_CONFIG" + sed -i "s|/config/data/ssl/cert.key|/ssl/$KEYFILE|g" "$NGINX_CONFIG" + echo "... done" + else + bashio::log.warning "... certificate /ssl/$CERTFILE and /ssl/$KEYFILE and not found, using self-generated certificates" + fi - - # Add ssl file - sed -i "s|/config/data/ssl/cert.pem|/ssl/$(bashio::config 'certfile')|g" "$NGINX_CONFIG" - sed -i "s|/config/data/ssl/cert.key|/ssl/$(bashio::config 'keyfile')|g" "$NGINX_CONFIG" fi