mirror of
https://github.com/ergochat/ergo.git
synced 2025-12-20 02:00:11 -08:00
persistent channels persisted to a sqlite db
This commit is contained in:
parent
de5538f5d5
commit
02abeeb164
6 changed files with 112 additions and 5 deletions
|
|
@ -26,6 +26,11 @@ type Config struct {
|
|||
Name string
|
||||
Operators []OperatorConfig
|
||||
Password string
|
||||
directory string
|
||||
}
|
||||
|
||||
func (conf *Config) Database() string {
|
||||
return filepath.Join(conf.directory, "ergonomadic.db")
|
||||
}
|
||||
|
||||
func (conf *Config) PasswordBytes() []byte {
|
||||
|
|
@ -75,9 +80,8 @@ func LoadConfig(filename string) (config *Config, err error) {
|
|||
return
|
||||
}
|
||||
|
||||
dir := filepath.Dir(filename)
|
||||
config.MOTD = filepath.Join(dir, config.MOTD)
|
||||
|
||||
config.directory = filepath.Dir(filename)
|
||||
config.MOTD = filepath.Join(config.directory, config.MOTD)
|
||||
for _, lconf := range config.Listeners {
|
||||
if lconf.Net == "" {
|
||||
lconf.Net = "tcp"
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue