From e3142e303284c7ba23ddd640bd6b852c82a5581a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Rapha=C3=ABl=20Numbus?= Date: Mon, 25 May 2026 17:11:59 +0200 Subject: [PATCH] Improved debugging features. Added quotes to live.yaml. --- script/deploy.sh | 14 ++++++++------ web/pages/preparation.html | 7 +------ 2 files changed, 9 insertions(+), 12 deletions(-) diff --git a/script/deploy.sh b/script/deploy.sh index dd92477..292fcf0 100755 --- a/script/deploy.sh +++ b/script/deploy.sh @@ -67,7 +67,7 @@ get_valid_input() { cleanup() { echo -e "\n ✅ Cleaning up..." - rm -${DIR_RM_FLAGS} "/run/user/$(id -u)/numbus-installer" + rm -${DIR_RM_FLAGS} "${INSTALL_DIR}" if [[ -n "${BRIDGE_PID:-}" ]] && ps -p ${BRIDGE_PID} > "${STDOUT}" 2> "${STDERR}"; then kill ${BRIDGE_PID} @@ -344,9 +344,9 @@ SSHEND > "${STDOUT}" 2> "${STDERR}" scp -i "${TMP_EXTRA_PATH}/home/numbus-admin/.ssh/id_ed25519" "${TARGET_USER}@${LIVE_TARGET_IP}":"${TMPFILE}" "${HW_DATA_FILE}" > "${STDOUT}" 2> "${STDERR}" if ssh_to_host "sudo nixos-generate-config --no-filesystems --show-hardware-config" > ${TMP_EXTRA_PATH}/etc/nixos/hardware-configuration.nix; then - echo -e "\n✅ Hardware configuration generated" + echo -e "\n ✅ Hardware configuration generated" else - echo -e "\n❌ Failed to generate hardware configuration" + echo -e "\n ❌ Failed to generate hardware configuration" exit 1 fi } @@ -368,7 +368,7 @@ launch_gui() { sleep 5 - echo -e "\n ⚠️ If it doesn't automatically, open your browser at: $(gum style --foreground 212 "${START_URL}")" + echo -e "\n ⚠️ If it doesn't automatically, open your browser at: $(gum style --foreground 212 "${START_URL}")" } # --- MAIN WEB FUNCTIONS ---< @@ -733,6 +733,8 @@ securely on a hidden sheet of paper or add it to your password manager (locally # --- DEFAULT VARIABLES ---> +INSTALL_DIR="/run/user/$(id -u)/numbus-installer" + WEBSERVER_PORT=${WEBSERVER_PORT:-8088} LIVE_DATA_FILE="web/config/live.yaml" @@ -751,8 +753,8 @@ if [[ ${DEBUG-0} -eq 1 ]]; then DIR_RM_FLAGS="rvf" MKDIR_FLAGS="pv" MV_FLAGS="vu" - STDOUT="std.log" - STDERR="err.log" + STDOUT="${INSTALL_DIR}/logs/std.log" + STDERR="${INSTALL_DIR}/logs/err.log" else DEBUG=0 FILES_CP_FLAGS="au" diff --git a/web/pages/preparation.html b/web/pages/preparation.html index 080db16..f3d79ca 100644 --- a/web/pages/preparation.html +++ b/web/pages/preparation.html @@ -77,12 +77,7 @@ const response = await fetch('/discovery', { method: 'POST', headers: { 'Content-Type': 'text/yaml' }, - body: jsyaml.dump(payload, { - quotingType: '"', - styles: { - '!!str': 'double' - } - }) + body: jsyaml.dump(payload, { quotingType: '"', forceQuotes: true }) }); if (response.ok) {