Two changes:
1) Docker generator: introduce 'repo_region' select field with three modes:
auto — probe download.docker.com (5s timeout); fall back to Tuna
mirror if unreachable. Default.
official — force download.docker.com URLs (GPG + apt/yum repo).
cn — force mirrors.tuna.tsinghua.edu.cn/docker-ce URLs.
The apt/yum repo body now uses ${DOCKER_REPO_APT}/${DOCKER_REPO_YUM}
variables instead of hardcoded URLs. yum/dnf uses 'command -v
yum-config-manager' to pick the right tool (dnf-only distros like
Rocky/Alma now skip the failed yum-config-manager probe).
Tuna URLs verified reachable: curl -fsSI returned 200 for both
linux/ubuntu/gpg and linux/centos/gpg. registry_mirror default also
switched to docker.mirrors.ustc.edu.cn (was tencent cloud).
2) shell-gen.service: point WorkingDirectory and ExecStart at
/fs/1000/ftp/Project/shell-gen (the canonical git checkout) instead
of /root/shell-gen. The /root/ copy was a stale duplicate that
caused previous fixes to silently not reach the running web UI.
/root/shell-gen is preserved untouched (user has local artifacts
there: vnc_*.sh, k8s/, deliverables/, etc).
Verified:
- bash -n OK on all 3 region variants
- region=auto with reachable overseas: picks official
- region=auto with overseas-blocked (curl stubbed to fail):
DOCKER_REPO_APT/YUM correctly fall back to tuna.tsinghua,
warning emitted on stderr
- region=official: forces official URLs, no probe
- region=cn: forces Tuna URLs, no probe
- 7 other sampled generators unchanged (memcached, wireguard,
rabbitmq, chrony, mongodb, nginx, redis all bash -n OK,
$PKG_INSTALL count 0)
In bash with 'set -u', an undefined variable triggers an unbound-variable
error. Functions don't satisfy '$FUNCNAME' expansion under set -u, so
the previous fix that kept '$PKG_INSTALL pkg...' as the call syntax
broke every call site:
docker.sh: line 53: PKG_INSTALL: unbound variable
Fix: drop the leading '$' in all 47 call sites across 6 generator
files. 'PKG_INSTALL pkg...' is a normal command/function lookup and
behaves identically under set -u or not.
Verified: web UI served docker.sh now has 'PKG_INSTALL' (no $);
'bash -n' passes; smoke run with stubbed PATH hits real line-53 call
site, mock apt-get receives correct args, exit 0, no unbound variable.
Sampled 6 other generators also syntax-OK with $PKG_INSTALL count 0.
Ubuntu 22.04 defaults to WaylandEnable=true in /etc/gdm3/custom.conf.
Wayland + x11vnc has known issues (keyboard remap, clipboard, gnome-shell
crashes on X events). Add two options: disable_wayland (write
WaylandEnable=false to gdm3/custom.conf on GNOME installs, guarded when no
gdm3 exists) and restart_gdm (immediately restart gdm vs apply on reboot).
Major changes to the VNC generator (generators/middleware.py):
1. Replace Xtigervnc + vncserver wrapper with xvfb + x11vnc.
- Xtigervnc defaults to daemon mode (no -fg flag exists), so systemd
Type=simple couldn't track it; x11vnc attaches to Xvfb in
foreground, works cleanly with Type=simple.
- Use display :99 via xvfb-run -a so we never collide with the
physical GDM/Xorg on :0 (avoids 'server already running').
2. GNOME xstartup: switch to Ubuntu's canonical session.
- XDG_CURRENT_DESKTOP=ubuntu:GNOME (was 'GNOME'; the bare form
doesn't match Ubuntu's /usr/share/gnome-session/sessions/ entry
and apps like gnome-terminal refuse to launch).
- XDG_SESSION_TYPE=x11 (x11vnc is X11-only, so be explicit).
- GNOME_SHELL_SESSION_MODE=ubuntu (Ubuntu-patched gnome-shell hint).
3. Install extra GNOME packages needed for a usable VNC desktop.
ubuntu-desktop-minimal alone leaves the user with a blank desktop
and no way to launch apps. Add:
- gnome-shell-extension-desktop-icons-ng (desktop icons)
- gnome-terminal (terminal app)
- nautilus-extension-gnome-terminal (right-click → open in terminal)
- gnome-tweaks (advanced settings UI)
4. Two new UI options:
- 'Disable Unix socket (-nolisten unix)' — default on (avoids GDM
collision on /tmp/.X11-unix/X0).
- 'Disable X11 TCP listener (6001)' — default off (frees 6001 when
GDM is squatting on it).
5. .gitignore: exclude other projects' deliverables/ directory and
a few test output scripts (vnc_*.sh).