Repository navigation
Keeping your own history
A Maplecord server can be set up so that almost nothing your group says is on our machines. Messages and files go straight between your members' apps, and the history is kept on their own devices and on an archive bot that one of you runs. The Maplecord server is left with one job: connecting you to each other.
This page is for the person setting that up. Read P2P first; everything here builds on it.
| Where it lives | |
|---|---|
| Messages, pictures and files in your channels | On each member's device, and on your archive bot |
| Voice, video and screen sharing | Straight between members' apps. Never kept anywhere. |
| Who is in the server, its channels and roles | The Maplecord server |
| Accounts, sign-in and friends | The Maplecord server |
| Finding each other to connect | The Maplecord server, which cannot read the set-up messages it passes along |
So the Maplecord server knows who your members are and that they connect to each other. It does not have what they say.
Be clear about these before you start.
- Members can find each other's IP addresses, and whoever runs the archive bot can find the address of everyone whose app connects to it. This suits a group that trusts each other. It does not suit a public community, and public servers cannot have P2P channels at all.
- Nothing can be taken back. Editing changes what apps show; deleting removes only your own copy. Every device and the bot keep what they received.
- No moderation by deletion. A moderator cannot remove a message from other people's devices.
- Ordinary bots, slash commands and webhooks do not work in P2P channels.
- Someone who is offline misses messages until they connect to a person, or the bot, who has them. The archive bot exists to close that gap.
Press +, Create my own, choose Private, and under Kind of server choose Full P2P. It starts with a P2P text channel and a P2P voice channel.
To add more, tick P2P channel when you create a channel, or make a P2P group so every channel in it is P2P. See Servers and channels. Keep every channel P2P: an ordinary text channel in the same server is kept by the Maplecord server like any other.
Each member unticks Do not allow P2P connections under Settings, Voice & audio, and signs in again when asked. Until they do, they cannot connect to P2P channels.
Suggest that members right-click each channel they care about and turn on Subscribe (stay connected), so messages reach them whenever the app is open.
Without a bot, history is only as complete as whoever happens to be online. The archive bot sits in the channels you let it into, keeps every message and file it receives, and hands them to anyone who connects later and is missing them. The only thing it ever posts itself is a notice that it is running out of room.
You need a computer that stays on, with Docker, or with Node 24.
-
Make the bot's account. In the app: Settings, My bots, tick Make it a P2P bot, give it a name and press Create bot. Copy the token and the Bot ID.
-
Add it to your server. Server settings, Bots, paste the Bot ID, Add bot. A P2P bot can only be added to a server that has P2P channels, and can be in one server only, so each server that wants an archive makes a bot of its own and runs its own copy. A server can have more than one.
-
Get the archive bot from github.com/kl3mta3/Maplecord-ArchiveBot.
-
Fill in its settings. Copy
.env.exampleto.env:Setting MAPLECORD_SERVERThe Maplecord server's address, https://api.maplecord.appBOT_TOKENThe token from step 1 ARCHIVE_KEYEverything the bot keeps is encrypted with this. Make one with openssl rand -hex 32and keep a copy somewhere safe.MAX_FILE_MBFiles larger than this are not kept. 0 keeps no files. KEEP_DAYSMessages older than this many days are deleted, with their files. 0 keeps everything. KEEP_FILES_DAYSFiles older than this are deleted while their messages are kept. 0 keeps a file as long as its message. MAX_TOTAL_GBThe most the whole archive may take on disk. 0 is no limit. -
Start it.
docker compose up -d
docker compose logs -fshows what it is doing. Without Docker:npm ci, thennode --env-file=.env src/index.ts. -
Let it into each channel. Right-click a P2P channel, open P2P bots and tick the bot. Do this for every channel it should keep.
Each member is then asked by their app whether to connect to the bot, and can say no.
One folder for each channel, holding its messages and its files, all encrypted with ARCHIVE_KEY. With Docker that
is the archive volume.
- How long things are kept is decided by you, in the bot's settings, and nowhere else. The Maplecord server has no say in it.
- If
ARCHIVE_KEYis lost, so is the archive. - When the archive is nearly at
MAX_TOTAL_GB, and again when it is full, the bot says so in its channels. Full, it keeps nothing new until there is room. - Reactions, edits, pins and votes are messages too, and are kept like any other. Editing a message does not remove its earlier text from the archive.
- Taking the bot out of a channel stops it there. It does not delete what it already kept.
Every message is signed by the app that wrote it, and each member's app checks that signature against the key the Maplecord server holds for the author. The bot stores messages and passes them on, but it cannot change one or make one up: a message that fails the check is thrown away.
For the same reason, a message is only accepted from someone who is still a member of the server. Messages written by people who have since left may not be handed on to a device that never had them.
- The bot is reached directly, never through a relay. A member who joins P2P channels through the relay is not connected to it, and catches up from other members.
- A member who says no to the bot keeps their address from it. What they write can still reach it through the members who are connected to it.
- When someone connects, their app and the bot compare the newest 300 messages of the channel and the bot hands over what is missing. Scrolling further back fetches older ones the same way.
- A phone or a browser may clear what it has kept; the desktop app is the dependable place for history.
- The archive bot is new and has had little testing with large groups. Try it with your own group before relying on it.