diff --git a/LICENSE b/LICENSE index f7e2db5..52705fc 100644 --- a/LICENSE +++ b/LICENSE @@ -1,5 +1,5 @@ Copyright 2021 Shokara Kou -Copyright 2022, 2023 Izuru Yakumo +Copyright 2022-2024 Izuru Yakumo Permission to use, copy, modify, and distribute this software for any purpose with or without fee is hereby granted, provided that the above copyright notice diff --git a/cmd/tokiko/main.go b/cmd/tokiko/main.go index 4b78508..58edd64 100644 --- a/cmd/tokiko/main.go +++ b/cmd/tokiko/main.go @@ -37,12 +37,12 @@ func parseconfig(file string) error { if err != nil { return err } - conf.port = cfg.Section("").Key("port").String() - conf.addr = cfg.Section("").Key("addr").String() - conf.hostname = cfg.Section("").Key("hostname").String() - conf.rootdir = cfg.Section("").Key("rootdir").String() - conf.user = cfg.Section("").Key("user").String() - conf.group = cfg.Section("").Key("group").String() + conf.port = cfg.Section("tokiko").Key("port").String() + conf.addr = cfg.Section("tokiko").Key("addr").String() + conf.hostname = cfg.Section("tokiko").Key("hostname").String() + conf.rootdir = cfg.Section("tokiko").Key("rootdir").String() + conf.user = cfg.Section("tokiko").Key("user").String() + conf.group = cfg.Section("tokiko").Key("group").String() return nil } @@ -172,15 +172,14 @@ func main() { flag.StringVar(&configfile, "f", "", "Configuration file") flag.Parse() - if configfile != "" { - parseconfig(configfile) - } - conf.addr = "127.0.0.1" conf.port = "70" conf.hostname = "localhost" conf.rootdir = "/var/gopher" + if configfile != "" { + parseconfig(configfile) + } LISTEN_ADDR := conf.addr + ":" + conf.port if conf.user != "" { diff --git a/example/tokiko.ini b/example/tokiko.ini index 537f6f6..d5099b0 100644 --- a/example/tokiko.ini +++ b/example/tokiko.ini @@ -1,3 +1,4 @@ +[tokiko] # IP address to listen on addr = "127.0.0.1" # TCP port to listen on @@ -11,5 +12,3 @@ rootdir = "/var/gopher" # be used. # user = tokiko # group = tokiko - - diff --git a/Gophermap b/gophermap similarity index 100% rename from Gophermap rename to gophermap