Notefix Docs See the demo site

Share notes with your team

The store keeps notes on your server, so everyone who opens the page sees the same notes, as they are written. It is two small files that need only Python, or one Docker container. Plan on ten minutes.

Before you start#

You need:

Careful

There are no logins yet. Anyone who can open the page can read and write every note on it. Put Notefix only on pages that are already private: a staging site behind a password, a VPN or an internal network. Never on a public production page.

1Start the store

Pick one.

With Python, from the unzipped download:

sh
NOTES_DATA=/var/lib/notefix NOTES_BOARDS=staging python3 server/server.py

With Docker:

sh
docker build -t notefix-store server/
docker run -d --name notefix --restart unless-stopped \
  -p 127.0.0.1:8097:8097 \
  -e NOTES_BOARDS=staging \
  -v notefix-data:/data \
  notefix-store

Either way it prints a line like notefix store on :8097 and is now listening on port 8097, on this machine only.

Careful

With Docker, the -v notefix-data:/data part keeps your notes when the container is replaced. Leave it out and removing the container removes every note.

2Put it at a path on your site

Browsers only let the page talk to its own site, so the store has to appear at a path on the same address, for example https://staging.acme.com/notefix-api/. Add this to your web server:

nginx

nginx
location /notefix-api/ {
    proxy_pass http://127.0.0.1:8097/;
    proxy_set_header Host $host;
}

Caddy

handle_path /notefix-api/* {
    reverse_proxy 127.0.0.1:8097
}

Apache

apache
ProxyPass        /notefix-api/ http://127.0.0.1:8097/
ProxyPassReverse /notefix-api/ http://127.0.0.1:8097/

Keep the trailing slashes exactly as shown. Then check it: opening https://your-site.com/notefix-api/health should show {"ok": true, ...}.

3Point the tag at it

Add data-api to the line on your page:

html
<script src="/notefix/notefix-embed.js"
        data-project="Acme staging"
        data-api="/notefix-api"
        data-board="staging"></script>

4Check it with two browsers

Open the page in two different browsers, or one normal window and one private window. Leave a note in one. Within ten seconds it appears in the other.

That's it. Your team now shares notes.

Boards#

A board is one set of notes. Use one per site or project under review, so a checkout redesign and the marketing site do not share a list.

Most teams set data-board once in their layout, so every page of the site shares one board.

Keep it running#

With Docker, --restart unless-stopped already does this. With Python, run it as a service. On Linux with systemd:

ini
# /etc/systemd/system/notefix.service
[Unit]
Description=Notefix store
After=network.target

[Service]
User=notefix
Environment=NOTES_DATA=/var/lib/notefix
Environment=NOTES_BOARDS=staging
ExecStart=/usr/bin/python3 /opt/notefix/server/server.py
Restart=always

[Install]
WantedBy=multi-user.target
sh
sudo systemctl enable --now notefix

Back it up#

Take a backup while the store is running:

sh
# Python
NOTES_DATA=/var/lib/notefix python3 server/server.py backup /backups/notefix-$(date +%F).db

# Docker
docker exec notefix python3 server.py backup /data/backup-$(date +%F).db

This makes one complete, consistent file. Run it every night from cron and keep a few days of copies.

Careful

Do not copy notefix.db with cp while the store is running. The live database is spread over three files and a copy taken mid-write may not open.

To restore: stop the store, put the backup in NOTES_DATA as notefix.db (removing any notefix.db-wal and notefix.db-shm beside it), and start the store.

Upgrading#

  1. Take a backup.
  2. Replace the notefix/ folder on your site and the server/ folder on your server (or rebuild the Docker image).
  3. Restart the store.

The store updates its database by itself when it starts. It will not start on a database written by a newer version, so an accidental downgrade cannot damage your notes.

Coming from a version that kept notes in JSON files? Nothing to do: the first start imports every board, says so in its log, and leaves the old files where they were. Once you have checked your notes, you can delete them.

Next#