From e110560515e2828369f3dd36bb87dfa2752f3e53 Mon Sep 17 00:00:00 2001 From: A_D Date: Sun, 18 Nov 2018 17:35:11 +0200 Subject: [PATCH] made servers configurable --- config.json.example | 3 +++ src/config.go | 20 ++++++++++++-------- src/main.go | 2 +- 3 files changed, 16 insertions(+), 9 deletions(-) diff --git a/config.json.example b/config.json.example index eb8bae0..37943cb 100644 --- a/config.json.example +++ b/config.json.example @@ -5,6 +5,9 @@ "nick": "ADGitea", "ident": "gitea", "realname": "gitea", + "server_host": "irc.snoonet.org", + "server_port": "6697", + "ssl": true, "ns_nick": "", "ns_passwd": "", "chans_to_join": [ diff --git a/src/config.go b/src/config.go index 771b4ba..5c4d530 100644 --- a/src/config.go +++ b/src/config.go @@ -7,14 +7,18 @@ import ( ) type Config struct { - Secret string `json:"secret"` - BindHost string `json:"bind_host"` - BindPort string `json:"bind_port"` - Nick string `json:"nick"` - Ident string `json:"ident"` - Realname string `json:"realname"` - NsNick string `json:"ns_nick"` - NsPasswd string `json:"ns_passwd"` + Secret string `json:"secret"` + BindHost string `json:"bind_host"` + BindPort string `json:"bind_port"` + ServerHost string `json:"server_host"` + ServerPort string `json:"server_port"` + ServerSSL bool `json:"server_ssl"` + ServerName string `json:"server_name"` + Nick string `json:"nick"` + Ident string `json:"ident"` + Realname string `json:"realname"` + NsNick string `json:"ns_nick"` + NsPasswd string `json:"ns_passwd"` ChansToJoin []string `json:"chans_to_join"` } diff --git a/src/main.go b/src/main.go index f5adb10..1f8e0bd 100644 --- a/src/main.go +++ b/src/main.go @@ -21,7 +21,7 @@ func main() { MsgChan: msgChan, } - bot := newBot(bc, "chimera.snoonet.org", "6697", "snoonet", true) + bot := newBot(bc, config.ServerHost, config.ServerPort, config.ServerName, config.ServerSSL) go bot.run() ListenForWebHook(config, msgChan)