bahamut icon indicating copy to clipboard operation
bahamut copied to clipboard

Add SVSCTRL command to let services control services join requests and configuration files

Open kobishmueli opened this issue 7 years ago • 7 comments

To enable services join requests, services will send: SVSCTRL server.dal.net SJR 1

To disable services join requests, services will send: SVSCTRL server.dal.net SJR 0

(server.dal.net can be replaced by * to send it to all servers)

To get the list of supported configuration files, services will send: SVSCTRL server.dal.net CONF STATUS * The server will reply:

PRIVMSG <sender> :CONF STATUS <file1> <file-size> <modified-time> <md5-sha>
PRIVMSG <sender> :CONF STATUS <file2> <file-size> <modified-time> <md5-sha>
PRIVMSG <sender> :CONF STATUS <file3> <file-size> <modified-time> <md5-sha>

To get the status of ircd.conf, services will send: SVSCTRL server.dal.net CONF STATUS ircd.conf The server will reply: PRIVMSG <sender> :CONF STATUS ircd.conf <file-size> <modified-time> <md5-sha>

To get the ircd.conf file from the server, services will send: SVSCTRL server.dal.net CONF READ ircd.conf The server will send:

PRIVMSG <sender> :CONF <file> SOF <file-size> <modified-time>
PRIVMSG <sender> :CONF <file> <line-number> :<line-text>
PRIVMSG <sender> :CONF <file> EOF <number-of-lines> <file-size> <md5-sha>

To update the ircd.conf file, services will send:

SVSCTRL server.dal.net CONF WRITE ircd.conf SOF
SVSCTRL server.dal.net CONF WRITE ircd.conf <line-number> :<line-text>
SVSCTRL server.dal.net CONF WRITE ircd.conf EOF <number-of-lines> <file-size> <md5-sha>

The server will reply: PRIVMSG <sender> :CONF WRITE ircd.conf EOF OK or: PRIVMSG <sender> :CONF WRITE ircd.conf EOF ERROR :<reason>

-Kobi.

kobishmueli avatar Dec 12 '18 08:12 kobishmueli

Interesting. Lots to digest here. How has testing gone for this?

eaescob avatar Dec 14 '18 16:12 eaescob

      Interesting. Lots to digest here. How has testing gone for this?

I did a few quick sanity checks on the testnet for it, i.e.:

  1. Get a file status: :OperServ SVSCTRL test1.* CONF STATUS /etc/rc.conf
  2. Get the status of all files: :OperServ SVSCTRL hideout.* CONF STATUS *
  3. Write a test conf file:
:OperServ SVSCTRL test1.* CONF WRITE dalnet.conf SOF
:OperServ SVSCTRL test1.* CONF WRITE dalnet.conf 1 :This is a test...
:OperServ SVSCTRL test1.* CONF WRITE dalnet.conf EOF 1 18 c56c8063d58e9bc9b3fb0dc03fe531b0
  1. Read a file: :OperServ SVSCTRL test1.* CONF READ /etc/rc.conf
  2. Tried to break ircd.conf to make sure it reverts the previous config back.

It looks fine but I will do more tests once stats.* will support it :)

-Kobi.

kobishmueli avatar Dec 14 '18 16:12 kobishmueli

Great! I will hold off merging until you have

eaescob avatar Dec 19 '18 18:12 eaescob

Is this still needed?

eaescob avatar May 04 '19 05:05 eaescob

Is this still needed?

Yes, I reviewed it again and did a few more sanity checks and it looks fine.

-Kobi.

kobishmueli avatar Apr 25 '20 04:04 kobishmueli

Some conflicts that need to be resolved, can you please check?

eaescob avatar May 15 '20 17:05 eaescob

Stale pull request message

github-actions[bot] avatar Jul 15 '20 00:07 github-actions[bot]