1
0
mirror of https://blitiri.com.ar/repos/chasquid synced 2026-01-07 17:47:14 +00:00

chasquid-util: Use server for aliases-resolve and domaininfo-remove

This patch makes chasquid-util's aliases-resolve and domaininfo-remove
commands talk to the chasquid server (via the new localrpc server).

For aliases-resolve, currently has fairly hacky logic which reimplements
a bunch of the servers', and is also incomplete because it does not
support hooks.

In this patch we fix that by having it talk to the server, where we get
authoritative responses and have no issues with aliases hooks. This
resolves https://github.com/albertito/chasquid/issues/18.

For domaininfo-remove, currently its implementation is also very hacky
since it manipulates files behind the servers' back and without even
using the internal library.

In this patch we fix that by doing the operation through the server,
avoiding the need for those hacks, and also remove the need to manually
reload the server afterwards.
This commit is contained in:
Alberto Bertogli
2023-07-29 22:49:50 +01:00
parent ddd1b6d96e
commit e6c6df457d
13 changed files with 147 additions and 72 deletions

View File

@@ -62,5 +62,19 @@ then
fail "B is missing the domaininfo for srv-a"
fi
# In A, remove domaininfo data about srv-B.
# Check that it was cleared successfully.
CONFDIR=A chasquid-util domaininfo-remove srv-b
if grep -q 'outgoing_sec_level:' ".data-A/domaininfo/s:srv-b";
then
fail "Error clearing A's domaininfo about srv-b"
fi
# While at it, check that a domaininfo-remove for an unknown domain results in
# an error.
if CONFDIR=A chasquid-util domaininfo-remove srv-X > .cdu-di-r-x.log 2>&1; then
fail "Expected error on chasquid-util domaininfo-remove srv-X"
fi
success