Skip to content

feat: add SFTP action (#37) - #86

Open
raphael-goetz wants to merge 2 commits into
mainfrom
feat/#37-sftp-action
Open

raphael-goetz wants to merge 2 commits into
mainfrom
feat/#37-sftp-action

Conversation

@raphael-goetz

Copy link
Copy Markdown
Member

What

Adds a new Rust Hercules action, sftp-action, following the cron/rest/mcp
conventions. It speaks SFTP over SSH (via russh/russh-sftp, pure Rust) and
exposes four runtime functions:

  • sftp::file::read (path: TEXT): TEXT
  • sftp::file::write (path: TEXT, content: TEXT): void
  • sftp::file::delete (path: TEXT): void
  • sftp::directory::list (path: TEXT): ARRAY<SFTP_ENTRY> (+ the SFTP_ENTRY data type)

Why

Closes #37.

The issue had no body/spec, so scope was inferred from the repo's established
Rust-action conventions.

How

  • Connection details (SFTP_HOST/SFTP_PORT/SFTP_USERNAME/SFTP_PASSWORD)
    come from project-level configuration, mirroring mcp-action's token config
    so secrets stay out of flow definitions. Password auth only for now.
  • src/config.rs resolves + validates the config (unit-tested); src/client.rs
    wraps the SSH+SFTP session and maps failures to stable runtime error codes
    (SFTP_SSH_ERROR / SFTP_PROTOCOL_ERROR / SFTP_AUTH_FAILED / SFTP_CONFIG_ERROR
    / SFTP_NOT_UTF8); src/functions.rs holds the four handlers.
  • Host key verification is not enforced yet — the presented key is accepted
    and logged (documented in client.rs as a deliberate tradeoff / follow-up).
  • russh pulls in aws-lc-rs, so the Alpine Dockerfile adds gcc make perl to
    the builder stage.
  • Pinned hercules-sdk/hercules-macros to 1.5.0 to match the sibling actions.
  • Registered sftp-action in the .rust-actions CI matrix in .gitlab-ci.yml.

Testing

All green:

  • cargo fmt --all --check
  • cargo clippy --all-targets --all-features -- -D warnings
  • cargo test — 7/7 pass
  • cargo build
  • Docker Alpine build (the CI gate for rust actions) — succeeds, 26.7 MB image
  • cargo run -- export — all four function + SFTP_ENTRY definitions generate correctly

🤖 Generated with Claude Code

Add a new Rust Hercules action, following the cron/rest/mcp conventions,
that exposes four runtime functions for operating on a remote SFTP server:

- sftp::file::read     (path: TEXT): TEXT
- sftp::file::write    (path: TEXT, content: TEXT): void
- sftp::file::delete   (path: TEXT): void
- sftp::directory::list (path: TEXT): ARRAY<SFTP_ENTRY>

Connection details (host, port, username, password) are read from
project-level configuration. SFTP is spoken over SSH via russh/russh-sftp
(pure Rust). Registers the action in the GitLab CI rust-actions matrix.

Refs #37

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@raphael-goetz raphael-goetz self-assigned this Nov 1, 2026
Signed-off-by: Raphael Götz <52959657+raphael-goetz@users.noreply.github.com>
@github-actions

github-actions Bot commented Nov 1, 2026

Copy link
Copy Markdown

GitLab Pipeline Action

General information

Link to pipeline: https://gitlab.com/code0-tech/development/centaurus/-/pipelines/3014870201

Status: Passed
Duration: 12 minutes

Job summaries

docs:preview

Documentation preview available at https://code0-tech.gitlab.io/-/development/telescopium/-/jobs/17645481206/artifacts/out/index.html

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

SFTP Action

1 participant