]> mop.ddnsfree.com - git repositories - brisk.git/commit
let the daemon listen on tcp, so it can run on its own machine
authorMatteo Nastasi <nastasi@alternativeoutput.it>
Mon, 21 Sep 2026 07:46:34 +0000 (07:46 +0000)
committerMatteo Nastasi <nastasi@alternativeoutput.it>
Mon, 21 Sep 2026 07:46:34 +0000 (07:46 +0000)
commit155ed4383f822ca83b5e80cfe952518a60d94174
treeb6af37d0d2461d9707216c15d4bfb859dfc6c116
parentf93f192fffe0659f367b576c80ea06984c3ccca2
let the daemon listen on tcp, so it can run on its own machine

The listening sockets had "unix://" written into Sac_a_push::create, so
the daemon and the frontend had to share a filesystem. USOCK_PATH_PFX can
now also be an address, "tcp://<host>:<port>", and then the pool is the
ports <port>..<port>+USOCK_POOL_N-1 with <port>+USOCK_POOL_N for the
control channel, mirroring the unix names one for one. A prefix without a
scheme keeps meaning exactly what it meant, so nothing changes for an
installation on a single machine.

spu_listen_url() and spu_admin_url() in spush/brisk-spush.phh do the
translation, and they live there because usermgmt.php includes that file
for USOCK_PATH_PFX and reaches the control channel through it. The
unlink of stale socket files is now skipped when there is no file to
unlink, and a failed bind says which address it failed on instead of
returning FALSE in silence.

What made this small is that the frontend and the daemon share no state
but the database. The System V shared memory - challenges, hardbans, the
room - is only ever touched from the nine endpoints the daemon serves;
usermgmt.php, mailmgr.php, error.php and the briskin5 statistics pages
include auth.phh for its database classes and never call
Challenges::load_data(). Under the old descriptor handover that bridge
did exist; moving to direct http had already dissolved it.

Two things the address form changes, both written out in brisk-spush.phh
and in the nginx template: the daemon still believes X-Real-Ip, which is
what the bans and the blacklist are built on, so a port anybody can reach
is a way around every ban; and it still speaks plain http, so the session
cookies cross the network in clear.

Checked end to end: with -U tcp://127.0.0.1:8090 the daemon listens on
8090..8100, answers on several ports of the pool, and 60 players through
nginx over that upstream complete with no error and clean stream
integrity, gzip included. Back on a unix prefix everything is as before.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
system/nginx/brisk.conf
web/Obj/sac-a-push.phh
web/spush/brisk-spush.phh
web/usermgmt.php