Files
paliad/cmd/server
m 4c47819da8 fix(t-paliad-151): base64-decode PALIADIN_SSH_PRIVATE_KEY env var
Dokploy stores compose env vars in a single-line `.env` file, which
silently truncates multi-line values to their first line. Empirically
verified inside the running paliad container: a multi-line PEM
arrived as just `-----BEGIN OPENSSH PRIVATE KEY-----\n` (36 bytes)
and `ssh -i …` failed with `Load key: error in libcrypto`.

decodePaliadinPrivateKey now accepts either:
  - raw PEM (multi-line, starts with `-----` and contains a newline) —
    used as-is for local-dev convenience
  - base64-encoded PEM — decoded into raw PEM. Survives the .env
    one-line-per-key round-trip.

Whitespace (spaces / line breaks) inside the base64 blob is stripped
before decoding so an OpenSSH-keygen-helper-style 64-char-wrap is
also accepted.

After deploy, m needs to update the Dokploy PALIADIN_SSH_PRIVATE_KEY
secret to the base64-encoded form:
  base64 -w0 < ~/.paliad-staging/paliad-prod-key
…and redeploy. Then sshd's libcrypto loads the key correctly and the
shim's command= path runs.

Refs m/paliad#12
2026-05-08 11:28:02 +02:00
..