cmd/librenotes/serve.go wires the multi-tenant HTTP server: storage + auth + httpapi packages, configurable via flags or LIBRENOTES_* env vars. Embeds web/public/ for unauthenticated static content. Generates an ephemeral JWT secret with a warning when none is supplied. Adds security headers (CSP, nosniff, DENY-frame, no-referrer) on every response. Background goroutine purges expired magic-link tokens every 10 minutes. cmd/librenotes/web/public/ provides the unauthenticated frontend: - index.html: hero, features grid, fork attribution, footer. Mobile-first, responsive from 320px up via clamp() and auto-fit grid. SEO + Open Graph tags. No JS dependency. - privacy.html: placeholder privacy policy (full text TBD). - style.css: shared design tokens (light/dark via [data-theme]), used by landing, auth pages, and the post-login app shell. - favicon.svg: minimal mark. The "serve" command sits alongside the original notesium CLI verbs; main.go dispatches "serve" to the new code path and forwards everything else to notesium.Run(). Closes #16. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
librenotes
Cloud-native, multi-tenant notes application. A fork of Notesium extended with authentication, per-user data isolation, sync, and PWA support so it can run as a hosted service at librenot.es.
Features
- Markdown notes with bi-directional links (Zettelkasten / evergreen notes)
- Embedded web app — no Electron, no Node runtime, single static binary
- Multi-tenant backend with magic-link authentication (in development)
- Offline-capable PWA with background sync (planned, Phase 4)
Build
Requires Go 1.20 or later.
go build ./cmd/librenotes
This produces a librenotes binary in the current directory. The web
frontend and shell completion are embedded into the binary at compile
time, so no extra files are needed at runtime.
A Makefile with build, test, run, and clean targets is provided
for convenience:
make build
make test
Run
./librenotes web --notes-dir ~/notes
See ./librenotes help for the full command list.
Development setup
A Nix flake provides a reproducible development environment with Go,
build tools, and the project CLIs. Use the plain dev shell for a
non-sandboxed Go toolchain:
nix develop .#dev
Alternatively, build a Docker-based dev environment:
docker build -f Dockerfile.dev -t librenotes-dev .
docker run --rm -it -v "$PWD:/workspace" librenotes-dev
The repository layout follows the standard Go project structure:
cmd/librenotes/ Binary entry point
internal/notesium/ Core notes package (forked from Notesium)
internal/notesium/web/ Embedded frontend assets
The Go module path is git.librete.ch/public/librenotes.
Fork attribution
librenotes is a fork of Notesium by Alon Swartz, used and redistributed under the MIT License. See NOTICE for the upstream commit hash at fork time and instructions for tracking upstream changes.
License
MIT — see LICENSE. Copyright is shared between the original Notesium author and the librenotes contributors.