Commit Graph

5 Commits

Author SHA1 Message Date
cnbug 6f4d071bf3 middleware: VNC generator add disable_wayland + restart_gdm options for GNOME
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).
2026-08-06 14:05:05 +08:00
cnbug b9bd50c869 runtimes: fix Go install 'mv to subdirectory of itself' when install_dir == extracted /go
Go official tarball always extracts to <parent>/go. The old code always ran
'mv <parent>/go <install_dir>', which errors with 'cannot move /opt/go to a
subdirectory of itself' when install_dir equals the extraction target (the
default /opt/go). Only emit the mv when install_dir differs from the tar
extraction path.
2026-08-06 14:03:25 +08:00
cnbug 1ed978a5a1 runtimes: fix Node.js + Java download URL 404s
Both Node.js and Java generators were emitting URLs that 404'd when
selected against the official dist servers.

  Node.js: emitted v<major>.x placeholders (e.g. v24.x). nodejs.org's
    dist server requires exact version paths (e.g. v24.19.0); the v<x>.x
    form is not a redirect — it's a real 404. All 5 supported majors
    (18, 20, 22, 24, 26) were broken.

  Java: URL was hardcoded to download.java.net's openjdk-21.0.2 GA
    build. That path only works for 21; 8, 11, 17 all 404. download.java.net
    embeds a build hash in the URL that I don't have a way to look up
    for arbitrary patch versions.

Fix:

  Node.js: add a LATEST_KNOWN dict mapping each major to its real
    current exact version (refreshed 2026-08):
      18 -> 18.20.8, 20 -> 20.20.2, 22 -> 22.23.2,
      24 -> 24.19.0, 26 -> 26.6.0
    Also add a 'download_url' text field with the precise default URL,
    so users can override with any mirror (Tuna, npmmirror, etc.) or
    a specific patch version without waiting for code to update.

  Java: switch to Tuna's Adoptium mirror, whose path format is simple
    and predictable:
      https://mirrors.tuna.tsinghua.edu.cn/Adoptium/<major>/jdk/x64/linux/OpenJDK<major>U-jdk_x64_linux_hotspot_<exact>.tar.gz
    This works for 8/11/17/21 with the LATEST_TUNA mapping. Also add a
    'download_url' text field for overrides.

Both also derive the tarball's inner directory name from the URL (via
regex) so the --strip-components=1 trick keeps working even when the
user picks a custom URL.

Verified all 9 generated URLs return 200 (HEAD):
  Node v18/20/22/24/26: all 200
  Java v8/11/17/21: all 200 (Tuna mirror)
  All 50 generators still pass bash -n.
2026-08-04 16:38:44 +08:00
cnbug c25cbb0d48 VNC: switch to xvfb+x11vnc, add Ubuntu GNOME session + extensions
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).
2026-08-04 14:27:21 +08:00
cnbug 319f683a16 Initial commit: 50 shell-script generators with web UI
- 8 categories / 50 generators covering middleware, databases, runtimes,
  systemd services, system tools, network, monitoring, security
- VNC supports XFCE / GNOME / KDE Plasma / MATE / LXQt desktops
- Node.js versions 18-26 (incl. current LTS 24 Krypton and current 26)
- Live preview, copy / download / multi-script bundle in web UI
- Distro-aware (Ubuntu/Debian/CentOS/RHEL/Rocky/Alma/Fedora)
- All 50 generators pass bash -n syntax check
- Zero pip dependencies (Flask stdlib only)
2026-08-04 00:36:35 +08:00