Notefix Docs See the demo site

Run your own Notefix server

Notefix Self-hosted is the same server as Notefix Cloud, on your own machine: accounts, projects, the dashboard, connections and email. Your notes never leave your server. Plan on twenty minutes, most of it email and your web server's settings.

Before you start#

You need:

1Start it

With Docker:

sh
docker build -t notefix server/
docker run -d --name notefix --restart unless-stopped \
  -p 127.0.0.1:8097:8097 \
  -v notefix-data:/data \
  --env-file /etc/notefix.env \
  notefix

With Python, from the unzipped download in /opt/notefix, as a systemd service that reads the same file:

ini
# /etc/systemd/system/notefix.service
[Service]
EnvironmentFile=/etc/notefix.env
Environment=NOTES_DATA=/var/lib/notefix
ExecStart=/usr/bin/python3 /opt/notefix/server/server.py
Restart=always
User=notefix

[Install]
WantedBy=multi-user.target

/etc/notefix.env holds the settings below, one NAME=value per line. Keep it readable only by root: it has your mail password in it.

sh
NOTEFIX_PUBLIC_URL=https://notes.acme.com
NOTEFIX_EMAIL_FROM=Notefix <[email protected]>
NOTEFIX_SMTP_HOST=smtp.acme.com
[email protected]
NOTEFIX_SMTP_PASSWORD=...
Careful

The data folder is your notes, and vault.key in it unlocks your saved connections. Back up both. A backup of the database without the key keeps every note, but each connection has to be connected again.

2Put HTTPS in front

Point your web server at port 8097, on the whole address:

nginx
server {
    server_name notes.acme.com;
    location / {
        proxy_pass http://127.0.0.1:8097;
        proxy_set_header Host $host;
        proxy_set_header X-Forwarded-For $remote_addr;
    }
}

Behind a proxy like this, also set NOTEFIX_TRUST_PROXY=1, so sign-in limits count each visitor, not the proxy.

3Sign in and make a project

Open https://notes.acme.com/app, sign in with your email, and follow Get started with Notefix Cloud from step 2. Your tag loads from your own server:

html
<script src="https://notes.acme.com/v1/notefix-embed.js"
        data-project="acme-website-k7f2q9" defer></script>
Note

Anybody who can reach /app can make an account and projects of their own. They cannot see anybody else's. To keep strangers out entirely, put /app behind your VPN or single sign-on proxy; your sites only need /v1/ and /api/.

One-click connecting#

Out of the box, owners connect GitHub, Jira, Trello and Slack by pasting a key, with a guide on each step. Register an app with a tool, give its details to the server, and that tool gets a Continue with button instead. Each is optional and separate.

Every callback address is your public address plus /app/oauth/ and the tool: https://notes.acme.com/app/oauth/github, and so on.

GitHub#

GitHub, Settings, Developer settings, GitHub Apps, New GitHub App:

Create it, then Generate a new client secret and Generate a private key.

Careful

The client secret is 40 characters of 0-9 and a-f, shown once. The value that starts with SHA256: beside the private key is the key's fingerprint, not a secret: with it in NOTEFIX_GITHUB_CLIENT_SECRET, GitHub refuses every sign-in.

One address per app. After somebody installs the app, GitHub sends them to the first callback URL in the list, whichever server they started from. Give each address its own app: one for notes.acme.com, another for a staging server. (To reorder the list anyway: delete the others, save, then add them back. Swapping two addresses in place is refused as already been taken.)

Check the app once the settings are in place. This asks GitHub about the app with its own key, and prints its name and permissions, which should include issues: write:

sh
python3 -c "import json,urllib.request,oauth; print(json.load(urllib.request.urlopen(urllib.request.Request('https://api.github.com/app', headers={'Authorization': 'Bearer ' + oauth.app_jwt(), 'User-Agent': 'notefix'}))))"

Run it from the server's folder, with the settings loaded.

sh
NOTEFIX_GITHUB_APP_ID=123456
NOTEFIX_GITHUB_APP_SLUG=acme-notefix          # from github.com/apps/acme-notefix
NOTEFIX_GITHUB_CLIENT_ID=Iv23li...
NOTEFIX_GITHUB_CLIENT_SECRET=...
NOTEFIX_GITHUB_APP_KEY=/data/github-app.pem   # the private key file

Jira#

developer.atlassian.com/console/myapps, Create, OAuth 2.0 integration:

sh
NOTEFIX_ATLASSIAN_CLIENT_ID=...
NOTEFIX_ATLASSIAN_CLIENT_SECRET=...

Trello#

trello.com/power-ups/admin, New. Under API key, generate one, and add https://notes.acme.com to Allowed origins.

sh
NOTEFIX_TRELLO_KEY=...

Slack#

api.slack.com/apps, Create New App, From scratch:

sh
NOTEFIX_SLACK_CLIENT_ID=...
NOTEFIX_SLACK_CLIENT_SECRET=...

Sign in with Google#

Out of the box, people sign in with an emailed link. Register a Google client and the sign-in page, and the window your sites open, also show Continue with Google. The emailed link stays.

In console.cloud.google.com, in a project of its own:

sh
NOTEFIX_GOOGLE_CLIENT_ID=....apps.googleusercontent.com
NOTEFIX_GOOGLE_CLIENT_SECRET=...

Google tells the server the person's name and email address, and signs in the account for that address, the same one an emailed link would. An address Google has not confirmed is not accepted.

Sign in with GitHub comes with the GitHub App: once it is set up, with Email addresses Read-only, Continue with GitHub appears beside Google. It signs in the account for the GitHub account's confirmed primary address. GitHub asks each person to authorise the app once, and after that sends them straight back.

Restart the server after changing any of these.

Settings#

Everything is optional except the address and mail.

SettingDefaultWhat it does
NOTEFIX_PUBLIC_URLnoneThe address people reach the server at. Links in emails use it. Required for sign-in from anywhere but the server itself
NOTES_DATA/dataThe folder for notefix.db, vault.key and the outbox
NOTES_PORT8097The port it listens on
NOTEFIX_EMAIL_FROMnoneWho email is from, like Notefix <[email protected]>
NOTEFIX_SMTP_HOSTnoneYour mail server. Without it, email is written to outbox/ in the data folder
NOTEFIX_SMTP_PORT587465 with ssl
NOTEFIX_SMTP_TLSstarttlsstarttls, ssl or none
NOTEFIX_SMTP_USER, NOTEFIX_SMTP_PASSWORDnoneMail server sign-in
NOTEFIX_TRUST_PROXYoff1 behind a proxy that sets X-Forwarded-For
NOTEFIX_VAULT_KEYvault.keyThe key for saved connections, as 64 hex digits, instead of the file
NOTEFIX_ALERT_AFTER120Seconds a broken key waits before the owner is emailed
NOTEFIX_ALERT_OFFLINE_AFTER900The same, for a tool that is not answering
NOTEFIX_DIGEST_HOUR9The hour daily email goes out, server time
NOTEFIX_LINKS_PER_IP20Sign-in links one IP address may ask for in an hour
NOTEFIX_INVITES_PER_DAY50Invitations per project per day
NOTEFIX_BOARDS_PER_PROJECT500Pages with notes per project
NOTEFIX_GUESTS_PER_PROJECT20000Guest browsers per project
NOTEFIX_JIRA_HOSTSatlassian.netJira addresses a pasted key may point at