Nomploy Nomad Packs

← All packs

dufs v0.1.0

Dev tools

Dufs — a tiny, fast file server in a single binary: static serving, uploads, downloads, search, and full WebDAV, with optional per-path access control. Great for quickly sharing a directory over HTTP/WebDAV. Deployed as a host-networked Nomad service with a served data volume.

nomad-pack run dufs --registry nomploy
…or one line (add registry + run)
curl -fsSL https://packs.nomploy.com/install.sh | sh -s -- dufs

Needs nomad-pack on PATH. The script only adds the nomploy registry and runs this pack.

1 task http 5001 1 volume image sigoden/dufs:latest tracks :latest image bumped today
Variables 10
values.hcl

Save as values.hcl, edit, then run:

nomad-pack run dufs -f values.hcl --registry nomploy
# The name of the Nomad job.
job_name = "dufs"

# The Nomad namespace to deploy into.
namespace = "default"

# The datacenters to deploy to.
datacenters = ["*"]

# The Dufs container image. Pin a tag in production.
image = "sigoden/dufs:latest"

# Host port for the file server.
port = 5001

# Allow uploads, deletes, renames, and directory creation (dufs -A). Default false = read-only serving.
allow_all = false

# Optional access-control rule (dufs -a), e.g. "user:pass@/:rw". Empty = no auth (anyone can access).
auth = ""

# Named volume for the served files (/data).
data_volume = "dufs_data"

# Placement constraints. Pin to the node holding the volume. On a nomploy cluster: attribute = "$${meta.nomploy_control_plane}", operator = "=", value = "true".
constraints = []

# Resources for the Dufs task.
resources = {
    cpu    = 200
    memory = 128
  }
NameTypeDefaultDescription
job_name string
"dufs"
The name of the Nomad job.
namespace string
"default"
The Nomad namespace to deploy into.
datacenters list
["*"]
The datacenters to deploy to.
image string
"sigoden/dufs:latest"
The Dufs container image. Pin a tag in production.
port number
5001
Host port for the file server.
allow_all bool
false
Allow uploads, deletes, renames, and directory creation (dufs -A). Default false = read-only serving.
auth string
""
Optional access-control rule (dufs -a), e.g. "user:pass@/:rw". Empty = no auth (anyone can access).
data_volume string
"dufs_data"
Named volume for the served files (/data).
constraints list
[]
Placement constraints. Pin to the node holding the volume. On a nomploy cluster: attribute = "$${meta.nomploy_control_plane}", operator = "=", value = "true".
resources object
{
    cpu    = 200
    memory = 128
  }
Resources for the Dufs task.
Back up this pack

This pack stores data in one Docker named volume: dufs_data

restic

# Run on the node hosting this pack. Point restic at your repo first:
#   export RESTIC_REPOSITORY="s3:https://<account>.r2.cloudflarestorage.com/<bucket>"
#   export RESTIC_PASSWORD="<repo-password>"
#   export AWS_ACCESS_KEY_ID=<key>  AWS_SECRET_ACCESS_KEY=<secret>
restic backup \
  /var/lib/docker/volumes/dufs_data/_data

rclone (sync to S3/R2)

rclone sync /var/lib/docker/volumes/dufs_data/_data backup:<bucket>/dufs_data

Paths assume the default Docker volume location (/var/lib/docker/volumes). Restore by stopping the job, restoring files into the same volume, and re-running the pack.

Readme

dufs

Dufs — a tiny, fast file server in a single binary. Static serving, uploads and downloads, search, resumable transfers, and full WebDAV, with optional per-path access control. Perfect for quickly sharing a directory over HTTP or mounting it as a network drive.

Single host-networked Nomad service that serves a data volume.

Deploy

nomad-pack registry add nomploy https://github.com/Nomploy/nomad-packs
nomad-pack run dufs --registry=nomploy

Configure

Variable Default Description
port 5001 File server port.
allow_all false Allow uploads/deletes/renames (-A). Default is read-only.
auth "" Access-control rule (-a), e.g. user:pass@/:rw. Empty = no auth.
data_volume dufs_data /data — the served directory.
image sigoden/dufs:latest Container image. Pin a tag in production.
resources { cpu = 200, memory = 128 } Task resources.

By default the volume is served read-only to anyone who can reach the port. Set allow_all=true for write access and add an auth rule to require a login (e.g. admin:secret@/:rw for a read-write admin, or @/:ro for public read-only). Mount it as WebDAV in your OS file manager. Serves plain HTTP — front it with a reverse proxy for TLS or keep it internal. Pin the job to the node holding the volume with constraints.