source: Klonkt/README.md@ 98b7fdd

main
Last change on this file since 98b7fdd was 7008b28, checked in by Robin Genis <roboburr@…>, 3 months ago

docs: update README — hub removed, fediverse-native (drop Google/comments mentions)

Solo (not solo/hub); replace 'Fans & comments via Google' with the fediverse
client; drop the dead GOOGLE_* env row + config/google reference.

Co-Authored-By: Claude <noreply@…>

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