Open-source Grok Bot alternative with a virtual machine that bots can use
TypeScript ai-agentsclaude-codecodexcomputer-usedockerelectrongrokgrok-botgrok-bot-alternativeself-hostedtypescript
Docs: a tested backup and restore for the installer's layout, with the whole project stopped and started
milind-soni172ffd8bf543
diff --git a/apps/docs/content/docs/self-hosting/deploy-vps.mdx b/apps/docs/content/docs/self-hosting/deploy-vps.mdxindex 6b05d2a366..e8007980d1 100644--- a/apps/docs/content/docs/self-hosting/deploy-vps.mdx+++ b/apps/docs/content/docs/self-hosting/deploy-vps.mdx@@ -49,7 +49,7 @@ If Docker is missing, the installer asks before installing it with Docker's offi| Path | What ||---|---|-| `compose.yaml`, `Caddyfile` | the same server-plus-Caddy setup as path B; written again on every run |+| `compose.yaml`, `Caddyfile` | the same server-plus-Caddy setup as path B, Caddy in its own container reaching the server over a socket; written again on every run || `.env` | your settings: `DOMAIN`, the pinned version (`OMB_IMAGE`) and anything you add, such as [who may sign in with an email](/docs/self-hosting). The installer keeps your lines || `data/` | everything MausBot stores: chats, bots, engine sign-ins, paired devices. Never touched once it exists || `caddy/` | the HTTPS certificates |@@ -58,11 +58,11 @@ If Docker is missing, the installer asks before installing it with Docker's offi`update.sh` and the sandbox's files are this repository's own, taken from the tag of the version being installed so they match it, and from `main` only when that tag does not have them. The installer says which it used.-It runs the newest release, pinned by its version; once a `stable` channel is published it follows that instead. It never runs `latest`, which follows every commit. It then waits until the server reports healthy and `https://maus.example.com` answers with a valid certificate, and prints the address.+It runs the newest release, pinned by its version; once a `stable` channel is published it follows that instead. If that version has no bots' sandbox, the checks (`--check` too) say so before anything is downloaded. It never runs `latest`, which follows every commit. It then waits until the server reports healthy and `https://maus.example.com` answers with a valid certificate, and prints the address.**The bots' sandbox.** A MausBot version with the hardened profile runs every bot in a sandbox, away from the server's settings, keys and other bots' files, and Docker's defaults do not let a container build one. For such a version the installer prepares the server (a seccomp profile in `/etc/mausbot` and an AppArmor profile in `/etc/apparmor.d`, the two the MausBot connector installs), starts the server with the four security settings in `compose.box.yaml` (no `--privileged`, no added capability), and then runs the server's own self-check, which among other things confirms that a bot cannot read `config.json`. If a check fails that means a bot could reach something it must not, or that bots would not work, the installer names it and does not report success; so does a self-check that gives no answer, or a check the installer has never heard of. Five checks that are about neither (the kernel keyring, the sandbox's host name, the CPU list, a hosting provider's address, and reaching the public internet) only print a note. For a version without the hardened profile it says the sandbox is not there yet; run the install command again after updating to one that has it. `--no-sandbox` skips all of this, for a server only you sign in to on a host without AppArmor.-**Sign in as the first admin** with a one-time link made on the server:+**Sign in as the first admin** with a one-time link made on the server. Run in a terminal, the installer makes one and prints it when it finishes. It does not when its output goes anywhere else, such as a log, because whoever reads the link can sign in as the admin until it is used or expires. To make one yourself:```shcd /opt/openmausbot && sudo docker compose exec omb openmausbot pair --label "First admin"@@ -71,7 +71,7 @@ cd /opt/openmausbot && sudo docker compose exec omb openmausbot pair --label "FiOpen the link it prints, or paste it into the desktop app under **+ → Connect to a server**. To sign in with an emailed code instead, run the installer with `--email [email protected]`.- **Update:** `sudo /opt/openmausbot/update.sh`, which backs the data up, checks the new version's health and puts the old one back if it fails. The installer places it once this repository has it and prints the command when it finishes; until then, running the install command again moves to the newest release. `update.sh` pins the version by digest in `.env`, and a later run of the installer keeps that pin.-- **Repair:** run the install command again. It checks the server, rewrites its own files and leaves `.env` and `data/` alone.+- **Repair:** run the install command again. It checks the server, rewrites its own files and leaves `.env` and `data/` alone. That also moves an install made before Caddy got its own container: Caddy then shared the server's network, and HTTPS went down whenever the server restarted without it.- **Stop:** `--uninstall` stops the server and removes its containers. It deletes nothing: your data stays in `/opt/openmausbot/data`.- **Every other command in this guide** that starts `docker compose` for path B works from `/opt/openmausbot`.- **What the installer contacts:** the registries and Let's Encrypt from the table, GitHub's release list, this repository's files on `raw.githubusercontent.com`, and `cloudflare.com/cdn-cgi/trace` to learn the server's public address for the DNS check. It sends no telemetry.@@ -413,16 +413,32 @@ docker run --rm -v deploy_data:/data -v "$PWD/openmausbot-backup.XXXXXX":/b:ro adocker compose start```-With the installer, the data is a folder, not a volume. Archive it the same way:+With the installer, the data is the folder `/opt/openmausbot/data`. This backs+it up, with `.env`, into a private archive in `/opt/openmausbot`, the whole+project stopped and started again around it:```sh-cd /opt/openmausbot && sudo docker compose stop omb-backup_dir=$(mktemp -d "$PWD/openmausbot-backup.XXXXXX")-sudo tar czf "$backup_dir/openmausbot-data.tgz" -C /opt/openmausbot data-sudo docker compose start omb+cd /opt/openmausbot && sudo docker compose stop && sudo sh -c 'umask 077; tar --warning=no-file-ignored -czf "backup-$(date -u +%Y%m%dT%H%M%SZ).tgz" data .env'; sudo docker compose start```-Each backup creates a fresh private folder in the current directory, so it+Copy the archive to another machine and keep it private.+`--warning=no-file-ignored` keeps tar from listing the sockets in the data+folder, which are not data: the server makes them again when it starts.++To restore an archive, replace `backup-20261110T153000Z.tgz` with its name.+The data as it is now is moved aside to `data.before-restore`, and the archive's+data takes its place, with its owner and permissions. An archive without a+`data/` folder changes nothing:++```sh+cd /opt/openmausbot && sudo docker compose stop && sudo sh -c 'set -e; tar -tzf backup-20261110T153000Z.tgz data/ >/dev/null; rm -rf data.before-restore; mv data data.before-restore; tar -xzpf backup-20261110T153000Z.tgz data'; sudo docker compose start+```++Once MausBot runs on the restored data, remove the old copy:+`sudo rm -rf /opt/openmausbot/data.before-restore`. The restore leaves `.env` as+it is. On a new server, install first with the same `--domain`, then restore.++Each path B backup creates a fresh private folder in the current directory, so itcannot overwrite an older archive with more permissive access. Keep thearchive inside that folder privately on another machine. Restore paths A and Cwith the server stopped, using the same paths and original ownership. Afterdiff --git a/docs/deploy-vps.md b/docs/deploy-vps.mdindex 951de9ab53..606fe0f380 100644--- a/docs/deploy-vps.md+++ b/docs/deploy-vps.md@@ -41,7 +41,7 @@ If Docker is missing, the installer asks before installing it with Docker's offi| Path | What ||---|---|-| `compose.yaml`, `Caddyfile` | the same server-plus-Caddy setup as path B; written again on every run |+| `compose.yaml`, `Caddyfile` | the same server-plus-Caddy setup as path B, Caddy in its own container reaching the server over a socket; written again on every run || `.env` | your settings: `DOMAIN`, the pinned version (`OMB_IMAGE`) and anything you add, such as [who may sign in with an email](self-hosting.md#sign-in-with-your-email). The installer keeps your lines || `data/` | everything MausBot stores: chats, bots, engine sign-ins, paired devices. Never touched once it exists || `caddy/` | the HTTPS certificates |@@ -50,11 +50,11 @@ If Docker is missing, the installer asks before installing it with Docker's offi`update.sh` and the sandbox's files are this repository's own, taken from the tag of the version being installed so they match it, and from `main` only when that tag does not have them. The installer says which it used.-It runs the newest release, pinned by its version; once a `stable` channel is published it follows that instead. It never runs `latest`, which follows every commit. It then waits until the server reports healthy and `https://maus.example.com` answers with a valid certificate, and prints the address.+It runs the newest release, pinned by its version; once a `stable` channel is published it follows that instead. If that version has no bots' sandbox, the checks (`--check` too) say so before anything is downloaded. It never runs `latest`, which follows every commit. It then waits until the server reports healthy and `https://maus.example.com` answers with a valid certificate, and prints the address.**The bots' sandbox.** A MausBot version with the hardened profile runs every bot in a sandbox, away from the server's settings, keys and other bots' files, and Docker's defaults do not let a container build one. For such a version the installer prepares the server (a seccomp profile in `/etc/mausbot` and an AppArmor profile in `/etc/apparmor.d`, the two the MausBot connector installs), starts the server with the four security settings in `compose.box.yaml` (no `--privileged`, no added capability), and then runs the server's own self-check, which among other things confirms that a bot cannot read `config.json`. If a check fails that means a bot could reach something it must not, or that bots would not work, the installer names it and does not report success; so does a self-check that gives no answer, or a check the installer has never heard of. Five checks that are about neither (the kernel keyring, the sandbox's host name, the CPU list, a hosting provider's address, and reaching the public internet) only print a note. For a version without the hardened profile it says the sandbox is not there yet; run the install command again after updating to one that has it. `--no-sandbox` skips all of this, for a server only you sign in to on a host without AppArmor.-**Sign in as the first admin** with a one-time link made on the server:+**Sign in as the first admin** with a one-time link made on the server. Run in a terminal, the installer makes one and prints it when it finishes. It does not when its output goes anywhere else, such as a log, because whoever reads the link can sign in as the admin until it is used or expires. To make one yourself:```shcd /opt/openmausbot && sudo docker compose exec omb openmausbot pair --label "First admin"@@ -63,7 +63,7 @@ cd /opt/openmausbot && sudo docker compose exec omb openmausbot pair --label "FiOpen the link it prints, or paste it into the desktop app under **+ → Connect to a server**. To sign in with an emailed code instead, run the installer with `--email [email protected]`.- **Update:** `sudo /opt/openmausbot/update.sh`, which backs the data up, checks the new version's health and puts the old one back if it fails. The installer places it once this repository has it and prints the command when it finishes; until then, running the install command again moves to the newest release. `update.sh` pins the version by digest in `.env`, and a later run of the installer keeps that pin.-- **Repair:** run the install command again. It checks the server, rewrites its own files and leaves `.env` and `data/` alone.+- **Repair:** run the install command again. It checks the server, rewrites its own files and leaves `.env` and `data/` alone. That also moves an install made before Caddy got its own container: Caddy then shared the server's network, and HTTPS went down whenever the server restarted without it.- **Stop:** `--uninstall` stops the server and removes its containers. It deletes nothing: your data stays in `/opt/openmausbot/data`.- **Every other command in this guide** that starts `docker compose` for path B works from `/opt/openmausbot`.- **What the installer contacts:** the registries and Let's Encrypt from the table, GitHub's release list, this repository's files on `raw.githubusercontent.com`, and `cloudflare.com/cdn-cgi/trace` to learn the server's public address for the DNS check. It sends no telemetry.@@ -393,16 +393,32 @@ docker run --rm -v deploy_data:/data -v "$PWD/openmausbot-backup.XXXXXX":/b:ro adocker compose start```-With the installer, the data is a folder, not a volume. Archive it the same way:+With the installer, the data is the folder `/opt/openmausbot/data`. This backs+it up, with `.env`, into a private archive in `/opt/openmausbot`, the whole+project stopped and started again around it:```sh-cd /opt/openmausbot && sudo docker compose stop omb-backup_dir=$(mktemp -d "$PWD/openmausbot-backup.XXXXXX")-sudo tar czf "$backup_dir/openmausbot-data.tgz" -C /opt/openmausbot data-sudo docker compose start omb+cd /opt/openmausbot && sudo docker compose stop && sudo sh -c 'umask 077; tar --warning=no-file-ignored -czf "backup-$(date -u +%Y%m%dT%H%M%SZ).tgz" data .env'; sudo docker compose start```-Each backup creates a fresh private folder in the current directory, so it+Copy the archive to another machine and keep it private.+`--warning=no-file-ignored` keeps tar from listing the sockets in the data+folder, which are not data: the server makes them again when it starts.++To restore an archive, replace `backup-20261110T153000Z.tgz` with its name.+The data as it is now is moved aside to `data.before-restore`, and the archive's+data takes its place, with its owner and permissions. An archive without a+`data/` folder changes nothing:++```sh+cd /opt/openmausbot && sudo docker compose stop && sudo sh -c 'set -e; tar -tzf backup-20261110T153000Z.tgz data/ >/dev/null; rm -rf data.before-restore; mv data data.before-restore; tar -xzpf backup-20261110T153000Z.tgz data'; sudo docker compose start+```++Once MausBot runs on the restored data, remove the old copy:+`sudo rm -rf /opt/openmausbot/data.before-restore`. The restore leaves `.env` as+it is. On a new server, install first with the same `--domain`, then restore.++Each path B backup creates a fresh private folder in the current directory, so itcannot overwrite an older archive with more permissive access. Keep thearchive inside that folder privately on another machine. Restore paths A and Cwith the server stopped, using the same paths and original ownership. After