Files
narl-workspace/.env.example
T
nvrl 49b2056215 feat: spaces, folder import, boards and mail; rename to narl-workspace
The diary grows into a workspace: a flat list of dated entries becomes a
tree of spaces, and the app is renamed to match what it now is.

Spaces and nodes
  One recursive `nodes` table replaces `entries`: a space is a root node,
  and folders and documents nest under it without limit. Entries keep
  their ids through the migration, so share tokens, media links and the
  drafts in localStorage all still resolve.

Folder import
  A folder or a zip is uploaded as a document tree. Markdown becomes
  documents titled from their first heading, everything else becomes
  media, and relative links between the imported files are rewritten to
  the paths they landed at, so a set of cross-linked notes stays
  navigable after the upload.

Boards
  A kanban board per space, with the space as the board: lists, cards,
  due dates and an optional link to a document. `diary` has none.

Mail
  SMTP notifications through an outbox. A mail is enqueued under a key
  naming the occurrence it belongs to, so a restart cannot resend and a
  relay that refuses is retried with a widening backoff. Four kinds: the
  diary reminder, cards due and overdue, a weekly digest, and logins
  from a browser that has not been seen before or a burst of failures.
  All of it is dormant until WORKSPACE_SMTP_URL is set.

Rename
  Everything user-visible says workspace; everything that already exists
  outside this repo keeps its name, because renaming it would break a
  running deployment for tidiness alone: the database file, the docker
  volume, the session cookie, the Proton device, the keyring entry and
  the localStorage keys. Configuration reads WORKSPACE_* first and falls
  back to DIARY_*, so the deployed .env keeps working untouched.
2026-09-18 14:53:22 +02:00

77 lines
2.9 KiB
Bash

# Every setting is read as WORKSPACE_<NAME>. The old DIARY_<NAME> spelling is
# still accepted, so a deployment configured before the rename keeps running.
# The one and only account. Both are checked in constant time on login.
WORKSPACE_USER=narl
WORKSPACE_PASSWORD=change-me
# Signs session cookies. Rotate it to log every device out. 32+ random chars.
# Generate one with: openssl rand -base64 32
WORKSPACE_SECRET=replace-with-32-random-characters
# Where the SQLite database and uploaded media live.
WORKSPACE_DATA_DIR=./data
# Address to listen on. Put a TLS terminating reverse proxy in front of this.
WORKSPACE_BIND=127.0.0.1:4242
# How long a login lasts, in days.
WORKSPACE_SESSION_DAYS=30
# Largest single upload, in megabytes.
WORKSPACE_MAX_UPLOAD_MB=64
# Set to 1 once the app is served over HTTPS, so the cookie gets `Secure`.
WORKSPACE_SECURE_COOKIE=0
# --- Proton Drive backup -----------------------------------------------------
# Off until `narl-workspace proton-login` stores a session under WORKSPACE_DATA_DIR.
# These only shape how often the mirror runs.
# The device the server registers in Proton Drive; its sync root is the folder
# the diary is mirrored into.
WORKSPACE_PROTON_DEVICE=narl-workspace
# Backstop between runs, in minutes. 0 leaves it change-driven only.
WORKSPACE_BACKUP_INTERVAL_MIN=60
# How long the diary must be quiet after a change before it is mirrored, so a
# writing session uploads once rather than after every save.
WORKSPACE_BACKUP_DEBOUNCE_SEC=300
# Set to 1 to let a deletion here trash the mirrored file there. Off by
# default: a backup that forgets on command is one accident from being none.
WORKSPACE_BACKUP_PRUNE=0
# --- Notification mail -------------------------------------------------------
# Off until WORKSPACE_SMTP_URL is set. Nothing is even queued while it is unset.
# The relay. `smtps://host:465` is implicit TLS, `smtp://host:587?tls=required`
# is STARTTLS, and a bare `smtp://host:1025` is plain — which only belongs on a
# local mail catcher. Credentials may live in the URL or in the two variables
# below.
# WORKSPACE_SMTP_URL=smtps://mail.example.org:465
# WORKSPACE_SMTP_USER=
# WORKSPACE_SMTP_PASSWORD=
# Where the mail comes from and goes to. FROM defaults to TO.
# WORKSPACE_MAIL_FROM=workspace@example.org
# WORKSPACE_MAIL_TO=you@example.org
# "Did I write today?" and "is this due today?" are local-day questions, and the
# answer changes with the timezone rather than with a fixed offset.
WORKSPACE_TIMEZONE=Europe/Berlin
# When to ask about the diary, if nothing was written in it that day. `off`
# turns it into no reminder at all.
WORKSPACE_REMINDER_AT=20:00
# When to mail about cards that are due today or already overdue.
WORKSPACE_CARD_DUE_AT=08:00
# Weekday and time of the weekly digest.
WORKSPACE_DIGEST_AT=sun 18:00
# Which of the four kinds may be sent. Drop one from the list to switch it off.
WORKSPACE_MAIL_KINDS=reminder,card_due,digest,login