Skip to content

Commit 49e8eeb

Browse files
committed
add debug output
1 parent 52ee878 commit 49e8eeb

3 files changed

Lines changed: 6 additions & 1 deletion

File tree

bin/nextcloud-domain.sh

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
#!/bin/bash
22

33
source /usr/local/etc/library.sh
4-
4+
set -x
55
# wait until user decrypts the instance first
66
while :; do
77
needs_decrypt || break
@@ -31,6 +31,8 @@ while :; do
3131
sleep 3
3232
continue
3333
}
34+
# TODO: REmove debug output
35+
echo "found domain: $nc_domain"
3436
# Fix the situation where junk was introduced in the config by mistake
3537
# because Redis was not yet ready to be used even if it was up
3638
[[ "${nc_domain}" =~ "RedisException" ]] && nc_domain="$(hostname)"

etc/library.sh

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -146,6 +146,7 @@ function set-nc-domain()
146146
fi
147147
if [[ "${domain}" == "" ]] || is_an_ip "${domain}"; then
148148
echo "warning: No domain found. Defaulting to '$(hostname)'"
149+
echo "overwrite.cli.url was: $(ncc config:system:get overwrite.cli.url)"
149150
domain="$(hostname)"
150151
fi
151152
local proto

ncp-web/ncp-launcher.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -166,6 +166,8 @@ function bash_escape_arg($arg): string
166166
echo '{ "token": "' . getCSRFToken() . '",'; // Get new token
167167
exec("/usr/bin/php /var/www/nextcloud/occ config:system:set overwrite.cli.url --value " . bash_escape_arg($_POST['url']),
168168
$out, $ret);
169+
exec("/usr/bin/bash -c 'echo \"url set to: ". bash_escape_arg($_POST['url']) ."\" >> /var/log/ncp.log'");
170+
exec("/usr/bin/bash -c 'echo \"". htmlspecialchars(join("\n", $out), ENT_QUOTES, "UTF-8") ."\" >> /var/log/ncp.log'");
169171
echo ' "out": "' . htmlspecialchars(join("\n", $out), ENT_QUOTES, "UTF-8") . '", ';
170172
echo ' "ret": "' . $ret . '"}';
171173
}

0 commit comments

Comments
 (0)