Browse Source

Add debug trigger (#391)

Co-authored-by: Luke Childs <lukechilds123@gmail.com>
show-build-version
Lounès Ksouri 4 years ago
committed by GitHub
parent
commit
42b8b59880
No known key found for this signature in database GPG Key ID: 4AEE18F83AFDEB23
  1. 1
      docker-compose.yml
  2. 25
      events/triggers/debug
  3. 4
      scripts/debug

1
docker-compose.yml

@ -113,6 +113,7 @@ services:
UPDATE_SIGNAL_FILE: "/signals/update"
UPDATE_LOCK_FILE: "/statuses/update-in-progress"
BACKUP_STATUS_FILE: "/statuses/backup-status.json"
DEBUG_STATUS_FILE: "/statuses/debug-status.json"
TOR_PROXY_IP: "${TOR_PROXY_IP}"
TOR_PROXY_PORT: "${TOR_PROXY_PORT}"
TOR_HIDDEN_SERVICE_DIR: "/var/lib/tor"

25
events/triggers/debug

@ -0,0 +1,25 @@
#!/usr/bin/env bash
UMBREL_ROOT="$(readlink -f $(dirname "${BASH_SOURCE[0]}")/../..)"
DEBUG_SCRIPT="${UMBREL_ROOT}/scripts/debug"
cat <<EOF > "${UMBREL_ROOT}/statuses/debug-status.json"
{"status": "processing"}
EOF
json_encode () {
jq --null-input --raw-input 'reduce inputs as $line (""; . += "\($line)\n")'
}
debug_json_string=$("${DEBUG_SCRIPT}" --dashboard | sed '/onion/d' | sed -r "s/\x1B\[([0-9]{1,3}(;[0-9]{1,2})?)?[mGK]//g" | json_encode)
dmesg_json_string=$(dmesg | json_encode)
cat <<EOF > "${UMBREL_ROOT}/statuses/debug-status.json"
{
"status": "success",
"debug": ${debug_json_string},
"dmesg": ${dmesg_json_string}
}
EOF
echo "Debug result file generated"

4
scripts/debug

@ -179,7 +179,9 @@ if [[ ! -z "${UMBREL_OS:-}" ]]; then
fi
fi
if [[ "${1}" == "--upload" ]]; then
if [[ "${1}" == "--dashboard" ]]; then
echo "The debug script did not automatically detect any issues with your Umbrel."
elif [[ "${1}" == "--upload" ]]; then
# This runs the script twice, but it works
echo "This script could not automatically detect an issue with your Umbrel."
echo "Please share the following links and paste it in the Umbrel Telegram group (https://t.me/getumbrel) so we can help you with your problem."

Loading…
Cancel
Save