Nomploy Nomad Packs

← All packs

rustpad v0.1.0

Dev tools

Rustpad — a small, fast collaborative text editor: multiple people edit the same document in real time, right in the browser. Deployed as a single host-networked Nomad service.

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

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

1 task http 3030 1 volume image ekzhang/rustpad:latest tracks :latest image bumped today
Variables 9
values.hcl

Save as values.hcl, edit, then run:

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

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

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

# The Rustpad container image. Pin a tag in production.
image = "ekzhang/rustpad:latest"

# Host port for the Rustpad web UI.
port = 3030

# Named volume mounted at /data (SQLite persistence for documents).
data_volume = "rustpad_data"

# Days a document is kept after its last edit before garbage collection (EXPIRY_DAYS).
expiry_days = 1

# Placement constraints. On a nomploy cluster: attribute = "$${meta.nomploy_control_plane}", operator = "=", value = "true".
constraints = []

# The task resources.
resources = {
    cpu    = 300
    memory = 256
  }
NameTypeDefaultDescription
job_name string
"rustpad"
The name of the Nomad job.
namespace string
"default"
The Nomad namespace to deploy into.
datacenters list
["*"]
The datacenters to deploy to.
image string
"ekzhang/rustpad:latest"
The Rustpad container image. Pin a tag in production.
port number
3030
Host port for the Rustpad web UI.
data_volume string
"rustpad_data"
Named volume mounted at /data (SQLite persistence for documents).
expiry_days number
1
Days a document is kept after its last edit before garbage collection (EXPIRY_DAYS).
constraints list
[]
Placement constraints. On a nomploy cluster: attribute = "$${meta.nomploy_control_plane}", operator = "=", value = "true".
resources object
{
    cpu    = 300
    memory = 256
  }
The task resources.
Back up this pack

This pack stores data in one Docker named volume: rustpad_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/rustpad_data/_data

rclone (sync to S3/R2)

rclone sync /var/lib/docker/volumes/rustpad_data/_data backup:<bucket>/rustpad_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

rustpad

Rustpad — a small, fast collaborative text editor. Open a link and several people edit the same document together in real time, with live cursors — no account needed. Great for quick shared notes, pair-coding scratchpads and interviews.

Single host-networked Nomad service. This pack enables SQLite persistence so documents survive restarts.

Deploy

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

Configure

Variable Default Description
port 3030 Web UI port (PORT).
expiry_days 1 Days a document is kept after its last edit before garbage collection (EXPIRY_DAYS).
image ekzhang/rustpad:latest Container image. Pin a tag in production.
data_volume rustpad_data /data — SQLite persistence (SQLITE_URI=/data/rustpad.db).
resources { cpu = 300, memory = 256 } Task resources. Rustpad is very lightweight.

Documents are addressed by the URL fragment (e.g. /#my-doc) — anyone with the link can edit, so put Rustpad behind an authenticating reverse proxy if it shouldn't be public. Pin the job to the node holding the volume with constraints. Raise expiry_days to keep pads around longer.