mirror of
https://github.com/community-scripts/ProxmoxVE.git
synced 2026-11-21 05:18:25 +01:00
* Put add-tailscale-lxc's tun lines into the container, not its last snapshot
Snapshots follow a container's settings as [name] sections, so the two
lxc lines appended with >> landed in the last snapshot: pct config never
showed them, the container got no /dev/net/tun and tailscaled could not
start. The grep that skips an existing line also matched the snapshot's
copy on a second run. Check and insert them in the container's own
section.
* Keep add-tailscale-lxc's container output in the log and the trace
The install ran as a plain pct exec, so its output only reached the
terminal and every failure was reported as "pct exited with status 100"
with nothing after the step. It now runs through $STD: the output goes to
the run log, and a failure shows it and puts it in the trace. Inside the
container the helpers ran in silent mode as well, which kept apt's own
error in a log there; VERBOSE=yes prints it instead.
A failed download of core.func or tools.func was sourced as an empty
file and ended in "load_functions: command not found" (exit 127, 7 of
the 22 failed runs in four days). It now stops with exit 7 and says the
container could not download them.
* Make add-tailscale-lxc's DNS fallback trigger, and always undo it
dig +short prints its own errors (";; no servers could be reached") on
stdout, and the check counted any line that was not 127.x or 0.0.0.0 as
an address, so with a dead resolver the fallback to 1.1.1.1 never ran
and the install failed further on. Count only address lines.
The original resolv.conf was put back only after a successful install;
any failure left the container on 1.1.1.1, and a second run then saved
that as the backup. Restore it on exit.
* Do not fail add-tailscale-lxc over the tag once Tailscale is installed
pct set -tags ran last under set -e, so a container locked by a running
backup ("CT is locked (backup)", exit 255) failed the whole run after
Tailscale had been installed. The tag is cosmetic: warn with pct's
message instead. Read the tags from pct config so a snapshot's copy is
not added, and skip the tag when it is already there.