FuzzyShareDOCS
Agent prompt Sign up

Self-hosting

Admin dashboard and visitor stats

Run the operator dashboard on its own hostname to see users, plans, storage and site visitors.

fuzzy admin is a small dashboard for the person who runs the service. It shows how many accounts there are, who signed up when, which plans they are on, how much is stored, and, with Umami connected, who visits the public site.

It is a second process that runs the same binary on the same machine. It never opens the data directory. It asks the file server for counts over HTTP, using the admin key, so it can be stopped, restarted or moved without touching your data.

Section Where it comes from
Users, new and active accounts, paying accounts The file server, GET /admin/stats
Plans, files, storage, active links, signups per day The file server
Newest accounts (name, email, plan) The file server, GET /admin/users
Visitors, page views, top pages, referrers, countries Your Umami, if connected

1. Configure it#

Both processes can share one environment file. Add to /etc/fuzzyshare/env:

FUZZY_ADMIN_KEY=...                      # you already have this; it is also the dashboard's sign-in
FUZZY_ADMIN_UPSTREAM=http://127.0.0.1:8080   # must match FUZZY_ADDR

FUZZY_ADMIN_ADDR defaults to 127.0.0.1:8081, so the dashboard is only reachable through your proxy.

2. Run it as a service#

Copy deploy/fuzzyshare-admin.service to /etc/systemd/system/ and start it:

sudo systemctl daemon-reload
sudo systemctl enable --now fuzzyshare-admin
curl -s http://127.0.0.1:8081/health   # ok

The deploy script restarts this service after every healthy deploy when the unit file exists, so it always runs the same version as the file server. On a machine without systemd, run fuzzy admin under your supervisor the same way you run fuzzy serve.

On a machine with zinit#

A ThreeFold micro VM runs zinit as PID 1, not systemd. Add /etc/zinit/fuzzyshare-admin.yaml (mode 0600, since it holds the key):

exec: /opt/fuzzyshare/fuzzy admin
after:
  - fuzzyshare
env:
  FUZZY_ADMIN_ADDR: "127.0.0.1:8081"
  FUZZY_ADMIN_UPSTREAM: "http://127.0.0.1:8080"
  FUZZY_ADMIN_KEY: "the same key as the file server"

Then zinit monitor fuzzyshare-admin. zinit reads a service's file only when it is monitored, so after you edit a file, run zinit stop NAME, zinit forget NAME and zinit monitor NAME. The deploy script restarts the service when this file exists.

3. Give it a hostname#

Point a DNS record for admin.example.com at the machine and add it to your proxy. With Caddy:

admin.example.com {
    reverse_proxy 127.0.0.1:8081
}

Caddy gets the certificate by itself. Open the address and sign in with the admin key.

Anyone with the admin key can read every account's name and email here. Keep the key out of chat and shell history. After five wrong keys from one address the dashboard refuses further tries for ten minutes. To lock it down further, restrict the hostname to your own addresses in the proxy.

4. Visitor stats with Umami#

Umami is open source and cookieless. Running it yourself keeps the data on your machine. It needs Postgres, so a small compose file is the easiest way:

services:
  umami:
    image: ghcr.io/umami-software/umami:postgresql-latest
    ports: ["127.0.0.1:3000:3000"]
    environment:
      DATABASE_URL: postgresql://umami:CHANGE_ME@db:5432/umami
      APP_SECRET: CHANGE_ME_TO_A_LONG_RANDOM_STRING
    depends_on: [db]
    restart: always
  db:
    image: postgres:15-alpine
    environment: { POSTGRES_DB: umami, POSTGRES_USER: umami, POSTGRES_PASSWORD: CHANGE_ME }
    volumes: [umami-db:/var/lib/postgresql/data]
    restart: always
volumes:
  umami-db:

Put it on its own hostname, for example stats.example.com, in the proxy with reverse_proxy 127.0.0.1:3000. Then:

  1. Sign in to Umami and change the default administrator password at once.
  2. Add your site and copy its website id.
  3. Create a second user with the View only role and give it access to that site. The dashboard signs in as this user, so it can read numbers but never change anything. Screen names differ between Umami versions: see their documentation.
  4. Add the settings to /etc/fuzzyshare/env and restart both services:
FUZZY_UMAMI_URL=https://stats.example.com
FUZZY_UMAMI_ID=the-website-id
FUZZY_UMAMI_USER=viewer
FUZZY_UMAMI_PASS=...

FUZZY_UMAMI_URL and FUZZY_UMAMI_ID make the landing, pricing, sign-up and documentation pages load Umami's tracker. It is never loaded on share links (their address is their secret), the dashboard or the sign-in page. The tracker honors Do Not Track, and the privacy notice on the site changes to say visits are counted. See Privacy.

Troubleshooting#

  • "cannot reach the file server": FUZZY_ADMIN_UPSTREAM does not match where the file server listens.
  • "the file server answered 403": FUZZY_ADMIN_KEY differs between the two processes.
  • "Could not read Umami": check the URL, the website id and that the view-only user can see the site.
  • No visitors yet: open the public site once, then wait a minute. Pages with Do Not Track on are not counted.

View this page as Markdown