Paliadin: route prod via Tailscale SSH to mRiver (preserve Claude Code subscription) #12
Open
opened 2026-05-07 20:34:30 +00:00 by mAi
·
6 comments
No Branch/Tag Specified
main
mai/planck/coder-b5-b6-train-share
mai/archimedes/fixer-port-engine
mai/maxwell/coder-b4-akte-mode
mai/lorenz/coder-b3-event-triggered
mai/euler/fixer-builder-add
mai/brunel/fixer-prod-500s-after-b1
mai/galileo/coder-b1-b2-mvp-train
mai/pasteur/fixer-pkg-litigationplann
mai/newton/coder-b0-scenario-db
mai/edison/inventor-prd-columnar
mai/knuth/coder-workflow-tracker
mai/atlas/inventor-extend-tools
mai/cronus/inventor-unified
mai/atlas/inventor-deadline-system
mai/atlas/inventor-followup-rules
mai/athena/consultant-deadline
mai/brunel/fixer-dark-mode-support
mai/knuth/coder-cronus-fristenrechn
mai/ritchie/coder-mig-153-proceeding
mai/atlas/inventor-proceeding
mai/cronus/inventor-fristenrechner
mai/curie/coder-mig152-clone-dedupe
mai/darwin/researcher-lexy-draft
mai/knuth/coder-dedupe-null
mai/cronus/coder-composer-slice-f
mai/cronus/coder-composer-slice-e
mai/cronus/coder-composer-slice-d
mai/curie/coder-slice-b6-url-rename
mai/curie/coder-slice-b5-go-rename
mai/cronus/coder-composer-slice-c
mai/curie/coder-slice-b4-destructive-drop
mai/cronus/coder-composer-slice-b
mai/cronus/coder-composer-slice-a
mai/cronus/inventor-prd-for
mai/knuth/coder-verfahrensablauf
mai/ritchie/coder-make-backup
mai/diesel/fixer-dark-mode-css
mai/curie/coder-slice-b3-read-cutover
mai/diesel/fixer-verfahrensablauf
mai/curie/coder-slice-b2-dual-write
mai/cronus/coder-slice-d-scenarios
mai/knuth/coder-backfill-applies
mai/hermes/gitster-verfahrensablauf
mai/cronus/coder-berufung-labels-refactor
mai/diesel/hotfix-2-mig-134-missing
mai/curie/coder-slice-b1-procedural-events
mai/cronus/coder-slice-c-upc-snapshot
mai/brunel/hotfix-rename-upc-apl
mai/cronus/coder-slice-b3-primary-party
mai/cronus/coder-slice-b2-catalog-query
mai/cronus/inventor-litigation-slice-b
mai/curie/researcher-slice-b-zero
mai/cronus/inventor-litigation
mai/artemis/gitster-remove-admin
mai/ritchie/coder-sort-post-trigger
mai/knuth/coder-conditional-label
mai/hermes/coder-verfahrensablauf
mai/brunel/rebase-121-conditional
mai/knuth/coder-conditional-rule
mai/hermes/gitster-dark-mode-fix
mai/ritchie/coder-submission-form
mai/artemis/gitster-re-surface
mai/brunel/fixer-views-any-filters
mai/cronus/coder-cicd-slice-a
mai/knuth/coder-wave-1-tier-1-rule
mai/ritchie/coder-upc-damages-add
mai/cronus/inventor-ci-cd-pre
mai/brunel/rebase-108-language
mai/hermes/gitster-admin-rules-list
mai/artemis/gitster-submission
mai/icarus/gitster-verfahrensablauf
mai/orpheus/gitster-search-input
mai/atlas/coder-event-card-choices-slice-ab
mai/hermes/gitster-date-range
mai/demeter/gitster-submission
mai/knuth/coder-hl-patents-style
mai/hermes/gitster-draft-editor
mai/atlas/inventor-per-event-card
mai/knuth/coder-deadline-rule-tier
mai/cronus/coder-procedural-events-slice-a
mai/hermes/gitster-deadline-form
mai/artemis/gitster-add-missing-i18n
mai/demeter/gitster-paliadin-chat
mai/brunel/wave0-tier0-deadline-fixes
mai/artemis/coder-docker-compose-yml
mai/icarus/coder-inbox-overhaul-slice-a
mai/atlas/coder-date-range-picker-slice-a
mai/brunel/fixer-de-inf-lg-cfi
mai/cronus/inventor-procedural
mai/hermes/gitster-event-type-modal
mai/cronus/coder-backup-mode
mai/curie/researcher-bulletproof
mai/hermes/gitster-draft-editor-focus-jump
mai/cronus/inventor-backup-mode
mai/hermes/gitster-submissions
mai/artemis/gitster-deadline-form
mai/brunel/fixer-submission-preview
mai/brunel/fixer-test-data-reset
mai/artemis/gitster-approval-withdraw
mai/demeter/gitster-events
mai/hermes/gitster-sidebar-loses
mai/hermes/gitster-browse-a
mai/brunel/fixer-submissions-demo
mai/icarus/inventor-inbox-overhaul
mai/atlas/inventor-symmetric-date
mai/artemis/gitster-demote-daten
mai/hermes/gitster-team-view-mailto
mai/knuth/coder-global-schriftsatze
mai/knuth/coder-schriftsatze
mai/ritchie/coder-author-demo-docx
mai/knuth/coder-add-schriftsatze
mai/knuth/coder-add-checklist
mai/knuth/coder-anchor-lookup-must
mai/tesla/dashboard-resize-clamp
mai/knuth/coder-demote-projekt
mai/knuth/coder-paliadin-chat
mai/knuth/coder-print-views
mai/knuth/coder-add-proceeding
mai/knuth/coder-submission
mai/ritchie/coder-extend-team-email
mai/knuth/coder-changelog-catch-up
mai/tesla/dashboard-overlap
mai/pasteur/fixercoder-dashboard
mai/newton/inventor-configurable
mai/dirac/inventorcoder-user
mai/gauss/inventorcoder-team-admin
mai/kepler/inventorcoder-project
mai/darwin/roadmap-ccr-en
mai/euler/coder-small-ux-polish
mai/darwin/fristenrechner-cleanup
mai/darwin/fixercoder-priority-bug
mai/leibniz/inventor-caldav-multi
mai/hertz/inventor-unified-modal
mai/archimedes/inventor-excel-data
mai/boltzmann/inventor-gap-tolerant
mai/copernicus/submission-slice-1
mai/fermi/interactive-session
mai/hertz/inventor-suggest-changes
mai/copernicus/inventor-submission
mai/mendel/test-strategy-slice-1
mai/mendel/inventor-test-strategy
mai/ampere/custom-views-improvements
mai/joule/mig-097-apply-huygens-s
mai/ohm/workstream-b-rename
mai/huygens/workstream-a-backfill
mai/kelvin/t-204-phase-2-proceeding
mai/bohr/ingest-t-paliad-203-rule
mai/curie/fristenrechner-gap
mai/maxwell/inbox-grey-out
mai/rutherford/slice-9-follow-up-b-re
mai/dirac/slice-9-follow-up-a
mai/bose/determinator-cascade-slice-3
mai/bose/determinator-cascade-slice-2
mai/bose/determinator-row-cascade
mai/lorenz/fristen-phase-3-slice-9
mai/curie/fristen-phase-3-slice-12
mai/planck/aichat-phase-b-paliad
mai/young/fristen-phase-3-slice-11b
mai/lorenz/fristen-phase-3-slice-11a
mai/lorenz/fristen-phase-3-slice-10
mai/lorenz/fristen-phase-3-slice-8
mai/lorenz/fristen-phase-3-slice-7
mai/lorenz/fristen-phase-3-slice-6
mai/lorenz/fristen-phase-3-slice-5
mai/lorenz/fristen-phase-3-slice-4
mai/lorenz/fristen-phase-3-slice-3
mai/lorenz/fristen-phase-3-slice-2
mai/lorenz/fristen-phase-3-slice-1
mai/pauli/fristen-phase2-design
mai/tesla/project-timeline-chart
mai/pauli/fristen-logic-audit
mai/pauli/determinator-b1-row-by
mai/noether/tools-cleanup-slice-1
mai/kelvin/inventor-tools-surface
mai/planck/paliadin-per-user-rls
mai/maxwell/bug-bundle-filterbar
mai/faraday/project-timeline-chart
mai/schroedinger/smarttimeline-slice-4
mai/bohr/smarttimeline-slice-3
mai/gauss/smarttimeline-slice-2
mai/riemann/filterbar-phase-2-slice
mai/lagrange/smarttimeline-design-the
mai/curie/researcher-determinator
mai/noether/collapse-regel-typ-on
mai/riemann/inventor-universal
mai/minkowski/project-level-our-side
mai/dirac/inventor-inline-paliadin
mai/feynman/fristenrechner
mai/minkowski/navbar-dashboard-reorg
mai/shannon/approval-rework
mai/einstein/consultant-deadline-data
mai/curie/researcher-upc-rop-audit
mai/noether/paliadin-real-claude
mai/noether/inventor-paliadin
mai/hilbert/inventor-approval-policy
mai/shannon/bug-frist-due-date
mai/fritz/bug-fristen-termine
mai/godel/inventor-projects-page
mai/fritz/bug-paliadin-chat
mai/kepler/inventor-profession-vs
mai/noether/inventor-paliadin-in-app
mai/fritz/bulk-team-email-send-to
mai/noether/inventor-local-chat-for
mai/noether/inventor-data-display
mai/fritz/bug-derived-team-members
mai/fritz/bug-sidebar-visibly
mai/noether/inventor-project
mai/shannon/bug-project-team-add
mai/cronus/inventor-dual-control
mai/fritz/bug-edit-mode-on
mai/cronus/inventor-holidays-per
mai/ritchie/phase-h-ai-deadline
No results found.
No Label
Milestone
No items
No Milestone
Projects
Clear projects
No project
Notifications
Due Date
No due date set.
Dependencies
No dependencies set.
Reference: m/paliad#12
Reference in New Issue
Block a user
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.
No description provided.
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Goal
Route Paliadin from paliad.de's Dokploy container (mLake,
100.99.98.201) to mRiver (100.99.98.203) via Tailscale + SSH, so m can use Paliadin from prod without losing the Claude-Code-subscription benefit (vs paying Anthropic API tokens).Locked direction (m, 2026-05-07 22:33)
SSH-tunnel via Tailscale chosen over Anthropic API direct (preserves subscription) and over standalone HTTP daemon on mRiver (cleaner protocol but extra moving piece).
Concrete shape:
tmux new-session ...invocation forssh m@100.99.98.203 tmux ...when running on a host without local tmuxOut of scope (v1)
Open design questions (for inventor — m will engage)
Container Tailscale shape
network_mode: hostso paliad inherits host's Tailscale? Userspacetailscaledinside paliad's container with auth-key from secrets? Inventor recommends, m signs off..env.age? How is it rotated?sshclient + Tailscale binary. Inventor proposes the Dockerfile diff. Image-size impact?SSH identity + auth
.env.age?). Public key authorised on mRiver under~m/.ssh/authorized_keys.authorized_keysentry restricts tocommand="<paliadin-shim>"so the key can ONLY run the tmux invocation, not arbitrary shells. Define the shim shape.~/.ssh/known_hostspre-populated with mRiver's host key? OrStrictHostKeyChecking=accept-newfirst time? Inventor recommends.Service-layer integration
internal/services/paliadin.go: Where exactly does the tmux invocation happen? Does the SSH version share the same code path with a flag, or is there a separateRemotePaliadinServiceimplementation?PALIADIN_REMOTE_HOST=100.99.98.203? Auto-detect (try local tmux first, fall back to SSH)? Inventor recommends.ControlMaster auto?Reliability + monitoring
ssh -o ConnectTimeout=2? Cached health check?friendlyErrorMessageshape from t-150. Add error codemriver_unreachablewith localised message ("mRiver ist offline — Paliadin nicht erreichbar. Lokal mit./paliadstarten oder mRiver wecken.").Security + auth-domain
m. Mitigations: SSHcommand=restriction (Q5); audit log on mRiver-side; Dokploy host-disk encryption assumption.Phasing
PALIADIN_REMOTE_HOSTenv var.References
internal/services/paliadin.go— current local-tmux implementationdocs/design-paliadin-2026-05-07.md— original design (notes Phase 1 was "Anthropic API direct"; this issue introduces a third path)100.99.98.201(Dokploy host)100.99.98.203(m's laptop, runs Claude Code).env.agefor Dokploy secrets patternfriendlyErrorMessage) — pattern to extend formriver_unreachableInventor brief
mai/noether/inventor-paliadin-tailscale-sshdocs/design-paliadin-tailscale-ssh-2026-05-07.md. Three sub-designs:Inventor design pushed:
docs/design-paliadin-tailscale-ssh-2026-05-07.md(commitbefa41conmai/noether/inventor-paliadin).m's locked decisions (verbatim, 22:35):
network_mode: hoston paliad (overrode inventor's sidecar recommendation; Phase A gates rollout on traefik still routing under host mode)paliadin-shim(one RPC per turn:run-turn/reset/health/bootstrap)PALIADIN_REMOTE_HOST+Paliadininterface split (LocalPaliadinService↔RemotePaliadinService)PALIADIN_SSH_PRIVATE_KEY, chmod-600 tmpfile at startupVerified live before designing (so the design isn't built on stale CLAUDE.md):
100.99.98.203has tmux 3.6a + claude CLI at/home/m/.local/bin/claude100.99.98.201has Tailscale running, sees mRiveractive; direct [...]:41641~/.ssh/authorized_keysdoes NOT exist on mRiver yet — Phase A creates itThree-phase rollout:
+openssh-client), compose (host mode + 4 env vars), Go interface split, Dokploy secrets registration.mriver_unreachablefriendly error extending t-paliad-150, admin dashboard health probe.Three open questions for m at end of doc (§11): traefik+host-mode Dokploy doc check before B, shim location (repo vs mRiver-only), and the dead
ANTHROPIC_API_KEYcomment line in compose.Inventor stopped here. No code shipped. Awaiting m's go/no-go before coder shift.
Phase A.0 complete (coder shift, noether) — SSH path proven end-to-end on the tailnet.
Commits:
0248411shim,f952fb8design amendment.What changed from the original design
Tailscale SSH intercepts mRiver:22 — banner says
SSH-2.0-Tailscale, auth methodnone,authorized_keys command=directive never fires. Discovered while debugging "fish: Unknown command: health" on the first run-turn test.Fix: added a separate listen port
:22022via asystemd ssh.socketdrop-in. Tailscale SSH only intercepts:22, so:22022hits real OpenSSH wherecommand=/from=/no-pty/...work as specified. m's interactivetailscale ssh m@mriveron:22is untouched.(First attempt at the drop-in briefly failed with
Address already in use— a stalePort 22022directive from sshd_config was holding the port; reverted in ~30 s and retried clean. Documented in §4.5.)Verified live
State on mRiver (m's laptop) — already in place
/home/m/.local/bin/paliadin-shim(executable) — repo-version-controlled atscripts/paliadin-shim~/.ssh/authorized_keys— paliad-prod public key withcommand=/from="100.99.98.201"/no-pty/no-port-forwarding/no-agent-forwarding/no-X11-forwarding/no-user-rc/etc/systemd/system/ssh.socket.d/paliad.conf— port 22022 socket drop-in~/.paliad-staging/— keypair + known_hosts staged for Dokploy registrationSecrets to register in Dokploy (m's hands)
PALIADIN_REMOTE_HOST100.99.98.203PALIADIN_REMOTE_PORT22022PALIADIN_REMOTE_USERmPALIADIN_SSH_PRIVATE_KEYcat ~/.paliad-staging/paliad-prod-key(multi-line)PALIADIN_KNOWN_HOSTScat ~/.paliad-staging/known_hosts(one line)Phase A.5 (PENDING m's hands)
Validate
network_mode: host+ traefik routing on prod paliad.de:docker-compose.yml: addnetwork_mode: hosttoweb, removeexpose: ["8080"]curl --connect-timeout 5 -sSI https://paliad.de/— expect 200 (or login redirect), NOT 502git revert HEAD && git pushto roll back; revisit decision 1 in a follow-up issueThis step touches prod paliad.de — coder did NOT execute it without your hands.
Phase B unblocked from a code perspective
But should not merge until A.5 confirms host-mode is OK. Code work: Dockerfile +openssh-client; compose host-mode + 5 env vars; Go interface split (
Paliadininterface, renameLocalPaliadinService, newRemotePaliadinServiceinpaliadin_remote.go);cmd/server/main.goenv-var wiring;friendlyErrorMessagemriver_unreachable case; i18n keys.Two remaining open questions
ANTHROPIC_API_KEYenv var reservation in compose comments — keep for production-v1 or strip?Standing by for next instruction.
Phase B code merged into main as
1d7c7d7, bundling 7 commits frommai/noether/inventor-paliadin:befa41c— design doc (docs/design-paliadin-tailscale-ssh-2026-05-07.md)0248411—scripts/paliadin-shim(mRiver-side restricted shim)f952fb8— design amend: port 22022 bypass + Phase A.0 resultsf62bf9f— Dockerfile +openssh-client56a3dc9— refactor: extractPaliadininterface;PaliadinService→LocalPaliadinService0c8a2f1—RemotePaliadinService+DisabledPaliadinService+main.goenv-var switch (PALIADIN_REMOTE_HOST→ remote /tmuxon PATH → local / else → disabled)68c56ea— 14 unit tests viacallShimHook(no real SSH required)e4110cf— frontendfriendlyErrorMessagefor remote-Paliadin error codes (DE+EN)Production behavior unchanged. Without
PALIADIN_REMOTE_HOSTin env, paliad never invokes ssh — local-tmux PoC path is byte-identical (tests pass).Phase A.5 still pending m's hands —
da971a7(docker-composenetwork_mode: host+ 5 new env vars) is held onmai/noether/inventor-paliadinand explicitly markedDO NOT MERGE before Phase A.5. The compose flip's commit message has the A.5 procedure (curl test + revert path on M1 502).Three open items for m before this issue closes:
docker-compose.ymlhost-mode on a temp branch (or cherry-pickda971a7), redeploy, curlpaliad.de, gate the merge on 200 vs 502.PALIADIN_SSH_PRIVATE_KEY+PALIADIN_KNOWN_HOSTSas Dokploy secrets (values staged at~/.paliad-staging/on mRiver per issuecomment-6886).ANTHROPIC_API_KEYcomment line from compose.Phase A.5 + A.7 done — Paliadin chat works end-to-end from paliad.de prod.
m's "I still don't have a connection" was the symptom of two issues stacked on top of the original A.5 attempt that was reverted (
a80652a→82faa3don 2026-05-08 00:38).Root causes
Decision 1 (
network_mode: host) was actually wrong — not because traefik 502s (the M2 case I had designed for), but because Dokploy auto-injectsnetworks: [dokploy-network, default]on the primary service for traefik routing. Compose then refuses:service web declares mutually exclusive network_mode and networks: invalid compose project. That's the reverted-merge's failure mode, recorded in/etc/dokploy/logs/.../...:00:38:05.log.The host-mode premise was unnecessary anyway. Empirical test (commit log):
Plain alpine container on Dokploy's default bridge SSHs to mRiver fine. Docker source NAT masquerades the bridge IP onto mLake's tailscale0 (100.99.98.201), which matches the
from="100.99.98.201"clause on mRiver's authorized_keys. The kernel routes tailnet traffic for free; nonetwork_mode: host, no Tailscale-in-container needed.Multi-line PEM env vars don't survive Dokploy's
.envmechanism — got truncated to the BEGIN line (36 bytes) inside the container.ssh -i …failed withLoad key: error in libcrypto. Fixed by base64-encoding the secret and decoding inbuildPaliadinRemoteConfig.Commits to main today
a0d1e77— Phase A.5 (correct version): dropsnetwork_mode: host, adds 5 PALIADIN_* env entries to compose, includes the rationale + the empirical alpine-on-bridge proof in the commit body4c47819— base64-decodePALIADIN_SSH_PRIVATE_KEY; accepts both raw PEM (local-dev) and base64 (Dokploy)Dokploy compose
Zx147ycurfYagKRl_Zzyo(paliad) updated via API:PALIADIN_SSH_PRIVATE_KEYnow base64-encoded (560 chars, single line).End-to-end verification (inside the live paliad-prod container, 11:33)
paliad startup log confirms:
paliadin: remote mode → ssh m@100.99.98.203:22022. Claude pane reset + paliad container restarted clean so m's first /paliadin invocation gets the real system prompt via Go's lazyensureBootstrappedpath.Design doc follow-up
docs/design-paliadin-tailscale-ssh-2026-05-07.md§4–§4.5 / §7 are now empirically wrong — host mode was never needed. A small amendment is in scope, but not urgent (the production code works; the design rationale lives in the commit messages ofa0d1e77and4c47819).Status: t-paliad-151 working end-to-end. Standing by.
Phase A.5 + A.7 complete — Paliadin chat works end-to-end from paliad.de prod via SSH to mRiver.
Final commit chain on main:
a0d1e77— Phase A.5: compose env-var passthrough (5 PALIADIN_* entries; no host-mode flip needed)db3514c— Merge of the above4c47819— base64-decode SSH key (Dokploy.envtruncates multi-line values to first line)319221f— Merge of the aboveTwo empirical findings that override the original design
(1)
network_mode: hostis incompatible with this Dokploy app's compose lifecycle. Dokploy auto-injectsnetworks: [dokploy-network, default]on the primary service for traefik routing, which is mutually exclusive withnetwork_mode: host. First attempt at host mode (a80652a) failed compose validation; reverted as82faa3d.(2) host mode wasn't needed anyway. Verified by running a plain alpine container on Dokploy's default bridge:
Docker's outbound NAT masquerades the container's bridge IP onto mLake's host IPs, including
tailscale0(100.99.98.201). Linux routing on mLake sends100.99.98.0/24totailscale0. mRiver's sshd sees the connection coming from100.99.98.201, matching thefrom="100.99.98.201"clause on the paliad-prodauthorized_keysentry. The kernel does the masquerade for free — no Tailscale-in-container, no sidecar, no host networking.Design doc follow-up needed
docs/design-paliadin-tailscale-ssh-2026-05-07.md§4 (host-mode shape) is empirically wrong; §7 Phase A.5 needs an "M3: kernel does the masquerade for you" entry, and decision 1 in §3 should be amended. Filed as a TODO in the A.5 commit message — worth a small design-doc-amend follow-up before this thread closes.Done
t-paliad-155 merged into main as
5893c45. Bundle:97a4124— real Claude SKILL.md + per-user tmux session keying (paliad-paliadin-<user_id_short>)9579032— re-author skill via/write-a-skillconventions (96-line SKILL.md + 134-linereferences/sql-recipes.md)e75a71f— cwd fix: shim spawns claude in/home/m/dev/paliad(configurable viaPALIADIN_REMOTE_CWD) so project-scoped MCPs (Supabase) load. Solves m's 'no DB access' symptom from earlier dogfood.3e1f4ee—PALIADIN_TIMEOUT_Sdefault 60→120s for cold-start safety; SKILL.md bans psql/curl fallbacks (Claude must write 'DB unreachable' rather than nix-shelling postgres on a 1m20s detour). Solves m's 'loses connection before response came in' from earlier dogfood.Lockstep update on mRiver:
~/.local/bin/paliadin-shimrefreshed (new verb signatures:health <session>,run-turn <session> <uuid> <msg-base64>,reset <session>; bootstrap verb removed).~/.claude/skills/paliadin/refreshed viascripts/install-paliadin-skill. Both done before paliad container redeploys, so the new Go side talks to the new shim from the first post-deploy turn.Service-side (
paliadin_remote.go,paliadin.go,main.go):paliadinSystemPromptkeystroke-bootstrap path deleted. Per-user session keying derived fromreq.UserID.paliadin_prompt.goremoved (skill is now source of truth). 14 unit tests viacallShimHookupdated for the new shape.Known limitation flagged for next task (t-paliad-156, queued): even with the skill loaded and the right MCP, Claude queries via service role — sees ALL data, RLS bypassed. Skill enforces
paliad.can_see_projectpredicate as a stopgap, but it's discipline, not enforcement. m's call (2026-05-08 13:29): proper fix is per-turn JWT minted by paliad withsub=<user_id>, passed through SSH/shim/file to Claude, used asAuthorization: Beareragainst PostgREST. Filed as separate task; ships after this lands and is dogfooded.