Files
tandClaude Opus 5.5 335a4a9c0c
ci / test-guard (pull_request) Successful in 3s
ci / go (pull_request) Successful in 3m26s
ci / package (pull_request) Successful in 2m18s
ci / install-test (debian:12) (pull_request) Successful in 1m12s
ci / install-test (debian:13) (pull_request) Successful in 1m28s
ci / smb (pull_request) Successful in 1m35s
ci / e2e (pull_request) Successful in 3m3s
Change history retention (F-HIS-12) and a privacy page (GDPR)
The change journal and the config backups grew forever: every entry holds
the full content of the changed files, and every change left a backup copy.
The history also holds personal data (who changed what, user names), which
the GDPR's storage limitation says not to keep longer than needed.

Retention, owner's decision 2026-11-30:
- Entries older than 365 days go, and of the rest at most the newest 1,000
  stay (whichever is reached first). Both values are app settings: System
  page, PUT /api/v1/settings/app (history_days 7–3650, history_entries
  50–100000) or settings.json; out-of-range values in the file fall back to
  the defaults, never to "keep forever".
- Applied at start, once a day, and right away when the setting changes.
  The journal is rewritten atomically (temp file + rename), so a crash leaves
  the old or the new file; unreadable lines, already ignored, are dropped.
- Backups older than the oldest kept entry go; the newest 10 per file always
  stay. Backup names now carry a UTC timestamp, so writing and reading them
  agree in every time zone.
- What a trim removed is itself an audit entry; the setting change too.
- The Changes page says how long the history is kept and how far back it
  goes (GET /api/v1/changes → kept).

Privacy: docs/privacy.md lists what personal data Sharestead keeps, where,
for how long and how to delete it (incl. when someone leaves), and that it
sends nothing anywhere. N-17 in the requirements; README links to it.
03-solution-design: retention row added; the user/group undo row now says
audit only (F-HIS-8 was dropped).

Tests: retention rules (changes, 98%), journal and backup trimming on real
files incl. undo after a trim and unrelated files kept (configstore),
settings defaults and fallback, API (defaults, trim on change, bounds,
history entries); e2e on CT 151 (desktop + phone), axe unchanged. Checked on
CT 151: history_entries 50 trimmed 286 → 51 entries and 43 → 26 backups,
journal still 0600. Coverage minimums raised (total 77, server 85, auth 95).

Test changed because: web/e2e/fixtures/base.json is a recorded API answer
that fixtures_test.go checks against the API description; GET
/api/v1/settings/app and GET /api/v1/changes now have the required fields
history_days/history_entries and kept. Only those fields were added (two
existing lines got a trailing comma); no expectation changed.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-30 19:30:21 +01:00

5.4 KiB

Sharestead

A web UI for file sharing on a Debian system: shares over SMB and NFS, users and groups, who may read or write, storage limits, and the services that make the NAS visible on the network. For homes and small to medium offices that want a NAS they understand, without a NAS operating system.

Sharestead edits the normal system files (smb.conf, /etc/exports, …). They stay the source of truth: changes made by hand keep working and show up in the UI.

Status: early development, no release yet (first release: 0.1.0). Not for production data yet.

What it does

Area What you can do
Shares Create a share from a new or existing folder, over SMB, NFS or both. Access per user and group: No access, Read, Read & write. Every change is shown as a preview of the config files before it is applied. The share page says in plain words who can do what, and what each protocol does and doesn't check
Folders inside a share Give a subfolder its own access, e.g. Finances only for the owners. Needs POSIX ACLs on the storage (see system requirements)
Users and groups Create, disable and delete accounts; one password for the shares and the web UI; bulk actions. Users can change their own password on My account (can be switched off)
Personal folders One private folder per user, created with the account
Storage Disk usage per storage folder and share. Limits for personal folders and shares: hard limits set in the filesystem are shown; where none are possible, Sharestead keeps a soft limit (read-only over SMB when full)
Change history Every change with who, when and the exact lines changed, including changes made by hand. Undo a single change or go back to a point in time
Services Switch SMB, NFS, Windows and Mac discovery, NetBIOS and DLNA on or off; it shows first what stops working. See which devices are connected
Problems Checks of the configuration and the system, each with cause and fix. Missing system features (e.g. no ACLs in a container) are explained once and can be acknowledged. Diagnostic bundle for bug reports, with passwords removed
API Everything the UI does, as a REST API described in OpenAPI 3.1 (API page in the UI)

What personal data Sharestead keeps, for how long, and how to delete it: privacy.

Sharestead deliberately doesn't manage disks, RAID or ZFS pools, run apps or VMs, or act as an Active Directory domain controller — see what we won't do.

Requirements

System Debian 12 or 13, or Raspberry Pi OS 64-bit; amd64 or arm64
Where a VM (recommended), bare metal, or an LXC container
Memory about 512 MB for a small setup
Network clients reach 445/tcp (SMB) and 8443/tcp (web UI)

Some features need more from the system: POSIX ACLs for folder permissions, a VM or privileged container for NFS, the filesystem's own quotas for hard limits. Sharestead checks this itself and greys out what can't work, with the reason. Details: system requirements.

Install

There is no package repository for releases yet. Until 0.1.0, take the .deb from a CI run (artifact deb-packages) or build it yourself (see Development).

# on the Debian system (root)
DEB=./sharestead_*_amd64.deb
apt-get install -y "$DEB"          # pulls in samba, smbclient, acl

✅ Check: the installer prints the address, e.g. https://192.168.0.20:8443.

Log in with a Linux user that is in the group sharestead-admins:

# on the Debian system (root)
ADMIN=alex
id "$ADMIN" >/dev/null 2>&1 || adduser --shell /usr/sbin/nologin "$ADMIN"   # asks for a password; no shell login
usermod -aG sharestead-admins "$ADMIN"

✅ Check: open the address in a browser, accept the self-signed certificate, log in as that user.

The web UI is meant for the local network. Don't make port 8443 reachable from the internet.

Development

Contributor rules and the test setup: AGENTS.md. Design and requirements: docs/planning/.

(cd web && npm ci && npm run build)   # web UI → embedded into the binary
go test -race -cover ./...            # unit and API tests (needs gcc + libpam0g-dev: PAM via cgo)
(cd web && npm run check && npm test) # UI type check + unit tests
(cd web && SST_BACKEND=https://192.168.0.157:8443 npm run dev)  # UI dev server against a test system
scripts/build-packages.sh             # .deb packages into dist/
Path What
cmd/sharestead, internal/server the binary: HTTPS server (self-signed certificate on first start), REST API with OpenAPI 3.1 description
internal/format/ lossless readers/writers for smb.conf, /etc/exports, nfs.conf, minidlna.conf: edits touch only their lines
internal/domain/ the rules: share access ↔ Samba parameters, POSIX ACLs, quotas, accounts
internal/app/ use cases: shares, accounts, folders, subfolder permissions, quotas, services, change history, problems
internal/adapters/ the system: PAM, config store with journal, ACLs on disk, systemd, usage scan
web/ web UI (Svelte 5 + TypeScript, Vite), built into internal/webui/dist and embedded
packaging/, scripts/build-packages.sh .deb for amd64 and arm64 with systemd unit

Licence

GPL-3.0. Copyright © 2026 Nico Störzbach.