Skip to content

Commit bc4370f

Browse files
rpgmemclaude
andauthored
chore(deploy): remove temp DEBUG block + document no-passphrase rule (#391)
The diagnostic block added in #390 served its purpose — it confirmed the secret bytes matched the server's keypair (same fingerprint, no CRLF, correct length). That isolated the real root cause: the private key on the testes server had been generated with a passphrase, and GitHub Actions has no way to enter passphrases interactively. The user regenerated a fresh ed25519 key with `-N ""` and the next deploy ran green end-to-end. Two changes here: - `.github/workflows/deploy-develop.yml`: removes the DEBUG block from the "Configure SSH" step. The workflow returns to its production shape (port-aware, accept-new TOFU, best-effort keyscan). - `CLAUDE.md`: adds a note to the `TESTES_SSH_KEY` row in the deploy secrets table calling out the no-passphrase requirement, with the exact `ssh-keygen` invocation that gets it right and the misleading error symptom (`Permission denied (publickey,password)` looks identical to a wrong key). Future sessions won't repeat the cycle. Co-authored-by: Claude <noreply@anthropic.com>
1 parent c6b14b4 commit bc4370f

2 files changed

Lines changed: 1 addition & 13 deletions

File tree

.github/workflows/deploy-develop.yml

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -44,18 +44,6 @@ jobs:
4444
mkdir -p ~/.ssh
4545
echo "$SSH_KEY" > ~/.ssh/deploy_key
4646
chmod 600 ~/.ssh/deploy_key
47-
# TEMP DEBUG (remover após resolver auth — issue de paste do secret).
48-
# Tudo abaixo é seguro: fingerprint não vaza bytes da chave; head/tail
49-
# do .pub derivado não vaza bytes da privada; `file` só reporta tipo.
50-
echo "--- DEBUG: chave recebida do secret ---"
51-
echo "Bytes: $(wc -c < ~/.ssh/deploy_key)"
52-
echo "Linhas: $(wc -l < ~/.ssh/deploy_key)"
53-
echo "Encoding: $(file ~/.ssh/deploy_key)"
54-
echo "Header: $(head -1 ~/.ssh/deploy_key)"
55-
echo "Footer: $(tail -1 ~/.ssh/deploy_key)"
56-
echo "Fingerprint:"
57-
ssh-keygen -lf ~/.ssh/deploy_key 2>&1 || echo " (chave inválida — ssh-keygen rejeitou)"
58-
echo "--- FIM DEBUG ---"
5947
# `TESTES_SSH_PORT` é opcional — VPS padrão usa 22; hospedagem
6048
# gerenciada (Hostinger, KingHost) costuma usar porta alta.
6149
PORT="${SSH_PORT:-22}"

CLAUDE.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -199,7 +199,7 @@ Reasoning: develop is single-maintainer integration territory, not a shared prod
199199
| --- | --- | --- |
200200
| `TESTES_SSH_HOST` | `ssh.testes.example.com` or `185.239.210.8` | DNS or IP of the testes host. **Hostname only, no port, no protocol prefix.** |
201201
| `TESTES_SSH_USER` | `wp-deploy` | Account with write access to the plugin dir |
202-
| `TESTES_SSH_KEY` | `-----BEGIN OPENSSH PRIVATE KEY-----…` | Private half of a dedicated keypair; public half goes in `~/.ssh/authorized_keys` on the testes host |
202+
| `TESTES_SSH_KEY` | `-----BEGIN OPENSSH PRIVATE KEY-----…` | Private half of a dedicated keypair; public half goes in `~/.ssh/authorized_keys` on the testes host. **Must have no passphrase** — generate with `ssh-keygen -t ed25519 -N "" -f <path>`. GitHub Actions cannot enter passphrases interactively; a passphrase-protected key surfaces as `Permission denied (publickey,password)` in the rsync step, indistinguishable from a wrong key. |
203203
| `TESTES_SSH_PORT` | `65002` | **Optional.** Defaults to `22`. Managed hosting (Hostinger, KingHost, Locaweb) usually exposes SSH on a high port — set this when so. |
204204
| `TESTES_REMOTE_PATH` | `/var/www/testes/wp-content/plugins/ffcertificate` | Absolute path; no trailing slash |
205205

0 commit comments

Comments
 (0)