Your own log server
A log server is where Konflux sends the chat your computer records, so that it outlives your computer, and where it reads older messages back from. Konflux’s own archive, at logs.konflux.app, is one. You can run your own: the same program, on your own Cloudflare account, holding only what your computers send it.
You do not need one to use Konflux. Without one, your log stays on your computer and older messages come from Konflux’s archive (see Your data). Run your own if you want your channel’s chat kept somewhere you control, for example for your moderators to look back through, or recorded while your own computer is off.
This page is for people who are comfortable with a terminal. Setting it up takes about an hour.
What it is
Section titled “What it is”Three parts, all in Konflux’s source code under services/:
- The server (
services/ingest): a Cloudflare Worker. It stores what is sent to it exactly as the platforms sent it, in a Cloudflare R2 bucket, one file per chat per day, and keeps an index of the messages in a Cloudflare D1 database, so that a person’s messages and a search can be answered quickly. - Your Konflux, which sends its log there and reads older messages back.
- Capture nodes, if you want them (
services/node): Konflux’s core running on a small server with no window, joining a list of chats and sending what it hears. A node needs no Twitch, YouTube or Kick account: it reads every chat the way a viewer who is not signed in does.
Everything here also applies to Konflux’s own archive, which runs the same code.
What you need
Section titled “What you need”- A Cloudflare account. Workers, R2 and D1 are Cloudflare products; what they cost, and whether your plan includes them, is on Cloudflare’s own pages. A personal archive is small: the 190 days of one Twitch channel’s chat that a public logging service had kept came to about 38 MB.
- Node.js on your computer, for Cloudflare’s command-line tool, Wrangler. Konflux’s server needs Wrangler 4.36.0 or later;
npx wranglerruns it without installing it. - Konflux’s source code, for the server’s files and to build a capture node.
- For a capture node: a small Linux server that is always on, ideally somewhere other than your home connection.
Set it up
Section titled “Set it up”All commands run in the services/ingest folder of Konflux’s source.
Sign in to Cloudflare
Section titled “Sign in to Cloudflare”npx wrangler loginThis opens your browser to give Wrangler access to your Cloudflare account, once per computer.
Make the bucket and the database
Section titled “Make the bucket and the database”npx wrangler r2 bucket create konflux-archivenpx wrangler d1 create konflux-indexThe second command prints a database_id. Keep it for the next step.
Then give the bucket a rule that deletes what is under held/ seven days after it was put there. That is where a forget keeps its sealed copy, so that a mistake can be undone for a week (see Forgetting a person):
npx wrangler r2 bucket lifecycle add konflux-archive forgotten-held held/ --expire-days 7npx wrangler r2 bucket lifecycle list konflux-archiveA rule without the prefix held/ would delete your whole archive after seven days. Make sure it names held/.
Make wrangler.toml yours
Section titled “Make wrangler.toml yours”wrangler.toml describes Konflux’s own server. Change it for yours:
database_idunder[[d1_databases]]: the oned1 createprinted.[[routes]], which nameslogs.konflux.app: delete those three lines, or put a domain of your own there that your Cloudflare account manages. Without a domain, your server’s address is theworkers.devone thatnpx wrangler deployprints.namespace_idin each[[ratelimits]]: any whole numbers that nothing else on your Cloudflare account uses. These count how often readers without your key may ask; see Who can read it.nameat the top, if you want another name thankonflux-ingest. It becomes part of theworkers.devaddress.
Leave invocation_logs = false and [observability.traces] enabled = false as they are: they keep Cloudflare from keeping a log of every request, with the address of whoever asked.
Make the two keys
Section titled “Make the two keys”The server has two keys, because they are two different powers:
| Key | Lets its holder | Goes on |
|---|---|---|
INGEST_TOKEN |
send chat to the server, read it back with everything in it, list its files, read which chats your nodes record | your computer and every capture node, in a file called sync-token |
PURGE_TOKEN |
remove a person from the server, put them back, rewrite its files, decide whether readers without a key are answered, change which chats your nodes record | your computer only, in a file called purge-token |
Make each one with:
head -c 32 /dev/urandom | base64and give them to the server:
npx wrangler secret put INGEST_TOKENnpx wrangler secret put PURGE_TOKENThen put each into its file in your Konflux config folder (~/.config/konflux/ on Linux, %APPDATA%\konflux\ on Windows), with nothing else in it. On Linux, make the files readable by you alone:
chmod 600 ~/.config/konflux/sync-token ~/.config/konflux/purge-tokenNever put either key in Konflux’s settings: settings get exported, copied and pasted into bug reports. Until a key is set on the server, everything that needs it answers “this deployment has no … configured”, rather than letting anyone in.
Make the tables
Section titled “Make the tables”npx wrangler d1 execute konflux-index --remote --file schema.sqlnpx wrangler d1 execute konflux-index --remote --file fts.sqlschema.sql makes the index, the list of people who asked to be forgotten, the record of what moderators removed, and the list of chats your nodes record. fts.sql makes the word search. Both are safe to run again.
Do not run the files in migrations/ on a new server: they are for a server made before them, and schema.sql already has what they add.
Always add --remote. Without it Wrangler works on a copy on your own computer and says so in one easily missed line.
Deploy it
Section titled “Deploy it”npx wrangler deployWrangler prints the server’s address. Check it:
curl https://konflux-ingest.<your-subdomain>.workers.dev/healthIt answers {"ok":true} and nothing else.
Connect Konflux to it
Section titled “Connect Konflux to it”In Settings › Logging:
- In Your own server, enter the server’s address followed by
/ingest, for examplehttps://konflux-ingest.<your-subdomain>.workers.dev/ingest. Konflux’s archive is then no longer used: older messages come from your server. - Turn on Send the log to it. Konflux sends with the key in
sync-token; without the file nothing is sent, and Settings says so. - Restart when Settings asks. Under Your own server it then says In use: your own server, with its address.
Send every sets how often a batch goes, 60 seconds by default; a small batch can wait up to five minutes so that the server is not filled with tiny files. Keep messages for deletes nothing on your computer that the server has not confirmed.
Who can read it
Section titled “Who can read it”Your Konflux reads your server with your key, and sees everything on it.
Without a key, your server answers nobody at first: a reader without a key is refused until you say that the server’s record of what moderators removed is complete. On a new, empty server it is complete from the start. If you want anyone to be able to read your server without a key, as anyone can read Konflux’s archive, say so once:
curl -X POST -H "authorization: Bearer $(cat ~/.config/konflux/purge-token)" \ "https://konflux-ingest.<your-subdomain>.workers.dev/removals?complete=1"From then on, a reader without a key sees what Konflux’s archive shows: chat messages as the chat’s viewers saw them, with the moderators’ work done, and nothing that only moderators saw; within the limits per address in wrangler.toml. complete=0 takes it back. If you are not sure you want a public archive, leave it closed: your Konflux and your nodes do not need it open.
A capture node on a small server
Section titled “A capture node on a small server”A capture node records chats while your computer is off. services/node/README.md in Konflux’s source has the full steps; in short:
-
Build the core for the server:
cargo build --release -p konflux-host. If the server’s Linux is older than your computer’s, the binary may not start there;scripts/build-node.shbuilds it in a container with an older system library. -
Copy it to the server as
/usr/local/bin/konflux-host, make a userkonfluxfor it, and put the chats it should record in/etc/konflux/watch.txt, one a line, written as in Konflux’s join box:arckon,kick:arckon,yt:@handle. -
Give it a
settings.jsonin its own config folder (/var/lib/konflux/config/konflux/) that sends its log to your server and keeps its own copy short, and yoursync-tokenbeside it. It needs no other key and no platform account. Never give a nodepurge-token.{ "overrides": { "global": {"log.sync.enabled": true,"log.sync.endpoint": "https://konflux-ingest.<your-subdomain>.workers.dev/ingest","log.retention_days": 7} } }log.retention_daysdeletes what the node captured once it is 7 days old and your server has confirmed it. Without it the node keeps everything for good (see What you take on). -
Install
services/node/konflux-node.serviceas a systemd unit and start it.journalctl -u konflux-nodeshows what it is doing.
A node uses about 33 MB of memory. Two nodes in different places record more than one: chat platforms drop messages when a connection drops, and two connections rarely drop the same ones.
YouTube shows some servers’ addresses a “Sign in to confirm” page instead of chat. Check before giving a node a YouTube chat (the README says how).
Which chats your nodes record
Section titled “Which chats your nodes record”From 0.3.0, instead of editing every node’s watch.txt, you can keep one list on your server, the wanted list, and have your nodes follow it. Start a node with --wanted and the platforms it should take from the list, for example --wanted twitch,kick. It asks your server every ten minutes, with its sync-token, and joins what the list holds, beside its own watch.txt. The list is changed only from your own computer, with your purge-token, so that a node that was broken into cannot change what every node records.
Let Konflux keep the list. From 0.3.1, Settings › Logging › Have my capture nodes record the chats in my tabs does it, and it is on by default. Every channel in your tabs then goes on the list: all your tabs as they are saved, not only the chats connected now, so that your nodes record them while Konflux is closed. It needs Your own server with Send the log to it on, and purge-token in your config folder; until it has them it does nothing and says what is missing under the switch. So the moment all three are there, your tabs go on the list: turn the switch off first if you keep the list yourself.
- When you open or close a tab, or add or take away a channel, Konflux sends your server only the difference, a few seconds after your last change: one request, and when something is to come off, first a request that asks whether your server can tell a channel added by hand from one your tabs added, each time. It does the same each time it starts.
- It takes off only the channels it put there itself. Your server keeps, for each channel on the list, whether it was added by hand or from your tabs, and takes off only the tabs’. A channel you add by hand stays, even when it leaves your tabs, and even if Konflux had added it before you did; under the switch, Konflux says when your server left one for that reason. Turning the switch off takes Konflux’s own channels off the list, and leaves yours.
- A server from before 0.3.1 cannot tell the two apart. Konflux then only adds to its list and takes nothing off, not even when you turn the switch off, and says so under the switch. Update the server, in the order its
services/ingest/README.mdgives (“The wanted list’s origin”): the channels on its list before the update count as added by hand. - A YouTube video is left out, since it ends with its stream; a YouTube channel goes on the list by its @handle or its
UCID. - Under the switch, Konflux says how many of your tabs’ channels are on the list; which ones did not fit in the list’s 200; which ones your server refused and why, such as a channel whose owner asked to be forgotten; and, once, when your server cannot be reached. It then tries again later, waiting longer each time, at most an hour, as it does when sending the log.
- If a server from before 0.3.1 made a change but its answer never arrived, Konflux cannot tell whether a channel on the list is its own. It leaves that channel there, says so under the switch, and you can take it off by hand.
- Which channels it put there is kept in
wanted-from-tabs.jsonin your config folder. The key goes only to your own server’s address, overhttps://, and nowhere else. - They are on the list like any other channel: your nodes record those chats, other people’s messages included, and
konflux-backfill --wanted, below, fetches the past of the Twitch ones.
Change the list by hand. With curl and your purge-token, from your own computer, as well as or instead of the switch:
curl -X POST -H "authorization: Bearer $(cat ~/.config/konflux/purge-token)" -H "content-type: application/json" \ --data '{"add":[{"platform":"twitch","channel":"arckon"}]}' \ "https://konflux-ingest.<your-subdomain>.workers.dev/wanted""remove" takes channels off the same way. A channel you add like this stays when the switch is turned off. The list holds channels by name and nothing else, at most 200; a node takes at most 100 Twitch channels, 20 Kick and 10 YouTube. Asking your server for older messages never adds to it. A channel whose owner asked to be forgotten cannot be added, and comes off the list when they are forgotten.
A chat’s past, from rustlog
Section titled “A chat’s past, from rustlog”Twitch keeps no chat history, but public logging services built on rustlog or justlog have kept some channels’ chat for years, as Twitch sent it. konflux-backfill --wanted fetches the past of the Twitch channels on your wanted list from the first such service that has it (logs.zonian.dev, then logs.ivr.fi), one request every 1.5 seconds, and sends it to your server. Run it once, from your own computer:
cargo build --release -p konflux-backfilltarget/release/konflux-backfill --wanted --store ~/konflux-backfill \ --endpoint https://konflux-ingest.<your-subdomain>.workers.dev/ingest --dry-runand again without --dry-run. It takes at most a year of each channel in one run, oldest first (--days changes that), and sends each channel to your server before it asks for the next; run it again for the next year. The people on your computer’s forget list are left out as it reads, and your server refuses them again as it arrives. It is somebody else’s record, and the rows say so: they are filed under the service’s name, not as seen by you. An opt-out from rustlog is made at one service and holds there alone: that service deletes the person’s logs and no longer hands them out, but another service may still have them, and an opt-out a service does not report cannot be heard. So the backfill asks every service which days it has before fetching any, and a channel that any of them says its owner opted out of is fetched from none, and what your computer held of it is deleted. Run it again and it carries on where it stopped. Only days your server already has from the same service are skipped: days it has from your own nodes, or from another service, are fetched again, and the two copies of a message are told apart by its ID, so that your server’s index, and what anyone reading it sees, holds it once, while its stored files keep both. Once your server has confirmed everything it was sent, the backfill deletes its own copy of the chat from your computer, since forgetting someone later would not reach that copy; --keep-store keeps it. If sending failed, the next run sends what is left, leaving out anyone forgotten since, once it has checked the channel as it would a new one: a channel no longer on your list, one whose owner you forgot, or one a service says opted out is deleted from your computer instead, unsent. Every run ends by naming any copy still on your computer.
Keeping it up to date
Section titled “Keeping it up to date”When you update Konflux’s source, update the server in the order its services/ingest/README.md gives for that version. In general: the new tables first (npx wrangler d1 execute konflux-index --remote --file migrations/<date>-<name>.sql, each once, in date order), then npx wrangler deploy. A server that finds a table missing refuses what is sent to it until the table is there, and your computers send it again later, so nothing is lost on the way. Deploy to every request at once, never a percentage at a time. Before deploying, note the version running (npx wrangler deployments list): npx wrangler rollback <version> goes back to it.
What you take on
Section titled “What you take on”Running a log server means keeping other people’s messages: their words, their account names and the IDs the platforms give them, and what moderators did to them. That is personal data, about people who did not choose your server.
- You decide what it holds and who sees it. Record the chats you have a reason to keep, and keep your server closed to readers without a key unless you mean it to be public.
- People can ask you to delete what you hold about them. Twitch’s developer agreement asks that you honour such a request, and data protection law where you live may require it, such as the GDPR in the European Union. Konflux can do it: turn on Settings › Advanced › Developer mode, open the person’s card and choose Forget this person…. With
purge-tokenin your config folder, it removes them from your server too, and your server then refuses anything of theirs from every computer and node. It keeps a sealed copy for seven days, for undoing a mistake; the bucket’sheld/rule deletes it after that. - Say how to reach you. If your server is public, or you record chats you do not moderate, tell people where to send such a request, as Konflux’s archive does with privacy@konflux.app.
- Your nodes keep a copy too. A capture node keeps what it captured in its own log until your server has confirmed it, and then for as long as its
log.retention_dayssays: with the setting at 0, the default, for good. Forget this person… reaches your server and your computer, not your nodes, so a node’s copy of a forgotten person’s messages goes only when its retention deletes it. Set it, to 7 days as above, on every node. - It keeps everything until you delete it. The server deletes nothing on a timer apart from the sealed copies. YouTube’s rules for its official API allow chat read through that API to be kept for 30 days; Konflux reads YouTube the way youtube.com does, but if you ever send it chat read through the API, your server keeps that too.
- Your keys are your server. Anyone with
sync-tokencan send your server lines that look like chat; anyone withpurge-tokencan remove people from it and change which chats your nodes record. Keep them in those two files only, and make new ones withwrangler secret putif one leaks.
This page describes what Konflux does and what it gives you to work with. It is not legal advice; what applies to you depends on where you are and what you record.
Taking it down
Section titled “Taking it down”npx wrangler delete removes the Worker. The bucket and the database stay until you delete them too, in Cloudflare’s dashboard or with npx wrangler r2 bucket delete and npx wrangler d1 delete; a bucket that still holds files may have to be emptied first. Empty Your own server in Konflux and stop any capture nodes (systemctl disable --now konflux-node).