source: Klonkt/README.md@ bddbfe0

main
Last change on this file since bddbfe0 was ce16d8a, checked in by Robin Genis <roboburr@…>, 2 months ago

docs(readme): Circles is ActivityPub now, not the old Ed25519 protocol

  • README.md — the Circles feature bullet + tech-stack line still described the old custom Ed25519-signed pull protocol, which was removed when Circles was rebuilt on ActivityPub (2026-06-26). Now: Circles = a curated fediverse feed (Mastodon/PeerTube/other Klonkt sites), built on ActivityPub with HTTP Signatures.
  • Property mode set to 100644
File size: 7.4 KB
RevLine 
[184393c]1# Klonkt
[7bc636b]2
[bbbfa3c]3Your own, **self-hosted** corner of the web — for your story, your visuals and
4your sound. Built on **Node + SQLite + htmx**: lightweight, server-rendered, and
5yours. No algorithm, no ads, no platform sitting in between.
[7bc636b]6
[bbbfa3c]7## What it does
[7bc636b]8
[7008b28]9- **Solo** — one personal site, entirely yours, on your own domain.
[bbbfa3c]10- **Blog & photos** — posts with cover, tags, timeline or grid.
11- **Host your own music** — built-in audio player with tracks, albums and playlists.
[7008b28]12- **Fediverse-native** — your posts federate over **ActivityPub**: people follow,
13 like, boost and reply from Mastodon (or another Klonkt). You can follow accounts,
14 see a home timeline, and reply/like back — Klonkt is a full fediverse client.
[bbbfa3c]15- **Grow**: newsletter, download-for-email, EPK/press kit, link-in-bio,
16 show calendar, and **cookie-free statistics**.
[ce16d8a]17- **Circles** — a curated feed of the makers you choose: feature accounts (other Klonkt
18 sites, Mastodon, PeerTube — any fediverse server) and their public posts appear in your
19 Circle. Decentralized, no central platform — built on ActivityPub.
[bbbfa3c]20- **Themes & languages** — multiple palettes (light + dark), interface in EN/NL/DE.
21- **Installable (PWA)**, **privacy-first** (self-hosted fonts, no tracking).
[7bc636b]22
[bbbfa3c]23### Lite mode (no audio)
[7bc636b]24
[bbbfa3c]25Set `KLONKT_AUDIO=off` in `.env` to disable the entire audio/music feature.
26Klonkt then runs as a lightweight **blog/photo/EPK/links site without ffmpeg** —
[7008b28]27ideal for minimal hosting. Circles and external embeds
[bbbfa3c]28(YouTube/SoundCloud/Spotify) keep working.
[7bc636b]29
[bbbfa3c]30## Self-hosting
[5a2cb69]31
[bbbfa3c]32Klonkt is a **Node app** — run it on a **VPS, in Docker, or on a Node hosting
33platform (PaaS)**. **Not** on classic shared PHP hosting. The database (SQLite)
34creates itself on first start.
[5a2cb69]35
[c648b04]36> **Requires [Node.js](https://nodejs.org/) 20 or newer.** The one-command VPS
37> installer and the Docker image include it; only a manual install needs you to
38> provide it.
39
[6d3e2c1]40### Option A — One-command VPS installer (recommended)
[5a2cb69]41
[45271b7]42**Good if:** you have (or just rented) a fresh, empty Debian/Ubuntu VPS and want
43the easiest path. This single line does everything — installs Node 20, sets up
44Caddy for automatic HTTPS, runs Klonkt as a background service that auto-restarts
45on reboot, and adds an update command. It's coexistence-safe (if the server
46already runs something it picks a free port and skips Caddy), but a clean VPS is
47simplest. Point your domain's DNS (A + AAAA records) at the server first, then run
48as root:
[7bc636b]49
50```bash
[6d3e2c1]51curl -fsSL https://klonkt.com/install.sh | sudo bash -s -- --domain yourdomain.com
[7bc636b]52```
53
[45271b7]54Then open `https://yourdomain.com` and finish setup in the browser. Update anytime
55with `klonkt-update`.
[184393c]56
[6d3e2c1]57### Option B — Docker
[184393c]58
[45271b7]59**Good if:** you already use Docker, or want everything bundled in one isolated
60container. Node, ffmpeg and cwebp are inside the image — you only need Docker +
61Docker Compose.
[5a2cb69]62
63```bash
[45271b7]64git clone https://github.com/roboburr/klonkt.git
65cd klonkt
[09ee2bd]66cp .env.example .env # works as-is; optionally set PUBLIC_BASE_URL to your domain
[6d3e2c1]67docker compose up -d
[5a2cb69]68```
69
[09ee2bd]70`SESSION_SECRET` is auto-generated on first start, so the defaults work as-is.
[45271b7]71Klonkt runs on port 3000 — put your own reverse proxy in front for HTTPS (see
72step 5 of Option C). Data (database + media) stays in the `klonkt-data` volume,
73even across updates. Update: `git pull && docker compose up -d --build`.
[184393c]74
[45271b7]75### Option C — manual (Node 20+), step by step
76
77**Good if:** you want full control, are adding Klonkt to a server you already
78manage, or just want to test it locally.
79
80**1. Get the code & install dependencies**
[5a2cb69]81
82```bash
[45271b7]83git clone https://github.com/roboburr/klonkt.git
84cd klonkt
[5a2cb69]85npm ci
86```
87
[09ee2bd]88**2. Create your config.** `SESSION_SECRET` (the key that signs login cookies) is
89auto-generated on first start, so this works as-is. For production, set
90`PUBLIC_BASE_URL` to your site address (e.g. `https://yourdomain.com`) so email &
91login links are correct:
[45271b7]92
93```bash
94cp .env.example .env
[7008b28]95nano .env # optional: PUBLIC_BASE_URL, plus SMTP if you want it
[45271b7]96```
97
98**3. Start it** — the SQLite database is created automatically on first start:
99
100```bash
101npm start # runs on http://localhost:3000
102```
103
104Just testing locally? Stop here and open `http://localhost:3000`.
105
106**4. Keep it running** across crashes and reboots (easiest is pm2):
107
108```bash
109npm install -g pm2
110pm2 start src/server.js --name klonkt
111pm2 save && pm2 startup # run the one command it prints, once
112```
113
114**5. Add HTTPS** with a reverse proxy in front. With Caddy (automatic
115certificates), put this in `/etc/caddy/Caddyfile` and reload Caddy:
116
117```caddy
118yourdomain.com {
119 reverse_proxy localhost:3000
120}
121```
122
[f99bbe8]123By default the app binds to `127.0.0.1` (via `HOST` in `.env`), so only your
124reverse proxy can reach it — not the open internet. Local testing on the same
125machine (`localhost:3000`) still works. Only set `HOST=0.0.0.0` if you need direct
126external access without a proxy (then open the port in your firewall and add HTTPS
127yourself).
128
[45271b7]129(`cwebp` is optional — `apt install webp` — for WebP image conversion.)
[5a2cb69]130
[bbbfa3c]131### HTTPS (Docker / bare Node)
[5a2cb69]132
[bbbfa3c]133Put a reverse proxy in front of the app. With **Caddy** (automatic Let's Encrypt):
[5a2cb69]134
135```caddy
[bbbfa3c]136yourdomain.com {
[5a2cb69]137 reverse_proxy localhost:3000
138 encode gzip zstd
139}
140```
141
[bbbfa3c]142(The VPS installer sets up Caddy + HTTPS for you already.)
[184393c]143
[bbbfa3c]144### First run
[5a2cb69]145
[bbbfa3c]146Open your site → you get the **setup wizard**: pick your language, name your site
147and create your admin. The **first user automatically becomes the administrator**;
148registration then closes. Lost your password?
[184393c]149`npm run reset-admin` (Docker: `docker compose exec klonkt npm run reset-admin`).
150
[bbbfa3c]151## Configuration (`.env`)
[184393c]152
[bbbfa3c]153| Variable | Required | What |
[184393c]154|---|---|---|
[bbbfa3c]155| `SESSION_SECRET` | ✅ | Random string of ≥32 characters |
156| `PUBLIC_BASE_URL` | ✅ | Canonical URL (e.g. `https://yourdomain.com`) |
157| `SMTP_HOST` / `_PORT` / `_USER` / `_PASS` / `_FROM` | — | Email for password reset + newsletter |
158| `KLONKT_DEFAULT_LANG` | — | Default language for visitors (`en`/`nl`/`de`) |
159| `KLONKT_AUDIO` | — | `off` = lite mode (no audio/ffmpeg) |
[7bc636b]160
161## Stack
162
163- **Runtime:** Node 20+
164- **Web:** Express + Helmet + express-session
[bbbfa3c]165- **DB:** better-sqlite3 (WAL), self-migrating on boot
166- **Templates:** EJS (server-rendered) + **htmx 1.9** (vendored, no build step)
167- **Audio:** ffmpeg-static (bundled)
[ce16d8a]168- **Fediverse / Circles:** ActivityPub (HTTP Signatures) — federates with Mastodon, PeerTube and other Klonkt sites
[184393c]169- **Fonts:** self-hosted variable woff2 (Fraunces / Plus Jakarta Sans)
[7bc636b]170
[bbbfa3c]171## Project structure
[7bc636b]172
173```
174src/
[bbbfa3c]175├── server.js # Express bootstrap + route mounting
[7008b28]176├── config/ # database, mailer, feature flags
[bbbfa3c]177├── db/migrations/ # SQLite schema (001-init.sql)
178├── middleware/ # site resolving, auth, render (htmx-aware)
179├── routes/ # per-resource Express routers (posts, auth, admin-*, circle, …)
180├── services/ # domain logic (federation, stats, mailer, permissions, …)
[184393c]181├── views/ # shell.ejs + partials/ + pages/ (EJS)
[bbbfa3c]182└── assets/ # css/ (palette tokens + components), js/ (htmx, player), fonts/
[7bc636b]183```
184
[bbbfa3c]185## License
[7bc636b]186
[bbbfa3c]187**AGPL-3.0-or-later** — see [LICENSE](LICENSE). Klonkt is free software: you may
188use, study, modify and distribute it. The AGPL does require that a modified
189version you offer as a network service makes its source code available to the
190users of that service. Made by robo.burr (Robin Genis) ·
[184393c]191<https://klonkt.com>
Note: See TracBrowser for help on using the repository browser.