24 Commits

Author SHA1 Message Date
AuxXxilium
834bc663de lighttpd: stop discarding the startup error
The generated S90lighttpd ran lighttpd with 2>/dev/null, so a config
parse error, a failed bind, a missing module or an unwritable log path
all produced exactly "FAIL" and nothing else. That is the one message
that says why the web UI is not there.

Append stderr to /var/log/lighttpd-start.log instead.
2026-09-04 20:56:01 +02:00
AuxXxilium
755fc77e33 Switch the web UI from thttpd to lighttpd
Buildroot removed thttpd (Config.in.legacy, "no longer maintained
actively by upstream"), so arc-buildroot-essential moves to lighttpd
1.4.82 as part of the 6.18 kernel bump. This is the loader side of that
change; the two have to land together.

darkhttpd was ruled out because the web UI is CGI-driven - eight scripts
under /var/www/data, with auth.cgi reading /etc/shadow - and darkhttpd
has no CGI support at all. The CGI scripts themselves use plain CGI/1.1
(REQUEST_METHOD, QUERY_STRING, CONTENT_LENGTH) with no thttpd-specific
behavior, so they are unchanged.

functions.sh still overrides the init script when repacking the initrd,
so it now writes S90lighttpd. Two differences from the thttpd version:

- thttpd took its document root, port and CGI pattern on the command
  line. lighttpd reads them from a config file, so the script writes a
  small wrapper to /var/run that includes /etc/lighttpd/lighttpd.conf
  and overrides the port from /etc/arc.conf.

- the port override uses ":=" (force-assign). A plain "=" on a key the
  included config already set is a fatal "Duplicate config variable"
  error in lighttpd, not a last-one-wins override.

Running as root is preserved via server.username/groupname in the
shipped config, since auth.cgi and change-password.cgi touch /etc/shadow.

init.sh watches /var/run/lighttpd.pid instead of thttpd.pid, and the
port-change handler in arc-functions.sh restarts S90lighttpd.
2026-09-04 15:41:07 +02:00
AuxXxilium
0005cf4804 webui: recover from a stale thttpd pidfile
thttpd does not remove its pidfile when it dies, so a crash left the
file behind pointing at a dead pid. The boot guard only tested that the
file existed, concluded the server was up and skipped the restart, so
nothing was listening while the loader carried on and reported an ip.
That is the connection refused on a running system. Test the pid with
kill -0 instead and clear the file before restarting.

The shipped init script had no monitor loop to catch this later, and its
stop() bailed out with FAIL when the pidfile was missing, so restart
could not recover a thttpd that was running without one. Fall back to
killall in that case, and never signal a recorded pid that is no longer
alive since the number may have been recycled.

loaderPorts compared the new port against HTTPPORT, which arc.conf had
already been rewritten to hold, so the restart was skipped on a real
change. Capture the running port before the rewrite.
2026-08-11 20:59:22 +02:00
AuxXxilium
6aec3dda79 build: fix
Signed-off-by: AuxXxilium <info@auxxxilium.tech>
2026-06-27 02:38:32 +02:00
AuxXxilium
15d50990c6 build: simplify
Signed-off-by: AuxXxilium <info@auxxxilium.tech>
2026-06-13 15:19:40 +02:00
AuxXxilium
58c4e42830 functions: rewrite
Signed-off-by: AuxXxilium <info@auxxxilium.tech>
2026-05-24 12:21:53 +02:00
AuxXxilium
8896c7d9f1 webui: fix
Signed-off-by: AuxXxilium <info@auxxxilium.tech>
2026-05-02 14:20:08 +02:00
AuxXxilium
96bb750c90 webui: update more
Signed-off-by: AuxXxilium <info@auxxxilium.tech>
2026-05-02 13:27:07 +02:00
AuxXxilium
c7ff5b8a2d functions: fix typo
Signed-off-by: AuxXxilium <info@auxxxilium.tech>
2026-02-18 20:58:31 +01:00
AuxXxilium
1e045067d5 functions: fix more
Signed-off-by: AuxXxilium <info@auxxxilium.tech>
2026-02-18 20:54:22 +01:00
AuxXxilium
a8996c9a6b tree: fix more
Signed-off-by: AuxXxilium <info@auxxxilium.tech>
2026-02-18 20:48:22 +01:00
AuxXxilium
6773c8ac23 tree: change to all-in-one
Signed-off-by: AuxXxilium <info@auxxxilium.tech>
2026-02-18 20:45:53 +01:00
AuxXxilium
baba5d2ba0 tree: update logic
Signed-off-by: AuxXxilium <info@auxxxilium.tech>
2026-01-23 19:38:42 +01:00
AuxXxilium
eed409bf63 build: update more
Signed-off-by: AuxXxilium <info@auxxxilium.tech>
2025-12-28 18:51:41 +01:00
AuxXxilium
6fcb96cc88 build: update
Signed-off-by: AuxXxilium <info@auxxxilium.tech>
2025-12-28 15:54:15 +01:00
AuxXxilium
7b4443e20f tree: cleanup
Signed-off-by: AuxXxilium <info@auxxxilium.tech>
2025-10-15 13:05:20 +02:00
AuxXxilium
f2154f3ed3 build: update
Signed-off-by: AuxXxilium <info@auxxxilium.tech>
2025-10-04 12:46:59 +02:00
AuxXxilium
df6a317f0f tree: more fixes
Signed-off-by: AuxXxilium <info@auxxxilium.tech>
2025-09-28 16:19:33 +02:00
AuxXxilium
4b28907835 build: update
Signed-off-by: AuxXxilium <info@auxxxilium.tech>
2025-08-03 16:35:29 +02:00
AuxXxilium
ed19549eb8 functions: update
Signed-off-by: AuxXxilium <info@auxxxilium.tech>
2025-05-15 21:22:04 +02:00
AuxXxilium
ebd8a91775 tree: optimization
Signed-off-by: AuxXxilium <info@auxxxilium.tech>
2025-05-14 17:48:49 +02:00
AuxXxilium
7e7b99e602 tree: optimize more
Signed-off-by: AuxXxilium <info@auxxxilium.tech>
2025-05-03 20:47:57 +02:00
AuxXxilium
7a61c1927a tree: cleanup
Signed-off-by: AuxXxilium <info@auxxxilium.tech>
2025-02-16 19:14:42 +01:00
AuxXxilium
e7688433ef tree: cleanup
Signed-off-by: AuxXxilium <info@auxxxilium.tech>
2025-02-03 19:10:33 +01:00