From 5bf2dfa893334ca3e066145f54130afd1c98a004 Mon Sep 17 00:00:00 2001 From: "Alex A. Naanou" Date: Mon, 8 Jan 2024 03:58:37 +0300 Subject: [PATCH] testing... Signed-off-by: Alex A. Naanou --- nextcloud/make.sh | 22 +++++++++------------- 1 file changed, 9 insertions(+), 13 deletions(-) diff --git a/nextcloud/make.sh b/nextcloud/make.sh index faadc67..80d0308 100755 --- a/nextcloud/make.sh +++ b/nextcloud/make.sh @@ -94,21 +94,17 @@ sleep ${TIMEOUT:=5} tklWaitForSetup echo "# Starting TKL UI..." -@ lxc-attach $ID -- bash -c "\ - HUB_APIKEY=SKIP \ - SEC_UPDATES=SKIP \ - /usr/sbin/turnkey-init" - -# XXX the CT will reboot -- wait... +@ lxc-attach $ID -- bash -c "HUB_APIKEY=SKIP SEC_UPDATES=SKIP /usr/sbin/turnkey-init" echo "# Updating config..." -# XXX update /var/www/nextcloud/config/config.php -# - trusted_domains -# - trusted_proxies -@ lxc-attach $ID -- bash -c "\ - sed \ - -e 's/^\(\s*\)\('\''trusted_domains\)/\1'\''trusted_proxies'\'' =>\n\1array (\n\1\1'${GATE_LAN_IP}'\/32\n\1)\n\1\2/' \ - -i /var/www/nextcloud/config/config.php" +@ lxc-attach $ID -- sed -i \ + -e "/trusted_domains/i\ 'trusted_proxies' =>\n array (\n '${GATE_LAN_IP}/32',\n )," \ + -e "/trusted_domains[^(]*([^)]*)/i\ 'trusted_proxies' =>\n array (\n '${GATE_LAN_IP}/32',\n )," \ + /var/www/nextcloud/config/config.php +IP=${DRY_RUN:=$(lxc-attach $ID -- hostname -I)} +@ lxc-attach $ID -- sed -z -i \ + -e "s/\(trusted_domains[^)]*\)/\1 2 => '${IP/ *}',\n /" \ + /var/www/nextcloud/config/config.php echo "# Copying assets..." @ pct-push-r $ID ./assets /