Skip to main content

Scanner agent for SnapFS.

Project description

SnapFS Scanner Agent

The SnapFS Scanner Agent connects to the SnapFS Gateway over WebSocket and runs snapfs scan commands on demand.

This lets the gateway (and web app) trigger scans on machines that have direct access to storage (local filesystems, NFS mounts, etc.) without teaching the snapfs CLI about WebSockets or long-running daemons.

The snapfs CLI remains responsible for talking HTTP to the gateway, performing hash lookups, and publishing file.upsert events. The scanner agent is purely a control-plane component that runs snapfs scan as a subprocess.

Responsibilities

  • Connect to the SnapFS Gateway via WebSocket as a scanner agent.
  • Advertise its capabilities (e.g. a local filesystem root).
  • Receive SCAN_TARGET commands from the gateway.
  • Run snapfs scan <root> [options] locally for each command.
  • Report errors back to the gateway if scans fail.

the agent:

  • Handles a single filesystem root (configured by SNAPFS_SCAN_ROOT).
  • Runs one scan at a time.
  • The snapfs CLI toolpublishes scan events

Requirements

  • SnapFS Gateway with an /agents WebSocket endpoint that:
    • accepts AGENT_HELLO messages, and
    • sends SCAN_TARGET commands to scanner agents.
  • Python 3.8+ (if running the agent directly).
  • The snapfs CLI installed and on PATH inside the container/host.

Running

From Python (local dev):

pip install snapfs-agent-scanner snapfs
snapfs-agent-scanner

In Docker (image built from this repo):

docker run --rm \
  -e GATEWAY_WS=ws://gateway:8000 \
  -e SNAPFS_AGENT_ID=scanner-01 \
  -e SNAPFS_SCAN_ROOT=/mnt/data \
  -v /mnt/data:/mnt/data \
  ghcr.io/snapfsio/snapfs-agent-scanner:latest

Configuration

The agent is configured via environment variables:

GATEWAY_WS          WebSocket base URL for the gateway (default: ws://gateway:8000)
GATEWAY_HTTP        HTTP base URL for the gateway (reserved for future use)
SNAPFS_AGENT_ID     Stable ID for this scanner agent (default: scanner-01)
SNAPFS_SCAN_ROOT    Default filesystem root inside the container (default: /data)

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

snapfs_agent_scanner-0.1.0.tar.gz (14.1 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

snapfs_agent_scanner-0.1.0-py3-none-any.whl (15.4 kB view details)

Uploaded Python 3

File details

Details for the file snapfs_agent_scanner-0.1.0.tar.gz.

File metadata

  • Download URL: snapfs_agent_scanner-0.1.0.tar.gz
  • Upload date:
  • Size: 14.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.8.10

File hashes

Hashes for snapfs_agent_scanner-0.1.0.tar.gz
Algorithm Hash digest
SHA256 c4f6442d630bec72a35c53ee9e4863ea3b96dbdd034d19f1c17f9554fb0bf791
MD5 d4ad2120059fb862408b480d984fff35
BLAKE2b-256 b80aef247bdc698b5d79ba8691d59d5f3270123e686a8cb72614512d0749c9da

See more details on using hashes here.

File details

Details for the file snapfs_agent_scanner-0.1.0-py3-none-any.whl.

File metadata

File hashes

Hashes for snapfs_agent_scanner-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 7c4cf77dd4a0c20109e92cb2c52b3d4f6780a2b609c9cfdf0929ada093dc4405
MD5 44fb54a43499567b0794eb394da05454
BLAKE2b-256 5d5047f0b6efb2144f14cfe88c9bfbe46ce6e7026650ab1b1812b0249d1fd4db

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page