ByteStash — a self-hosted place to store, organise and share your code snippets, with syntax highlighting, tags, search, versions and sharing. Deployed as a single host-networked Nomad service (SQLite).
Needs nomad-pack on PATH. The script only adds the nomploy registry and runs this pack.
Source ↗ Project ↗ ★ 2.5k ⚑ Report an issue
Save as values.hcl, edit, then run:
# The name of the Nomad job.
job_name = "bytestash"
# The Nomad namespace to deploy into.
namespace = "default"
# The datacenters to deploy to.
datacenters = ["*"]
# The ByteStash container image. Pin a tag in production.
image = "ghcr.io/jordan-dalby/bytestash:latest"
# Host port for the ByteStash web UI.
port = 5000
# Secret used to sign auth tokens. CHANGE THIS to a long random value.
jwt_secret = "change_me_to_a_long_random_jwt_secret_0000"
# Allow registration of new accounts (true/false).
allow_new_accounts = "true"
# Named volume for the SQLite database and snippets (/data/snippets).
data_volume = "bytestash_data"
# Placement constraints. On a nomploy cluster: attribute = "$${meta.nomploy_control_plane}", operator = "=", value = "true".
constraints = []
# The task resources.
resources = {
cpu = 200
memory = 256
}
| Name | Type | Default | Description |
|---|---|---|---|
| job_name | string | "bytestash" | The name of the Nomad job. |
| namespace | string | "default" | The Nomad namespace to deploy into. |
| datacenters | list | ["*"] | The datacenters to deploy to. |
| image | string | "ghcr.io/jordan-dalby/bytestash:latest" | The ByteStash container image. Pin a tag in production. |
| port | number | 5000 | Host port for the ByteStash web UI. |
| jwt_secret set me | string | "change_me_to_a_long_random_jwt_secret_0000" | Secret used to sign auth tokens. CHANGE THIS to a long random value. |
| allow_new_accounts | string | "true" | Allow registration of new accounts (true/false). |
| data_volume | string | "bytestash_data" | Named volume for the SQLite database and snippets (/data/snippets). |
| constraints | list | [] | Placement constraints. On a nomploy cluster: attribute = "$${meta.nomploy_control_plane}", operator = "=", value = "true". |
| resources | object | {
cpu = 200
memory = 256
} | The task resources. |
No variables match.
This pack stores data in one Docker named volume:
bytestash_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/bytestash_data/_data
rclone (sync to S3/R2)
rclone sync /var/lib/docker/volumes/bytestash_data/_data backup:<bucket>/bytestash_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.
ByteStash is a self-hosted app for storing, organising and sharing your code snippets. It offers syntax highlighting for many languages, tags and full-text search, version history, public/private sharing links, and a clean, fast UI — a tidy home for all those snippets you keep losing in chat and gists.
This pack runs ByteStash as a single host-networked Nomad service backed by SQLite.
nomad-pack run bytestash --registry=nomploy \
--var jwt_secret=$(openssl rand -hex 24)
Open http://<node-ip>:5000 and register the first account.
| Variable | Default | Description |
|---|---|---|
image |
ghcr.io/jordan-dalby/bytestash:latest |
Container image (pin a tag). |
port |
5000 |
Host port for the web UI. |
jwt_secret |
placeholder | Auth-token secret — change this. |
allow_new_accounts |
true |
Allow new account registration. |
data_volume |
bytestash_data |
Volume for the DB and snippets (/data/snippets). |
resources |
200 MHz / 256 MB | CPU and memory for the task. |
Snippets and the SQLite database persist in data_volume. Set
allow_new_accounts=false once your users are registered.