Access modes
The access mode sets who can use your server's : ACCESS_MODE in server.conf.
| Mode | Who reads | Who writes | What the card does |
|---|---|---|---|
open | anyone who has the card | anyone who has the card | adds the server |
team | members | members | adds the server; with an invite, makes the card holder a member |
channel | everyone, without a key | members | the same; a channel link works even without the card |
You, the owner (ADMIN_PUBKEY, your npub or hex key), are always a member and the one who invites. A server with one relay asks for the mode on the first run (it suggests team) and for your key. A server in a network of several relays, a server joining a network, and a server installed before this setting existed stay open.
veydan-server mode team # or open, channel; then:
veydan-server rerun
veydan-server invite # a card with an invite for one person, valid for 7 days
veydan-server invite --uses 20 --days 30 --label sales
veydan-server invite list # invites and how many times each was used
veydan-server invite revoke <id> # cancels an invite
veydan-server members list
veydan-server members add <npub|hex> # a member without an invite
veydan-server members remove <npub|hex> # no longer a member
veydan-server card --invite <code> # a card with an invite you already haveinvite prints a with the invite (&inv=) and, separately, the code itself, for an app that asks for a code. The relay sees changes to members and invites right away.
A blogger's channel
ACCESS_MODE=channel. You publish, along with the people you've made members: veydan-server members add <npub> or an invite for your editors. Anyone with the channel link reads it without the card and without a key. Only members can write to the relay and upload files. For what this means for the channel, see A channel on your own server.
A company team server
ACCESS_MODE=team. Send each colleague a card with an invite: veydan-server invite --uses 1, or one invite for the whole department with --uses 30. The first app that opens the card becomes a member. A card without an invite only adds the server, and the relay doesn't answer anyone who isn't a member. When someone leaves: veydan-server members remove <npub>.
What to know about the modes
- A mode applies to one relay: members and invites are stored in that relay's vguard, and the other relays in the network don't know about them and don't ask. Install one relay per server; if
MESH_RELAYSlists others, the installer warns you. - Media: with
MEDIA_UPLOAD_KEY=required, only a member can upload with the . The network's other and the channel team's work as before. - Downloading files by hash is open in any mode: anyone who has a file's hash (it's inside the encrypted message) can download the file.
- The
teamandchannelmodes need vguard 0.7.0 or later. If the installed vguard doesn't know the mode, the installer stops, so a team server never ends up open. - Without the owner's key (
ADMIN_PUBKEY), a server inteamorchannelmode isn't installed. - Where things are:
/opt/vguard/data/members.txt(one key per line),/opt/vguard/data/invites.json, and the secret that signs the invites,/opt/vguard/etc/access.key. It's created once; a new secret cancels all invites.