source: Klonkt/README.md@ a301d7a

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

docs: recommend a fresh/empty VPS for the one-command installer

State plainly that a clean VPS is the simplest setup; coexistence with an
existing server is still supported as a fallback.

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

  • Property mode set to 100644
File size: 5.4 KB
Line 
1# Klonkt
2
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.
6
7## What it does
8
9- **Solo or hub** — one personal site, or a label/collective with multiple
10 makers under one roof.
11- **Blog & photos** — posts with cover, tags, timeline or grid.
12- **Host your own music** — built-in audio player with tracks, albums and playlists.
13- **Fans & comments** — visitors sign in with Google (optional) and comment.
14- **Grow**: newsletter, download-for-email, EPK/press kit, link-in-bio,
15 show calendar, and **cookie-free statistics**.
16- **Circles** — connect your site with other Klonkt sites and show each other's
17 public posts; decentralized, with no central platform (Ed25519-signed federation).
18- **Themes & languages** — multiple palettes (light + dark), interface in EN/NL/DE.
19- **Installable (PWA)**, **privacy-first** (self-hosted fonts, no tracking).
20
21### Lite mode (no audio)
22
23Set `KLONKT_AUDIO=off` in `.env` to disable the entire audio/music feature.
24Klonkt then runs as a lightweight **blog/photo/EPK/links site without ffmpeg** —
25ideal for minimal hosting. Hub, Circles and external embeds
26(YouTube/SoundCloud/Spotify) keep working.
27
28## Self-hosting
29
30Klonkt is a **Node app** — run it on a **VPS, in Docker, or on a Node hosting
31platform (PaaS)**. **Not** on classic shared PHP hosting. The database (SQLite)
32creates itself on first start.
33
34### Option A — One-command VPS installer (recommended)
35
36**Best on a fresh, empty Debian/Ubuntu VPS** — a cheap box with nothing else on
37it. One command installs Node 20, Caddy (automatic HTTPS) and a systemd service.
38If the server already runs something it adapts (picks a free port and skips Caddy
39when another web server is present, then prints reverse-proxy instructions), but a
40clean VPS is the simplest, most reliable setup:
41
42```bash
43curl -fsSL https://klonkt.com/install.sh | sudo bash -s -- --domain yourdomain.com
44```
45
46Then open your domain and finish setup in the browser. Update later with `klonkt-update`.
47
48### Option B — Docker
49
50Node, ffmpeg and cwebp are inside the image; you only need Docker.
51
52```bash
53git clone https://github.com/roboburr/klonkt.git && cd klonkt
54cp .env.example .env # set SESSION_SECRET + PUBLIC_BASE_URL
55docker compose up -d
56```
57
58Data (database + media) stays in the `klonkt-data` volume, even across updates.
59Updating: `git pull && docker compose up -d --build`.
60
61### Option C — bare Node (20+)
62
63```bash
64git clone https://github.com/roboburr/klonkt.git && cd klonkt
65npm ci
66cp .env.example .env # set SESSION_SECRET + PUBLIC_BASE_URL
67npm start # the database is created on first start
68```
69
70For production, put it behind a process manager (pm2/systemd) and a
71reverse proxy. `cwebp` is optional (`apt install webp`) for WebP images.
72
73### HTTPS (Docker / bare Node)
74
75Put a reverse proxy in front of the app. With **Caddy** (automatic Let's Encrypt):
76
77```caddy
78yourdomain.com {
79 reverse_proxy localhost:3000
80 encode gzip zstd
81}
82```
83
84(The VPS installer sets up Caddy + HTTPS for you already.)
85
86### First run
87
88Open your site → you get the **setup wizard**: pick your language, name your site
89and create your admin. The **first user automatically becomes the administrator**;
90registration then closes. Lost your password?
91`npm run reset-admin` (Docker: `docker compose exec klonkt npm run reset-admin`).
92
93## Configuration (`.env`)
94
95| Variable | Required | What |
96|---|---|---|
97| `SESSION_SECRET` | ✅ | Random string of ≥32 characters |
98| `PUBLIC_BASE_URL` | ✅ | Canonical URL (e.g. `https://yourdomain.com`) |
99| `GOOGLE_CLIENT_ID` / `_SECRET` / `_REDIRECT_URI` | — | Google login for listeners (your own OAuth client; never grants admin) |
100| `SMTP_HOST` / `_PORT` / `_USER` / `_PASS` / `_FROM` | — | Email for password reset + newsletter |
101| `KLONKT_DEFAULT_LANG` | — | Default language for visitors (`en`/`nl`/`de`) |
102| `KLONKT_AUDIO` | — | `off` = lite mode (no audio/ffmpeg) |
103
104## Stack
105
106- **Runtime:** Node 20+
107- **Web:** Express + Helmet + express-session
108- **DB:** better-sqlite3 (WAL), self-migrating on boot
109- **Templates:** EJS (server-rendered) + **htmx 1.9** (vendored, no build step)
110- **Audio:** ffmpeg-static (bundled)
111- **Circles:** Ed25519-signed pull (libsodium via Node crypto)
112- **Fonts:** self-hosted variable woff2 (Fraunces / Plus Jakarta Sans)
113
114## Project structure
115
116```
117src/
118├── server.js # Express bootstrap + route mounting
119├── config/ # database, mailer, google, feature flags
120├── db/migrations/ # SQLite schema (001-init.sql)
121├── middleware/ # site resolving, auth, render (htmx-aware)
122├── routes/ # per-resource Express routers (posts, auth, admin-*, circle, …)
123├── services/ # domain logic (federation, stats, mailer, permissions, …)
124├── views/ # shell.ejs + partials/ + pages/ (EJS)
125└── assets/ # css/ (palette tokens + components), js/ (htmx, player), fonts/
126```
127
128## License
129
130**AGPL-3.0-or-later** — see [LICENSE](LICENSE). Klonkt is free software: you may
131use, study, modify and distribute it. The AGPL does require that a modified
132version you offer as a network service makes its source code available to the
133users of that service. Made by robo.burr (Robin Genis) ·
134<https://klonkt.com>
Note: See TracBrowser for help on using the repository browser.