MetaList
A minimalist single-user note-taking app focused on server-side rendering (SSR), fast in-memory tree operations, and efficient sync/diff updates.
Features
- Rich text editing (ContentEditable) with image support
- Drag-and-drop note reordering
- Real-time content saving
- Keyboard shortcuts / cheatsheet (press
?in the app) - Linked-list ordering model for efficient reorders
- Optional password protection + encryption at rest (AES-GCM)
- Multi-tab search contexts with server-persisted scroll/search state (survives browser restarts)
- Manual namespace backups/restores to a user-selected backup folder with retention controls
Changes
What changed in each release: CHANGELOG.md.
Technology Stack
Backend
- FastAPI
- SQLite (via stdlib
sqlite3) with a guard-aware wrapper (SafeSession) - Mako templates for SSR
Frontend
- Vanilla JavaScript (no framework)
- HTML5 Drag and Drop API
- ContentEditable for rich text editing
- CSS custom properties for theming
Testing
- Python/unit tests plus manual regression passes
Architecture (High Level)
- Server renders the base page via Mako templates.
- The browser client drives interaction via
/api2JSON endpoints. - Passwordless notes load into memory at startup; encrypted notes load after login. Rendering/search and ordinary authentication use memory; a read guard restricts intentional SQLite access to explicit windows.
Security Boundary
Password protection encrypts namespace data at rest. While a namespace is unlocked, the server must hold its data-encryption key and decrypted working data in process memory, and the browser holds the decrypted content currently rendered in the page. A sufficiently privileged local process, debugger, administrator, browser extension, or process-memory dump can therefore expose an unlocked namespace.
Explicit logout removes the live key and purges decrypted runtime stores, but it cannot guarantee forensic overwriting of memory previously allocated by the Python or browser runtimes. Protect the host account and operating system, and see the detailed security architecture and threat model.
Development
Setup
For a published one-off run with uv:
uvx metalist
For a persistent uv tool install:
uv tool install metalist
metalist
For a persistent uv installation, you can update from inside MetaList: type update in the menu, open Version Info, and choose Update to … when a newer release is available. Each browser load or refresh asks the server to check PyPI asynchronously. A reminder-style notice links to Version Info the first time a newer version is discovered; the announced version is remembered in that namespace's client preferences. A slow or failed check does not block the app. Version Info can retry a failed check.
The in-app updater checks the selected release, creates verified backups, and restarts every namespace. Keep Version Info open to follow progress and reload when ready; closing and reopening it in the same page resumes progress. Signing in again may be necessary. Source checkouts and unmanaged installations still check for releases, but show why in-app installation is unavailable. Update job records and logs live under ~/MetaList/update-jobs/ (or the configured data directory). If installation/restart fails after servers stop, inspect the updater output and run metalist on the server to restart it; there is no automatic rollback.
You can also update and restart MetaList with one cross-platform command:
metalist update
The updater checks the installed version against the latest PyPI release first. If MetaList is already current, it reports the installed version and leaves all running namespaces untouched. When an update is available, it checks installer prerequisites and uses uv to install the candidate into a disposable tool environment with the current base Python interpreter. It checks dependencies and starts a temporary namespace to verify HTTP readiness, version, and runtime assets. A failed preflight leaves the current installation and running namespaces unchanged. After preflight succeeds, it stops running namespaces, and creates and verifies a new backup of every namespace before installation can begin. Each archive includes the complete notes/settings database, the attachments database when present, and any legacy search-history database. Locked namespaces are backed up with their encrypted data and key metadata intact, without requiring a password.
MetaList downloads its own checksum-verified uv 0.12.17 archive for the current operating system, architecture, and Linux C library. The verified archive and extracted executable are stored in the operating system's user cache; every update verifies the archive against its pinned upstream SHA-256 and the executable against the verified archive before use. That same executable performs both preflight and final installation. MetaList does not execute or replace the user's global uv. Download, verification, platform-selection, or version failures occur before any namespace is stopped. Already-installed releases retain their own updater code; the standalone repair launcher described in recovery supplies this managed installer to an older Windows updater.
Backups are saved to ~/MetaList/namespaces/<namespace>/backups/<namespace>-<timestamp>.metalist-backup.tar.gz; the updater prints each verified path. Existing backups remain unchanged. Each vault keeps its newest 3 of these safety backups: once the updated MetaList has restarted, older ones are removed. If any backup fails, the update aborts with the current installation intact; run metalist to restart the stopped servers after resolving the failure.
Only after all backups pass does the updater hand off to an external PowerShell process on Windows or /bin/sh on macOS/Linux so the installed environment can unlock. It delegates installation to uv, pinning the current base interpreter and the exact tested package/dependency versions, using the cache populated during preflight with network access disabled. It then launches MetaList again, and reports the installed version (for example, MetaList updated to v0.5.0.). This protection requires an installed version containing the backup safeguard and applies to metalist update and the in-app update action; direct pip/uv install commands do not run it.
For pip, users can run pip install metalist. For a non-editable local install from this checkout, use uv pip install . or pip install . instead of the editable command below.
python3 -m venv .venv
source .venv/bin/activate
python -m pip install --require-hashes -r requirements/ci.txt
python -m pip install --no-deps --no-build-isolation -e ".[dev]"
npm install
On Windows, create the same .venv with python -m venv .venv and activate it with .venv\Scripts\Activate.ps1 in PowerShell. Run the same python -m pip commands after activation. Node dependencies are developer tooling; the application itself does not require Node.
Run
Persistent data defaults to ~/MetaList. Set METALIST_DATA_DIRECTORY to an absolute directory path before launch to use a separate data root, including namespaces, backups, certificates, logs, and runtime jobs. This is used by release tests to keep their disposable data separate from real notes.
The installed entrypoint starts or restarts every known namespace, prints their URLs, and exits:
metalist
For source-checkout compatibility, python main.py performs the same orchestration. Use metalist work, python main.py --namespace work, or python main.py work when you want one foreground namespace process.
Shell execution is disabled by default. To enable @shell for every namespace
started by the top-level orchestrator, use either:
metalist --enable-shell
python main.py --enable-shell
This flag is propagated to every namespace child process. The top-level process
prints a conspicuous shell-enabled banner before its namespace launch results.
Use python main.py work --enable-shell for one foreground namespace. Shell
routes remain restricted to loopback clients using a loopback request host,
even when the rest of MetaList is intentionally exposed to a LAN.
A vault listens on loopback (127.0.0.1) until you share it: tick its Shared box in Manage Vault Ports. This keeps a normal laptop launch off LAN and public interfaces until you choose otherwise, vault by vault.
On first startup, MetaList also auto-generates a self-signed TLS pair at ~/MetaList/certs/metalist-cert.pem and ~/MetaList/certs/metalist-key.pem, then enables HTTPS on the same bind host at port 8443. The certificate is valid 825 days (Apple's limit); a start within 30 days of its end, or one that finds the pair unreadable, replaces it with a new pair, after which devices that trusted the old one warn once or need the new one installed. If you already have real PEM files, point METALIST_TLS_CERT and METALIST_TLS_KEY at them instead. Set METALIST_AUTO_GENERATE_TLS=0 only if you explicitly want HTTP-only startup.
Database selection:
- No explicit namespace on a single-namespace launch:
~/MetaList/namespaces/default/default.metalist.db --namespace workorMETALIST_NAMESPACE=work:~/MetaList/namespaces/work/work.metalist.db- Files sit beside the notes database:
namespaces/work/files/catalog.dbnames them andnamespaces/work/files/blobs/holds one file per stored item - Remembered launch ports, and whether the vault is shared on the network, are stored as plaintext metadata inside each namespace's main
*.metalist.db - Launch precedence is: explicit CLI flags > env vars > saved namespace profile; if a namespace has no saved profile, launch it once with explicit ports or configure ports from the UI
- Backups stay beside the namespace data under
~/MetaList/namespaces/work/backups/and use one archive per snapshot with filenames likework-<timestamp>.metalist-backup.tar.gz - The Backup Settings modal targets one user-selected backup folder and can include multiple namespaces in a single run
- Restoring
workintoworkis the normal overwrite path; importing a backup under a different namespace name can create a new target namespace with automatically selected conflict-free ports.
Useful env flags:
CRASH_SERVER_ON_FAIL=1(default): fail-fast on validation errorsAPI_PREFIX=/api2: override API prefix (client assumes/api2by default)METALIST_NAMESPACE=work: select~/MetaList/namespaces/work/work.metalist.dbMETALIST_ALLOWED_HOSTS=notes.example.com: comma-separated names reached through a proxy, accepted in HTTPHostheaders; loopback names are always accepted, and a shared vault also accepts this computer's own names and addressesMETALIST_PORT=8000(default): bind the main app to a different portMETALIST_HTTPS_PORT=8443: override the HTTPS port when TLS is enabledMETALIST_TLS_CERT=/path/to/fullchain.pem+METALIST_TLS_KEY=/path/to/privkey.pem: override TLS pathsMETALIST_AUTO_GENERATE_TLS=0: disable automatic creation of the default self-signed TLS pair- default TLS paths:
~/MetaList/certs/metalist-cert.pemand~/MetaList/certs/metalist-key.pem METALIST_FORWARDED_ALLOW_IPS=127.0.0.1,::1(default): trust proxy headers only from those reverse-proxy IPs--enable-shell: opt in to local@shellexecution for this launch; shell routes require a loopback client and loopback request host, and the capability is never persisted in namespace data
Remote Access / HTTPS
Open Manage Vault Ports (Cmd/Ctrl+/, then "Manage Vault Ports…"), tick Shared for each vault other computers may open, and save. The vault restarts at once and listens on the network; untick it to take it back. Other computers open https://<this computer's name>.local:<the vault's HTTPS port> or https://<its address>:<port>. A shared vault accepts this computer's own names and addresses as they are now, so nothing needs changing when the router gives it a new address.
Another computer sees only the vault it is in and the shared ones: a vault not shared does not appear on its login page or in its lists, and it cannot open one.
METALIST_HOST is retired: MetaList refuses to start while it is set. The first start after updating converts a ~/MetaList/network-settings.json left by an older MetaList: if it shared MetaList on the network, every vault becomes shared, and the file is removed.
@shell still runs only from the host laptop. With --enable-shell, use http://127.0.0.1:<namespace-http-port> there for shell notes; other devices opening a shared vault get the rest of MetaList, and their shell requests receive 403.
Namespaced launch example:
metalist --namespace work --port 8001
This starts a separate process backed by ~/MetaList/namespaces/work/work.metalist.db on http://127.0.0.1:8001.
Its backup snapshots live under ~/MetaList/namespaces/work/backups/ with filenames like work-<timestamp>.metalist-backup.tar.gz. New backups are versioned .tar.gz workspace archives; legacy .bak backups remain restorable.
After you launch a namespace once with explicit ports, MetaList remembers them in that namespace's main DB, so later you can use the shorthand:
metalist work
and MetaList will reuse the saved HTTP / HTTPS ports for work. The same applies to the default namespace: metalist will reuse the saved default-namespace profile.
If you already have a real certificate and key, point MetaList at them:
METALIST_TLS_CERT=/path/to/fullchain.pem \
METALIST_TLS_KEY=/path/to/privkey.pem \
metalist
If you want to rotate or regenerate the default self-signed pair manually, the helper script is still available:
generate-lan-cert.sh
When HTTPS is enabled:
- remote HTTP requests to
http://<laptop-ip>:8000are redirected to HTTPS - localhost HTTP requests still stay on plain
http://127.0.0.1:8000so the laptop can keep using the non-TLS port
If TLS is terminated by a reverse proxy on the same machine instead, leave the vault not shared (it listens on loopback) and let the proxy forward to it:
METALIST_ALLOWED_HOSTS=notes.example.com \
METALIST_PORT=8000 \
METALIST_FORWARDED_ALLOW_IPS=127.0.0.1,::1 \
metalist
The reverse proxy must preserve the browser-facing Host header and set
X-Forwarded-Proto. MetaList never trusts X-Forwarded-Host; forwarded
scheme/client metadata is accepted only from METALIST_FORWARDED_ALLOW_IPS.
Do not widen that list beyond the actual proxy addresses.
Namespace startup allows 120 seconds per child, reports progress every five seconds, and stops/reaps a failed child instead of leaving it running after reporting failure. Set METALIST_STARTUP_TIMEOUT_SECONDS to a positive number of seconds to allow more time on a heavily loaded machine. A crashed child still fails immediately. This is a startup allowance, not a guarantee that any machine will finish within two minutes.
The preflight is a disposable empty namespace; it cannot guarantee startup against every real database or prevent a later disk/process failure. If installation succeeds but real namespace startup fails, the new package remains installed: resolve the reported startup issue and run metalist again. No automatic code/database rollback is attempted, and backups remain unchanged.
Publishing
For the real user-facing install flow:
uvx metalist
# or:
uv tool install metalist
metalist
This repo now packages itself under the PyPI distribution name metalist. Current releases support Python 3.11 through 3.14.
Recommended release path:
- In the existing PyPI project
metalist, configure GitHub Trusted Publishing formetalist-app/metalistand the workflow file.github/workflows/publish-pypi.yml. - Develop and review the candidate on a feature branch with focused checks. Merge it into
mainand pushmainonce. This runs the fullPublish to PyPIvalidation matrix for that exact commit. GitHub-hosted Windows, macOS, and Linux runners install the built wheel and test application startup outside the source checkout on the supported Python endpoints, 3.11 and 3.14. Every installed-package matrix job also exercises the realmetalist updatepath with uv, backups, interpreter preservation, and two-namespace restart against a local release index. The old-version fixture carries the candidate updater so this validates the mechanism being shipped; it does not retroactively fix older installed updaters. You do not need those operating systems locally. Archive verification checks runtime files, including agent Markdown resources, against both the wheel and source distribution. - Wait for the exact-commit main release matrix to pass, then run
.venv/bin/python scripts/release.py X.Y.Zto create and push the tag. Any intervening change requires a new main validation run before tagging. - The tag job independently verifies every main-job conclusion and reuses the wheel and source distribution from that run for GitHub Trusted Publishing; it does not repeat the matrix. Manual dispatch cannot publish. The release driver compares PyPI hashes with the tested artifact and checks a clean public install. Users can then run it with
uvx metalist, install it persistently withuv tool install metalist, or install it withpip install metalist.
Run Tests
Python/unit test examples:
source .venv/bin/activate
.venv/bin/pytest
node --test tests/unit/*.mjs
.venv/bin/python -c "from pathlib import Path; import main; main._run_startup_sanity_gates(repo_root=Path.cwd())"
Source-checkout development launches can enable the mandatory Python and
JavaScript sanity gates with an ignored repository-root .env file:
METALIST_ENVIRONMENT=development
main.py prints the resolved environment at startup. An explicit process
environment value takes precedence over .env; only development and
production are accepted. When the variable and .env file are absent,
MetaList runs in production mode and skips the source sanity gates.
TEST_MODE=1 and POST /api2/test/reset still exist for deterministic browser automation if we decide to add a new harness later, but Cypress is not part of the current workflow.
Diagrams
Render Mermaid diagrams to PNGs:
npm run render-diagrams
Maintenance and recovery
See the dependency and release procedure, recovery runbook, and current test/implementation map. The dated August code review is historical.
Metadata
Release files for metalist 0.34.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| metalist-0.34.0.tar.gz | 7.6 MB | With provenance | Details for metalist-0.34.0.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| metalist-0.34.0-py3-none-any.whl | Python 3 | none | any | Details for metalist-0.34.0-py3-none-any.whl |
Total release size: 15.5 MB
Release files / metalist-0.34.0.tar.gz
| Download URL | metalist-0.34.0.tar.gz |
|---|---|
| Size | 7.6 MB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
eb538f1823efafd861ce85489b2a20dbc164dd573f567c1fb9a387f42edbe0fd
|
|
BLAKE2b-256 checksum How to use checksums |
f0d3241d65631f4e14fedcea9579062934a4a1c13f3c43e0d24bfaf44c4211cb
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Nov 22, 2026.
Transparency logRelease files / metalist-0.34.0-py3-none-any.whl
| Download URL | metalist-0.34.0-py3-none-any.whl |
|---|---|
| Size | 7.9 MB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
f7f49ea301ff4f6d78ef70e5d212d45fe550a5f94395a64d6cbc7ec6353db94b
|
|
BLAKE2b-256 checksum How to use checksums |
225288258e625af22d32fd29ec08ecce009cb0fe159aa6cfc313d0836a03ce78
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Nov 22, 2026.
Transparency logSecurity for metalist 0.34.0
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
Full provenance
Both files in this release have been uploaded with provenance metadata.
Attestation for metalist-0.34.0.tar.gz
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Nov 22, 2026.
Transparency logA note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.