Refresh of the open-core distribution from the private tree. Included since the previous snapshot: - Mail module (ADR-158/159/160/169): composer, labels, scheduling, attachments, reply-tokens, IMAP/SMTP bridge + migrations 079-083 - Crawler-readable SSR for /blog and public spaces (ADR-190): blogSeo, publicDocsSeo, per-space SEO prefs, blog index/post pages - Registration policy + referral/promo settings (ADR-183/188) - Message translation + language detection (ADR-185) - Reddit connector for the agent-tool surface Excised from the public distribution (unchanged policy): infrastructure topology and host config, internal ops scripts, DB cleanup snapshots, business documents, throwaway debug scripts, and two private product lines (SC-SIM simulator, personal one-off tools). Real host addresses are replaced with placeholders; credential-shaped literals are redacted. Frontend build verified green on this tree. |
||
|---|---|---|
| .. | ||
| moonraker-tunnel.service | ||
| README.md | ||
3D Printer reverse-tunnel — recovery after server migration
The CRM reaches the printer's Moonraker API at http://localhost:7125
(backend/services/agent-tools/printer-tools.js). That port is fed by a
reverse SSH tunnel initiated from the MKS Pi — the printer dials out to the
CRM box and forwards its local Moonraker. The CRM box cannot reach the printer
directly, so the tunnel always starts on the printer side.
Slicing uses the prusa-slicer CLI on the CRM box (profile:
backend/services/agent-tools/printer/slicer-profile.ini).
What broke
The CRM migrated to <PROD_HOST> / <PROD_IP>.
The MKS Pi's autossh still dials the old (dead) address, so 7125 is empty and
every printer_* MCP tool returns fetch failed.
Server side — DONE (this box)
prusa-slicer2.7.2 installed; headless slice verified against our profile.- Locked-down ingress user
printercreated. Itsauthorized_keysis restricted to reverse-forward oflocalhost:7125only — no shell, no other ports (restrict,port-forwarding,permitlisten="localhost:7125",command=...). - Keypair
mkspi_tunnelgenerated at/home/printer/.ssh/. Validated end-to-end with a stub Moonraker.
Printer side — TODO (run on the MKS Pi)
- Install autossh:
sudo apt-get install -y autossh - Drop the private key (provided separately — never committed) at
/home/pi/.ssh/mkspi_tunnel,chmod 600. - Install the unit and start it:
sudo cp moonraker-tunnel.service /etc/systemd/system/ sudo systemctl daemon-reload sudo systemctl enable --now moonraker-tunnel - If the MKS Pi user is not
pi, editUser=and the key path in the unit.
Verify (on the CRM box, after the printer is up)
ss -tlnp | grep 7125 # tunnel bound
curl -s http://localhost:7125/printer/info # Moonraker answers
Then printer_status MCP tool should return live state.
Future migrations
Change ONLY the IP in moonraker-tunnel.service ExecStart and restart the
unit on the MKS Pi. Server-side ingress + slicer survive untouched.