From 6a769250697b881fc5c672b3a57f83c4e08dfbca Mon Sep 17 00:00:00 2001 From: TheSpad Date: Tue, 21 Nov 2023 20:08:27 +0000 Subject: [PATCH] Don't set an authsource unless one is specified by the user --- root/defaults/system.properties | 4 ++-- .../s6-rc.d/init-unifi-network-application-config/run | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/root/defaults/system.properties b/root/defaults/system.properties index b06370d..709e574 100644 --- a/root/defaults/system.properties +++ b/root/defaults/system.properties @@ -41,6 +41,6 @@ # unifi.throughput.port=6789 # db.mongo.local=false -db.mongo.uri=mongodb://~MONGO_USER~:~MONGO_PASS~@~MONGO_HOST~:~MONGO_PORT~/~MONGO_DBNAME~?tls=~MONGO_TLS~&authSource=~MONGO_AUTHSOURCE~ -statdb.mongo.uri=mongodb://~MONGO_USER~:~MONGO_PASS~@~MONGO_HOST~:~MONGO_PORT~/~MONGO_DBNAME~_stat?tls=~MONGO_TLS~&authSource=~MONGO_AUTHSOURCE~ +db.mongo.uri=mongodb://~MONGO_USER~:~MONGO_PASS~@~MONGO_HOST~:~MONGO_PORT~/~MONGO_DBNAME~?tls=~MONGO_TLS~~MONGO_AUTHSOURCE~ +statdb.mongo.uri=mongodb://~MONGO_USER~:~MONGO_PASS~@~MONGO_HOST~:~MONGO_PORT~/~MONGO_DBNAME~_stat?tls=~MONGO_TLS~~MONGO_AUTHSOURCE~ unifi.db.name=~MONGO_DBNAME~ diff --git a/root/etc/s6-overlay/s6-rc.d/init-unifi-network-application-config/run b/root/etc/s6-overlay/s6-rc.d/init-unifi-network-application-config/run index 0bc932e..0aca9a7 100755 --- a/root/etc/s6-overlay/s6-rc.d/init-unifi-network-application-config/run +++ b/root/etc/s6-overlay/s6-rc.d/init-unifi-network-application-config/run @@ -48,9 +48,9 @@ if [[ ! -e /config/data/system.properties ]]; then sed -i "s/~MONGO_TLS~/false/" /defaults/system.properties fi if [[ -z "${MONGO_AUTHSOURCE}" ]]; then - sed -i "s/~MONGO_AUTHSOURCE~/${MONGO_DBNAME}/" /defaults/system.properties + sed -i "s/~MONGO_AUTHSOURCE~//" /defaults/system.properties else - sed -i "s/~MONGO_AUTHSOURCE~/${MONGO_AUTHSOURCE}/" /defaults/system.properties + sed -i "s/~MONGO_AUTHSOURCE~/\&authSource=${MONGO_AUTHSOURCE}/" /defaults/system.properties fi cp /defaults/system.properties /config/data fi