forked from External/ergo
Support network name
This commit is contained in:
parent
c88cd328f8
commit
a013205fd1
3 changed files with 20 additions and 6 deletions
|
|
@ -21,14 +21,18 @@ func (conf *PassConfig) PasswordBytes() []byte {
|
||||||
}
|
}
|
||||||
|
|
||||||
type Config struct {
|
type Config struct {
|
||||||
|
Network struct {
|
||||||
|
Name string
|
||||||
|
}
|
||||||
|
|
||||||
Server struct {
|
Server struct {
|
||||||
PassConfig
|
PassConfig
|
||||||
|
Name string
|
||||||
Database string
|
Database string
|
||||||
Listen []string
|
Listen []string
|
||||||
Wslisten string
|
Wslisten string
|
||||||
Log string
|
Log string
|
||||||
MOTD string
|
MOTD string
|
||||||
Name string
|
|
||||||
}
|
}
|
||||||
|
|
||||||
Operator map[string]*PassConfig
|
Operator map[string]*PassConfig
|
||||||
|
|
@ -67,6 +71,9 @@ func LoadConfig(filename string) (config *Config, err error) {
|
||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if config.Network.Name == "" {
|
||||||
|
return nil, errors.New("Network name missing")
|
||||||
|
}
|
||||||
if config.Server.Name == "" {
|
if config.Server.Name == "" {
|
||||||
return nil, errors.New("Server name missing")
|
return nil, errors.New("Server name missing")
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -91,7 +91,7 @@ func NewServer(config *Config) *Server {
|
||||||
server.isupport.Add("KICKLEN", "") //TODO(dan): Support kick length?
|
server.isupport.Add("KICKLEN", "") //TODO(dan): Support kick length?
|
||||||
server.isupport.Add("MAXLIST", "") //TODO(dan): Support max list length?
|
server.isupport.Add("MAXLIST", "") //TODO(dan): Support max list length?
|
||||||
server.isupport.Add("MODES", "") //TODO(dan): Support max modes?
|
server.isupport.Add("MODES", "") //TODO(dan): Support max modes?
|
||||||
server.isupport.Add("NETWORK", "NetNameHere") //TODO(dan): Support network name
|
server.isupport.Add("NETWORK", config.Network.Name)
|
||||||
server.isupport.Add("NICKLEN", "") //TODO(dan): Support nick length
|
server.isupport.Add("NICKLEN", "") //TODO(dan): Support nick length
|
||||||
server.isupport.Add("PREFIX", "(ov)@+")
|
server.isupport.Add("PREFIX", "(ov)@+")
|
||||||
server.isupport.Add("STATUSMSG", "@+") //TODO(dan): Autogenerate based on PREFIXes, make sure it's actually supported
|
server.isupport.Add("STATUSMSG", "@+") //TODO(dan): Autogenerate based on PREFIXes, make sure it's actually supported
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,11 @@
|
||||||
# oragono IRCd config
|
# oragono IRCd config
|
||||||
|
|
||||||
|
# network configuration
|
||||||
|
network:
|
||||||
|
# name of the network
|
||||||
|
name: OragonoTest
|
||||||
|
|
||||||
|
# server configuration
|
||||||
server:
|
server:
|
||||||
# server name
|
# server name
|
||||||
name: oragono.test
|
name: oragono.test
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue