From 4e196969d7ebede4dfa7b2bb3cf15489a02b50d3 Mon Sep 17 00:00:00 2001 From: Tim Wilkinson Date: Wed, 9 Oct 2024 14:45:37 -0700 Subject: [PATCH] Nightly build fixes 20241009 (#1613) * Nightly build fixes. Restarting the nightly build with many changes resulted in updates failing to be applied on some hardware platforms. This resulted in nodes reverting to first use state. These changes fixes those problems. * Fix authentication --- configs/ath79-generic.config | 2 +- files/app/root.ut | 16 +++++++++------- files/usr/local/bin/aredn_init | 2 ++ 3 files changed, 12 insertions(+), 8 deletions(-) diff --git a/configs/ath79-generic.config b/configs/ath79-generic.config index 5626047e..363663bb 100644 --- a/configs/ath79-generic.config +++ b/configs/ath79-generic.config @@ -25,7 +25,7 @@ CONFIG_TARGET_DEVICE_ath79_generic_DEVICE_ubnt_bullet-m-xw=y CONFIG_TARGET_DEVICE_ath79_generic_DEVICE_ubnt_lap-120=y CONFIG_TARGET_DEVICE_ath79_generic_DEVICE_ubnt_litebeam-ac-gen2=y CONFIG_TARGET_DEVICE_ath79_generic_DEVICE_ubnt_litebeam-ac-lr=y -CONFIG_TARGET_DEVICE_ath79_generic_DEVICE_ubnt_nanobeam-2ac-13=y +#CONFIG_TARGET_DEVICE_ath79_generic_DEVICE_ubnt_nanobeam-2ac-13=y CONFIG_TARGET_DEVICE_ath79_generic_DEVICE_ubnt_nanobeam-ac-gen2=y CONFIG_TARGET_DEVICE_ath79_generic_DEVICE_ubnt_nanobeam-ac=y CONFIG_TARGET_DEVICE_ath79_generic_DEVICE_ubnt_nanobeam-ac-xc=y diff --git a/files/app/root.ut b/files/app/root.ut index 1cac4e80..522af215 100644 --- a/files/app/root.ut +++ b/files/app/root.ut @@ -437,13 +437,15 @@ global.handle_request = function(env) if (pageCache[tpath] || fs.access(tpath)) { auth.runAuthentication(env); - if (secured && !auth.isAdmin && config.authenable) { - uhttpd.send("Status: 401 Unauthorized\r\n\r\n"); - return; - } - if (env.REQUEST_METHOD !== "GET" && config.authenable && !(auth.isAdmin || auth.isFirstUse)) { - uhttpd.send("Status: 401 Unauthorized\r\n\r\n"); - return; + if (config.authenable && !auth.isAdmin) { + if (secured) { + uhttpd.send("Status: 401 Unauthorized\r\n\r\n"); + return; + } + if (env.REQUEST_METHOD !== "GET" && configuration.isConfigured() && page !== "authenticate") { + uhttpd.send("Status: 401 Unauthorized\r\n\r\n"); + return; + } } const args = {}; if (env.CONTENT_TYPE === "application/x-www-form-urlencoded") { diff --git a/files/usr/local/bin/aredn_init b/files/usr/local/bin/aredn_init index 539df51b..3f90735a 100755 --- a/files/usr/local/bin/aredn_init +++ b/files/usr/local/bin/aredn_init @@ -229,6 +229,8 @@ if aredn.info.get_nvram("configured") ~= "0" then -- Reboot when necessary if nixio.fs.stat("/tmp/reboot-required") then print "Rebooting node" + os.execute("/sbin/mount_root done") + os.execute("/bin/sync") os.execute("/sbin/reboot") end end