Authenticate the hosting remote in the deploy preflight #162
Labels
No labels
blocked
bug
decision
duplicate
enhancement
help wanted
invalid
landed?
question
ready-to-merge
stale
wontfix
bug
duplicate
enhancement
help wanted
invalid
question
wontfix
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
allod/tools#162
Loading…
Reference in a new issue
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?
Make
allod site deployprove the hosting credential works before it builds, so a rejected login fails in a second with a sentence the operator can act on rather than as a raw rclone error after a full site build.Primary goals:
allod, becausercloneis deliberately not on the operator's PATH.Current state and specifics
requireSiteRemote(cmd/allod/site.go:359) runsrclone listremotesand checks the listing namesshared(cmd/allod/site.go:49). That proves a stanza exists. It does not open a connection, so a stanza containing a wrong user or password passes the preflight, the whole site is built, and the failure arrives from rclone:Two defects are visible in that output. The build ran before anything checked whether the credential works, and the closing line is false: the connection was refused, so nothing was uploaded and the docroot cannot be partially updated. That line is emitted unconditionally at
cmd/allod/site.go:464.A command that both authenticates and confirms the destination is reachable —
rclone lsd <remote>:or equivalent — subsumes the existing existence check, so this replacesrequireSiteRemoterather than adding a second preflight.Diagnosing the failure above required
nix shell nixpkgs#rclone -c rclone config show, because the deployment installs rclone on theallodwrapper's PATH rather than the operator's. That is deliberate and worth keeping, and it means this command owns its own diagnostics or nobody has them.Scope
In: the preflight, the messages it emits, and the wording of the post-sync failure. Credential creation, update and inspection are
allod/tools#163. Making the credential declarative isallod/tools#164.Measurement that narrows this issue, from the live failure that prompted it.
The credential storage path is not at fault.
allod site configatcf384e8was driven end to end against a real rclone with a deliberately awkward password (Tr1cky!Pass#with$pecials), andrclone revealreturned it byte for byte. Therclone obscure -handling, theTrimRight(line, "\r\n")on the terminal read (cmd/allod/site_config.go:371), and the stanza writer all round-trip correctly. That path had never been exercised against a real rclone before — it was written and tested entirely against stubs — so this was worth confirming rather than assuming.So the live
530 Login authentication failedwas a wrong value entered at the prompt, not a value corrupted in transit. Which is exactly the case this issue exists to catch: the preflight has to reject a credential the server refuses, and no amount of care insite configcan substitute for asking the server.A concrete defect for the messages half of this issue.
cmd/allod/site_config.go:130ends a successful configure with:The operator cannot run that. rclone is installed on the
allodwrapper's PATH and not the user's, so it fails withrclone: command not found, which is what happened when the real failure was being diagnosed. Any advice this namespace prints has to be a command that exists for the person reading it.rclone lsd <remote>:is still the right probe — it just has to be somethingallodruns, not something the operator is told to run.