Commit Graph
10 Commits
Author SHA1 Message Date
maziggy 1773cbd629 fix(install): docker installer tries mkdir without sudo, escalates on EACCES (#1774)
install/docker-install.sh::create_install_dir ran `mkdir -p
  "$INSTALL_PATH"` without sudo while DEFAULT_INSTALL_PATH was
  /opt/bambuddy, root-owned on every Linux distro. set -e then
  aborted the whole script before docker compose could pull the
  image — anyone running the documented `curl ... | bash` flow as
  a normal user hit this on first install.

  Fix: try the unprivileged `mkdir -p ... 2>/dev/null` first so
  --path ~/bambuddy, /srv/bambuddy and other writable targets don't
  trigger a needless password prompt, then fall back to
  `sudo mkdir -p` + `sudo chown -R "$USER:$USER"` only when the
  first attempt failed. The chown is load-bearing: without it the
  script would later try to write docker-compose.yml + .env into a
  root-owned dir as the invoking user and cascade further EACCES
  failures.

  Not changing the default path: install/update.sh and
  install/update_macos.sh both default INSTALL_DIR to /opt/bambuddy,
  and install/README.md's update flow documents the same — flipping
  the install default to ~/bambuddy without coordinating those
  would silently break self-service updates for anyone following
  the docs verbatim. The default stays /opt/bambuddy; only the
  escalation gap closes.

  set -e survives the redirected stderr because the `if !` form is
  the documented escape hatch for an expected-failure check.

  Smoke-tested writable-target, idempotent-rerun, and the
  failing-mkdir-then-sudo-fallback branches.
2026-06-19 08:14:49 +02:00
maziggy 46e183cb9f Removed --bind flag from docker_install.sh 2026-04-08 12:53:04 +02:00
maziggy 82d329d85c [Fix] Virtual Printer FTP routed to wrong VP with different access codes (#735)
When running multiple virtual printers with different access codes on
  separate bind IPs, FTP connections were always routed to the wrong VP.

  Root cause: the iptables REDIRECT rule (990→9990) rewrites the
  destination IP to the incoming interface's primary address. With Linux's
  weak host model (arp_filter=0), packets for secondary IPs arrive on the
  primary interface, and REDIRECT sends them all to the first VP's FTP
  server. MQTT was unaffected because port 8883 had no redirect.

  Fix: FTP server now binds directly to port 990 (standard implicit FTPS),
  eliminating the iptables redirect entirely. Requires CAP_NET_BIND_SERVICE
  (already set in the systemd service file and Docker image).

  Also removed a global asyncio set_exception_handler() in the MQTT server
  that was overwritten by each VP instance, causing spurious "Unhandled
  exception in client_connected_cb" errors on startup.

  Changes:
  - FTP_PORT: 9990 → 990 (ftp_server.py)
  - Removed set_exception_handler() from MQTT server
  - Updated Dockerfile, docker-compose.yml port mappings
  - Deprecated --redirect-990 in install script
  - Updated wiki: removed iptables instructions for all platforms
  - Added migration guide (docs/migration-vp-ftp-port.md)
  - Added unit tests for port constant and no-global-state invariant
2026-03-18 09:04:31 +01:00
MartinNYHC 324c716692 Fix indentation in iptables check 2026-02-19 08:02:11 +01:00
Wesley Reuel Marques Silva c879a787f6 Complying with PR 2026-02-18 18:00:23 +00:00
Wesley Reuel Marques Silva 0d7cf0f227 Complying with PR 2026-02-16 19:47:34 +00:00
Wesley Silva ac597e5ff6 Adding the option to include the ip tables route when installing via docker-install.sh 2026-02-15 17:22:19 +00:00
maziggy f094c16012 Updated install scripts and related docs 2026-02-08 18:24:51 +01:00
maziggy 75c049b05c Updated install scripts and related docs 2026-02-08 18:21:19 +01:00
maziggy 196b7a93e9 Added one-shot install scripts 2026-01-31 14:31:10 +01:00