Add SVSCTRL command to let services control services join requests and configuration files#94
Add SVSCTRL command to let services control services join requests and configuration files#94kobishmueli wants to merge 1 commit intoDALnet:masterfrom
Conversation
…d configuration files 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.
|
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.:
It looks fine but I will do more tests once stats.* will support it :) -Kobi. |
|
Great! I will hold off merging until you have |
|
Is this still needed? |
Yes, I reviewed it again and did a few more sanity checks and it looks fine. -Kobi. |
| sendto_one(sptr, ":%s PRIVMSG %s :CONF %s SOF %ld %ld", me.name, parv[0], fn, sb.st_size, sb.st_mtime); | ||
| while(fgets(line, BUFSIZE, f) != NULL) | ||
| { | ||
| while((tmp = strchr(line,'\r'))) *tmp = '\0'; | ||
| while((tmp = strchr(line,'\n'))) *tmp = '\0'; | ||
| line_counter++; | ||
| sendto_one(sptr, ":%s PRIVMSG %s :CONF %s %d :%s", me.name, parv[0], fn, line_counter, line); | ||
| } | ||
| sendto_one(sptr, ":%s PRIVMSG %s :CONF %s EOF %d %ld %s", me.name, parv[0], fn, line_counter, sb.st_size, md5file(fn)); |
There was a problem hiding this comment.
I think all of the replies for reading should have the "READ" parameter before the file name to be consistent with the rest of the system
:%s PRIVMSG %s :CONF READ %s SOF %ld %d instead of :%s PRIVMSG %s :CONF %s SOF %ld %ld
The same for the line replies and the EOF reply.
|
Some conflicts that need to be resolved, can you please check? |
|
Stale pull request message |
To enable services join requests, services will send:
SVSCTRL server.dal.net SJR 1To 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:
To get the status of ircd.conf, services will send:
SVSCTRL server.dal.net CONF STATUS ircd.confThe 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.confThe server will send:
To update the ircd.conf file, services will send:
The server will reply:
PRIVMSG <sender> :CONF WRITE ircd.conf EOF OKor:
PRIVMSG <sender> :CONF WRITE ircd.conf EOF ERROR :<reason>-Kobi.