towerdef/deploy/netwall.service
Claude a5bd09d505 Phone UI and touch precision overhaul, proxy fixes, Orbital Uplink, four new maps
Phone panels (reviewed + QA'd, matrix of 22 layouts with real taps/bounding boxes):
- selected-tower action bar over the board (Upgrade/Sell/Target/close), info panel
  updated in place so taps are never lost, scrollable palette for 7+ towers,
  overlays with pinned footers (Help "Got it", Play solo, Join always visible),
  tappable room chip to invite, reduced-motion/contrast/forced-colors fixes,
  paused state, partner cursor labels, bigger level pips and owner flags
- touch input rewritten around "pointerdown commits nothing": pinch never builds,
  10px tap slop, palm-proof pinch, long-press pings with any tool armed, nudge
  arrows for precise placement, hotkey repeat guard, proportional wheel zoom
- new e2e: select/sell, info-panel stability, UI states, touch precision;
  camera unit tests

Proxy/server (reproduced against real nginx 1.26 with NPM v2.16 config):
- Origin check works when the proxy drops a non-default port, TRUSTED_PROXIES for
  proxies on global IPv6/CGNAT addresses, service worker no longer serves nginx's
  502 page, DEPLOY.md corrected (NPM default read timeout is 90 s, Advanced-tab
  limits, path-prefix, cookie size, per-IP cap behaviour)

Content:
- Orbital Uplink: 4-level endgame tower (450 + 500/800/1200 credits): piercing
  armour-ignoring beam, blast and lingering slow, ground+air, range 11-14;
  glyph, beam effect, sound, help text, unit tests
- Maps: The Canyon, Archipelago, Fortress, Pinwheel (7 maps total)

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Tb8pW2KAN4oFkh1aK1BfD8
2026-10-10 18:03:24 +00:00

75 lines
3.2 KiB
Desktop File

# Netwall systemd unit (Debian 13 LXC; see docs/DEPLOY.md).
#
# install -m 0644 deploy/netwall.service /etc/systemd/system/netwall.service
# systemctl daemon-reload && systemctl enable --now netwall
# journalctl -u netwall -f
#
# Expects the app in /opt/netwall (server/, public/, node_modules/) and Debian's /usr/bin/node (Node 20).
[Unit]
Description=Netwall - co-op tower defence (Node server)
Documentation=file:///opt/netwall/docs/DEPLOY.md
After=network-online.target
Wants=network-online.target
[Service]
Type=simple
User=netwall
Group=netwall
WorkingDirectory=/opt/netwall
ExecStart=/usr/bin/node /opt/netwall/server/index.js
# ---- configuration (see docs/DEPLOY.md, "Configuration") --------------------------------------
Environment=NODE_ENV=production
# Port to listen on. 8080 is unprivileged, so the service needs no capabilities.
Environment=PORT=8080
# "::" = one dual-stack socket for IPv4 + IPv6 (falls back to 0.0.0.0 if the kernel has no IPv6).
Environment=HOST=::
# auto: believe X-Forwarded-For / X-Forwarded-Host only from loopback / private-range peers (your proxy).
Environment=TRUST_PROXY=auto
# Only needed when your proxy reaches this server from an address that is NOT private: a global IPv6 address,
# Tailscale / CGNAT (100.64.0.0/10), ... (symptom: the log says "from <the proxy's address>" for every player, or
# "this connection is not from a trusted proxy"). Comma separated IPs / CIDRs, added to the private ranges.
#Environment=TRUSTED_PROXIES=100.64.0.0/10,2001:db8::6
# Only needed when the proxy rewrites the Host header or you serve several public names (symptom: 403 on the
# WebSocket upgrade). Comma separated; include the port when it is not 80/443, e.g. https://game.example.com:8443
#Environment=ALLOWED_ORIGINS=https://game.example.com
#Environment=MAX_CONN_PER_IP=40
#Environment=GRACE_MS=60000
# ---- lifecycle ---------------------------------------------------------------------------------
Restart=on-failure
RestartSec=2
# SIGTERM closes all sockets and exits 0 within about a second; SIGKILL after 10 s as a backstop.
TimeoutStopSec=10
# ---- hardening that works in any container (no mount namespaces needed) -----------------------
NoNewPrivileges=yes
CapabilityBoundingSet=
AmbientCapabilities=
# AF_NETLINK: Node's os.networkInterfaces() (start-up banner) and glibc's resolver use it.
RestrictAddressFamilies=AF_INET AF_INET6 AF_UNIX AF_NETLINK
RestrictRealtime=yes
RestrictSUIDSGID=yes
LockPersonality=yes
SystemCallArchitectures=native
UMask=0077
# Do NOT add MemoryDenyWriteExecute=yes: V8's JIT needs writable+executable memory and Node would crash.
# ---- optional extra hardening: needs mount namespaces ------------------------------------------
# In an unprivileged Proxmox LXC these fail with "status=226/NAMESPACE" unless the container has the
# "Nesting" feature enabled (Proxmox: container > Options > Features > Nesting; then restart the CT).
# The app writes nothing to disk, so a read-only file system view is fine for it.
#ProtectSystem=strict
#ProtectHome=yes
#PrivateTmp=yes
#PrivateDevices=yes
#ProtectKernelTunables=yes
#ProtectKernelModules=yes
#ProtectKernelLogs=yes
#ProtectControlGroups=yes
#ProtectClock=yes
#ProtectHostname=yes
[Install]
WantedBy=multi-user.target