1
0
mirror of https://github.com/aziascreations/BakaShrot.git synced 2026-11-23 20:58:46 +01:00
Files
BakaShrot/Server/Config/schema.ini
T
aziascreations 12fbe5f4da Got close to the final version
comitting Claude's code before the last mile improvements
2026-11-08 13:16:37 +01:00

150 lines
5.5 KiB
INI

; BakaShrot server config file.
; Section names are literal strings as far as PureBasic's Preferences
; library is concerned — the dots below are just part of the name.
;
; Topics and nodes: each has an id (0-65535) on this server, and can have a
; name, in [BakaShrot.Topics] and [BakaShrot.Nodes]. Names are what's shared
; between servers: replication sends them, and each server stores the
; messages under its own ids for them ("logs" can be 1 here and 200 on a
; peer).
; ONLY WHAT'S NAMED ON BOTH SERVERS REPLICATES: a topic or node without a
; name, or whose name the other server doesn't have, is dropped. Unnamed
; ones still work locally, by id.
; Names: 1-64 of A-Z a-z 0-9 _ . -, not only digits, case doesn't matter.
; The server's "names" command and the ListNames tool list them all.
;
; Topic, Node and ReplicatingTopics were TopicId, NodeId and
; ReplicatingTopicIds before: the old names are still read.
;
; Everywhere below, a topic or node can be written as a name or an id.
; Topic lists (and a peer's node lists): names and ids separated by ";",
; ranges of ids (100-150), wildcards like file names (sensors.*, kitchen-??:
; * any characters, ? one, they only match names), or * for every one.
; In a peer's AcceptTopics / AcceptNodes, * and wildcards also take names
; this server doesn't have: they get an id here by themselves, the highest
; free one counting down from 65535 (see them with the "names" command).
[BakaShrot]
; Config shared by every type of config.
; This node's Ed25519 private key (Base64), from KeyGen.exe. It proves who
; this server is: clients seal their Hello for its public key and check
; that it signed the handshake, so they need that public key (client.ini's
; ServerPublicKey, peers' PublicKey below in THEIR own config). The server
; logs it when it starts. See Commons/Networking/Connections.pbi.
PrivateKey =
; The topic and node this server authenticates as when it links to its
; peers, a name or an id. Its peers must register it under the same names.
Topic =
Node =
[BakaShrot.Topics]
; One line per named topic: name = this server's id for it.
; logs = 1
; sensors = 2
[BakaShrot.Nodes]
; One line per named node (a client's or a server's), same as topics. Every
; server that should get a node's messages must name it too.
; Once a name has messages, keep its id: the server refuses to start if the
; config moves it to another one, and says which id to use.
; kitchen = 2
[BakaShrot.Server]
; IPV4 that the server will be bound to.
Host =
; Used port.
Port =
; The topics replicated with every peer that doesn't say otherwise
; (SendTopics, AcceptTopics below).
; Format: logs;0;100-150;... or * for every topic.
ReplicatingTopics =
; Amount of threads used for networking-related tasks.
NetThreadPoolSize = 4
; SQLite database file holding the messages.
DatabasePath = ./test.sqlite
; Seconds to wait before connecting to a peer again, after failing to
; connect or losing the connection.
PeerRetryDelay = 10
; Seconds between two check-ins with a linked peer, where it's sent the
; messages it's missing.
PeerSyncInterval = 5
; Most messages sent to a peer per packet when it's missing some, 1-10000.
; A batch is also cut short at about 64 KB, a bigger message goes alone.
PeerBatchSize = 100
; One [BakaShrot.Peer.<name>] section per peer this node talks to.
; <name> is only a key for this file; it is never sent on the wire.
[BakaShrot.Peer.example]
; Remote address of the peer. Can be a domain name, IPV4 or IPV6.
Host =
; Remote port of the peer (0-65535).
Port =
; The server links to every peer on start, and retries every PeerRetryDelay.
; The peer must register this server in one of its [BakaShrot.Client.<name>].
; The link only goes through if the peer proves it holds the private key
; of PublicKey below, and it's encrypted.
; Remote node's topic and node, names or ids. The peer authenticates with
; them when it links to here.
Topic =
Node =
; The topics sent to this peer (if it takes them), and the topics taken
; from it. Both default to ReplicatingTopics.
; SendTopics = logs;sensors.*
; AcceptTopics = logs;sensors.*
; The nodes whose messages are sent to this peer (default: every one), and
; the nodes whose messages are taken from it (default: the ones named in
; [BakaShrot.Nodes], no other). AcceptNodes = kitchen-* takes every
; kitchen-something the peer sends, named here or not.
; SendNodes = *
; AcceptNodes = kitchen-*;garage
; This peer's Ed25519 public key (Base64), required: the link's Hello is
; sealed for it, and the peer must sign the handshake with its private key.
; It's also the key the peer authenticates with when it links to here.
PublicKey =
; One [BakaShrot.Client.<name>] section per client allowed to connect.
; <name> is only a key for this file; it is never sent on the wire.
[BakaShrot.Client.example]
; Ed25519 public keys (Base64) this client is allowed to authenticate with.
; Format: Key;Key;...
PublicKeys =
; Topic and node pairs this client is allowed to authenticate as, names or ids.
; Format: Topic:Node;Topic:Node;...
Identities =
; The topics it may push to (always under its own node), and the topics it
; may read the latest messages of. Both default to the topics of its
; Identities, empty allows none.
; PushTopics = logs;sensors
; ReadTopics = *
; What this client may do once authenticated, 1 to allow, 0 to deny.
; Read: GetLatestMessage. Write: PushMessage.
; Query: raw read-only SQL, which can read every topic's data, whatever
; ReadTopics says. The "messages" view has the names:
; SELECT * FROM messages WHERE topic = 'logs' AND node = 'kitchen'
AllowRead = 1
AllowWrite = 1
AllowQuery = 0