1
0
mirror of https://github.com/aziascreations/BakaShrot.git synced 2026-11-23 20:58:46 +01:00

Made the roles the only lists of topics, Refused PRAGMAs in queries

- Removed `[server] topics` and `[replication] replicated_topics`: a push
  is taken by its roles' `push_topics`, a replicated message by the
  peer's `accept_topics`; a topic exists from its first message.
- Topics that only came from a peer are read and listed like any other;
  `ListNames` lists the topics with messages, filtered by the roles.
- A push to a topic no role names is `NotAllowed`; `UnknownName` is only
  for nodes.
- Clients' queries: every PRAGMA refused as it's prepared (SQLite's
  authorizer), `PRAGMA query_only = 0` used to take effect.
- Noted the leads found by reading the code in `docs/known-issues.md`.

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
This commit is contained in:
2026-11-16 01:28:24 +01:00
parent cef99102f9
commit cf8264b21d
34 changed files with 304 additions and 227 deletions
+3 -7
View File
@@ -20,9 +20,6 @@ key = "server-1.key"
database = "bakashrot.sqlite"
# The topics clients push to. Peers may bring others (accept_topics).
topics = ["logs", "sensors.kitchen", "sensors.garage"]
# "full": every push flushed to disk before it's answered, it survives a
# power loss. "normal": about twice the pushes, a power loss loses the last
# second or so. ("off" isn't allowed.)
@@ -44,16 +41,15 @@ logs = "30d"
[replication]
push_to = [] # dialed and sent to: ["10.0.0.2:7000", "server-2.lan:7000"]
accept_from = [] # taken from: ["10.0.0.2", "server-2.lan"], or ["*"]
# The only topics replicated at all, whatever the roles say: a filter for
# edge nodes. Without it, no filter; [] replicates nothing.
# replicated_topics = ["logs", "alerts.*"]
retry_delay = "10s"
sync_interval = "5s"
batch_size = 1000 # messages per packet, 1-10000
# What certificates with a role may do. A certificate gets everything its
# roles allow; one without any role listed here is refused. Every key is
# optional: an empty list allows nothing.
# optional: an empty list allows nothing. The topics are only named here:
# one exists from its first message, pushed (push_topics) or replicated
# (accept_topics).
[roles.sensor]
push_topics = ["sensors.*"] # always as its own node (its name)