Command line
text
moin-server [--config <path>] run the server
moin-server [--config <path>] admin [--json] <command> administer a running serverOptions
| Option | Meaning |
|---|---|
--config <path> | The configuration file. Defaults to the MOIN_CONFIG environment variable, then moin-server.toml in the current directory. It can go anywhere on the command line. |
--help | Describe the options. Works after any command, e.g. moin-server admin invites --help. |
--version | Print the version. |
Run without a command, moin-server starts the server and runs until it's stopped. See Running the server.
Administration
moin-server admin changes a server while it runs: members, roles, invitations and rooms. It talks to the server over a socket in its data directory, which it finds through the same configuration file. So:
- The server has to be running.
- Run it on the same machine, as the same OS user as the server. Being that user is what makes you the server's administrator; no password is involved.
- Use the same build of
moin-serveras the running server.
Results print as a table. Add --json for the same data as JSON, for scripts. Commands that change something print nothing when they succeed. Errors go to standard error, and the command exits with a non-zero status.
The server's access mode, password and whether invitations are enabled come from the configuration file, and can't be changed from here.
Every command that changes something is recorded in the server's audit log.
status
sh
moin-server admin statusThe server ID, its hostname if it has one, the access settings, whether an administrator can still be claimed with the bootstrap secret, and every connected device with its nickname and room.
text
Coordinator 7f31a7a6e56661e4711f3e0884ad27eed013b0900e787a9f668353ba93da4243
Origin https://chat.example.com
Access protected (password disabled, invites enabled)
Bootstrap closed
Connected 1
DEVICE NICKNAME ROOM
0wpyqfatk0d0h1vmqq7t894xhf5e5dm1xc5qnr9ar74p3y8hgz85 sam 00000000000000000000000001This is the easiest way to find someone's device ID: ask them to connect, and look for their nickname. The app shows the last eight characters of a device ID in each member's menu.
devices
| Command | Effect |
|---|---|
devices list | Every member device, with its role, how it joined, and when. |
devices add <device-id> | Make a device a member without a password or invitation. |
devices revoke <device-id> | Remove a device's membership and role, and disconnect it. Works on any device, administrators included. |
devices revoke --all | The same for every device except administrators. |
Revoking isn't a ban: if the device still has a working password or invitation, it can join again. See Removing someone.
invites
| Command | Effect |
|---|---|
invites create [--role admin|moderator] [--max-claims <n>] [--expires-in <time>] | Create an invitation and print its link. |
invites list | Every invitation, with its role, when it was created, when it expires, and how often it's been used. Never the link. |
invites revoke <invite-id> | Stop an invitation from being used. |
invites revoke --all | Stop every invitation. |
--expires-in takes seconds or a number with a unit: 90s, 30m, 12h, 7d, 2w. --max-claims is how many devices may join with the link. Leave either out for no limit.
--role makes the device that joins with the link an administrator or moderator; see Invitations with a role.
The link is printed once and can't be shown again: the server only keeps a fingerprint of it. Invitations only work when invites_enabled = true; see Invitations.
Expiring or revoking an invitation only stops new devices from using it. Devices that already joined with it stay members.
roles
sh
moin-server admin roles set <device-id> admin|moderator|noneGive a device a role, or take it away with none. A device that isn't a member yet becomes one. Unlike in the app, this works on the last administrator too, so you can always recover a community whose administrator lost their device. See Roles.
rooms
| Command | Effect |
|---|---|
rooms list | Every room, with its ID, name and member limit. |
rooms create <name> [--max-members <n>] | Create a room and print it. |
rooms edit <room-id> <name> [--max-members <n>] | Rename a room and set its member limit. |
rooms delete <room-id> | Delete a room. Anyone in it is moved out. |
Put names with spaces in quotes: rooms create "Team room".
edit replaces both the name and the limit, so leaving out --max-members makes the room unlimited. A room that reaches its limit turns away new arrivals; nobody already in it is removed.
Creating, editing and deleting only work with rooms = "managed". rooms list works either way.
