Add auto_ctcp config option
This commit is contained in:
parent
fcf0c17682
commit
2ea4584c97
@ -112,6 +112,7 @@ func init() {
|
|||||||
viper.BindPFlags(rootCmd.PersistentFlags())
|
viper.BindPFlags(rootCmd.PersistentFlags())
|
||||||
viper.BindPFlags(rootCmd.Flags())
|
viper.BindPFlags(rootCmd.Flags())
|
||||||
|
|
||||||
|
viper.SetDefault("auto_ctcp", true)
|
||||||
viper.SetDefault("verify_certificates", true)
|
viper.SetDefault("verify_certificates", true)
|
||||||
viper.SetDefault("https.enabled", true)
|
viper.SetDefault("https.enabled", true)
|
||||||
viper.SetDefault("https.port", 443)
|
viper.SetDefault("https.port", 443)
|
||||||
|
@ -3,6 +3,10 @@ address = ""
|
|||||||
port = 80
|
port = 80
|
||||||
# Hex encode the users IP and use it as the ident
|
# Hex encode the users IP and use it as the ident
|
||||||
hexIP = false
|
hexIP = false
|
||||||
|
# Automatically reply to common CTCP messages
|
||||||
|
auto_ctcp = true
|
||||||
|
# Verify the certificate chain presented by the IRC server, if this check fails
|
||||||
|
# the user will be able to choose to still connect
|
||||||
verify_certificates = true
|
verify_certificates = true
|
||||||
|
|
||||||
# Defaults for the client connect form
|
# Defaults for the client connect form
|
||||||
@ -63,11 +67,11 @@ secret = ""
|
|||||||
|
|
||||||
[dcc]
|
[dcc]
|
||||||
# Receive files through DCC, the user gets to choose if they want to accept the file,
|
# Receive files through DCC, the user gets to choose if they want to accept the file,
|
||||||
# the file then gets streamed to the user
|
# the file download then gets proxied to the user
|
||||||
enabled = true
|
enabled = true
|
||||||
|
|
||||||
[dcc.autoget]
|
[dcc.autoget]
|
||||||
# Instead of streaming the file to the user, dispatch automatically downloads
|
# Instead of proxying the file download directly to the user, dispatch automatically downloads
|
||||||
# DCC files and sends a download link to the user once its done
|
# DCC files and sends a download link to the user once its done
|
||||||
enabled = false
|
enabled = false
|
||||||
# Delete the file after the user has downloaded it once
|
# Delete the file after the user has downloaded it once
|
||||||
@ -75,7 +79,7 @@ delete = true
|
|||||||
# Delete the file after a certain time period of inactivity, not implemented yet
|
# Delete the file after a certain time period of inactivity, not implemented yet
|
||||||
delete_after = "30m"
|
delete_after = "30m"
|
||||||
|
|
||||||
# Strict-Transport-Security
|
# HTTP Strict-Transport-Security
|
||||||
[https.hsts]
|
[https.hsts]
|
||||||
enabled = false
|
enabled = false
|
||||||
max_age = 31536000
|
max_age = 31536000
|
||||||
|
@ -13,6 +13,7 @@ type Config struct {
|
|||||||
Port string
|
Port string
|
||||||
Dev bool
|
Dev bool
|
||||||
HexIP bool
|
HexIP bool
|
||||||
|
AutoCTCP bool `mapstructure:"auto_ctcp"`
|
||||||
VerifyCertificates bool `mapstructure:"verify_certificates"`
|
VerifyCertificates bool `mapstructure:"verify_certificates"`
|
||||||
Headers map[string]string
|
Headers map[string]string
|
||||||
Defaults Defaults
|
Defaults Defaults
|
||||||
|
@ -25,6 +25,8 @@ type Config struct {
|
|||||||
Account string
|
Account string
|
||||||
Password string
|
Password string
|
||||||
|
|
||||||
|
// Automatically reply to common CTCP messages
|
||||||
|
AutoCTCP bool
|
||||||
// Version is the reply to VERSION and FINGER CTCP messages
|
// Version is the reply to VERSION and FINGER CTCP messages
|
||||||
Version string
|
Version string
|
||||||
// Source is the reply to SOURCE CTCP messages
|
// Source is the reply to SOURCE CTCP messages
|
||||||
|
@ -58,9 +58,11 @@ func (c *Client) handleMessage(msg *Message) {
|
|||||||
msg.meta = c.state.renameUser(msg.Sender, msg.LastParam())
|
msg.meta = c.state.renameUser(msg.Sender, msg.LastParam())
|
||||||
|
|
||||||
case PRIVMSG:
|
case PRIVMSG:
|
||||||
|
if c.Config.AutoCTCP {
|
||||||
if ctcp := msg.ToCTCP(); ctcp != nil {
|
if ctcp := msg.ToCTCP(); ctcp != nil {
|
||||||
c.handleCTCP(ctcp, msg)
|
c.handleCTCP(ctcp, msg)
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
case MODE:
|
case MODE:
|
||||||
if len(msg.Params) > 1 {
|
if len(msg.Params) > 1 {
|
||||||
|
@ -30,7 +30,9 @@ func createNickInUseHandler(i *irc.Client, state *State) func(string) string {
|
|||||||
|
|
||||||
func connectIRC(network *storage.Network, state *State, srcIP []byte) *irc.Client {
|
func connectIRC(network *storage.Network, state *State, srcIP []byte) *irc.Client {
|
||||||
cfg := state.srv.Config()
|
cfg := state.srv.Config()
|
||||||
|
|
||||||
ircCfg := network.IRCConfig()
|
ircCfg := network.IRCConfig()
|
||||||
|
ircCfg.AutoCTCP = cfg.AutoCTCP
|
||||||
|
|
||||||
if ircCfg.TLS {
|
if ircCfg.TLS {
|
||||||
ircCfg.TLSConfig = &tls.Config{
|
ircCfg.TLSConfig = &tls.Config{
|
||||||
|
Loading…
Reference in New Issue
Block a user