mirror of
https://github.com/ergochat/ergo.git
synced 2025-12-31 07:18:08 +01:00
Send a configurable NOTICE on first connection that hopm can detect via target_string
This commit is contained in:
parent
b26571e891
commit
13653b5202
@ -180,6 +180,10 @@ server:
|
||||
# if this is true, the motd is escaped using formatting codes like $c, $b, and $i
|
||||
motd-formatting: true
|
||||
|
||||
# send a configurable notice to clients immediately after they connect,
|
||||
# as a way of detecting open proxies
|
||||
#initial-notice: "*** Welcome to the Ergo IRC server"
|
||||
|
||||
# idle timeouts for inactive clients
|
||||
idle-timeouts:
|
||||
# give the client this long to complete connection registration (i.e. the initial
|
||||
|
||||
@ -1072,9 +1072,12 @@ You can import user and channel registrations from an Anope or Atheme database i
|
||||
|
||||
## Hybrid Open Proxy Monitor (HOPM)
|
||||
|
||||
[hopm](https://github.com/ircd-hybrid/hopm) can be used to monitor your server for connections from open proxies, then automatically ban them. To configure hopm to work with Ergo, add operator blocks like this to your Ergo config file, which grant hopm the necessary privileges:
|
||||
[hopm](https://github.com/ircd-hybrid/hopm) can be used to monitor your server for connections from open proxies, then automatically ban them. To configure hopm to work with Ergo, configure `server.initial_notice` and add operator blocks like this to your Ergo config file, which grant hopm the necessary privileges:
|
||||
|
||||
````yaml
|
||||
server:
|
||||
initial-notice: "Welcome to the Ergo IRC server"
|
||||
|
||||
# operator classes
|
||||
oper-classes:
|
||||
# hopm
|
||||
@ -1109,6 +1112,9 @@ opers:
|
||||
Then configure hopm like this:
|
||||
|
||||
````
|
||||
/* replace with the exact notice your server sends on first connection */
|
||||
target_string = ":ergo.test NOTICE * :*** Welcome to the Ergo IRC server"
|
||||
|
||||
/* ergo */
|
||||
connregex = ".+-.+CONNECT.+-.+ Client Connected \\[([^ ]+)\\] \\[u:([^ ]+)\\] \\[h:([^ ]+)\\] \\[ip:([^ ]+)\\] .+";
|
||||
|
||||
|
||||
@ -414,6 +414,11 @@ func (server *Server) RunClient(conn IRCConn) {
|
||||
session.certfp, session.peerCerts, _ = utils.GetCertFP(wConn.Conn, RegisterTimeout)
|
||||
}
|
||||
|
||||
if config.Server.InitialNotice != "" {
|
||||
// send initial notice for HOPM to recognize
|
||||
client.Send(nil, client.server.name, "NOTICE", "*", config.Server.InitialNotice)
|
||||
}
|
||||
|
||||
if session.isTor {
|
||||
session.rawHostname = config.Server.TorListeners.Vhost
|
||||
client.rawHostname = session.rawHostname
|
||||
|
||||
@ -580,7 +580,8 @@ type Config struct {
|
||||
CoerceIdent string `yaml:"coerce-ident"`
|
||||
MOTD string
|
||||
motdLines []string
|
||||
MOTDFormatting bool `yaml:"motd-formatting"`
|
||||
MOTDFormatting bool `yaml:"motd-formatting"`
|
||||
InitialNotice string `yaml:"initial-notice"`
|
||||
IdleTimeouts struct {
|
||||
Registration time.Duration
|
||||
Ping time.Duration
|
||||
|
||||
@ -154,6 +154,10 @@ server:
|
||||
# if this is true, the motd is escaped using formatting codes like $c, $b, and $i
|
||||
motd-formatting: true
|
||||
|
||||
# send a configurable notice to clients immediately after they connect,
|
||||
# as a way of detecting open proxies
|
||||
#initial-notice: "*** Welcome to the Ergo IRC server"
|
||||
|
||||
# idle timeouts for inactive clients
|
||||
idle-timeouts:
|
||||
# give the client this long to complete connection registration (i.e. the initial
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user