diff options
-rw-r--r-- | config.go | 27 | ||||
-rw-r--r-- | doc/config.md | 10 | ||||
-rw-r--r-- | run.go | 7 |
3 files changed, 30 insertions, 14 deletions
@@ -34,19 +34,20 @@ type Server struct { // A Config contains information from the configuration file // that affects the way the proxy works. type Config struct { - NoPlugins bool - CmdPrefix string - RequirePasswd bool - SendInterval float32 - UserLimit int - AuthBackend string - NoTelnet bool - TelnetAddr string - BindAddr string - Servers map[string]Server - ForceDefaultSrv bool - FallbackServers []string - CSMRF struct { + NoPlugins bool + CmdPrefix string + RequirePasswd bool + SendInterval float32 + UserLimit int + AuthBackend string + AuthPostgresConn string + NoTelnet bool + TelnetAddr string + BindAddr string + Servers map[string]Server + ForceDefaultSrv bool + FallbackServers []string + CSMRF struct { NoCSMs bool ChatMsgs bool ItemDefs bool diff --git a/doc/config.md b/doc/config.md index e715a90..1b1c917 100644 --- a/doc/config.md +++ b/doc/config.md @@ -63,10 +63,18 @@ Description: The maximum number of players that can be connected to the proxy at ``` Type: string Default: "files" -Values: "files", "mtsqlite3" +Values: "files", "mtsqlite3", "mtpostgresql" Description: The authentication backend to use. Consider converting your existing database instead of loading it directly. ``` +> `AuthPostgresConn` +``` +Type: string +Default: "" +Description: The postgres connection string for the authentication database. +Used in conjunction with the mtpostgresql authentication backend. +``` + > `NoTelnet` ``` Type: bool @@ -34,6 +34,13 @@ func runFunc() { } setAuthBackend(ab) + case "mtpostgresql": + ab, err := NewAuthMTPostgreSQL(Conf().AuthPostgresConn) + if err != nil { + log.Fatal(err) + } + + setAuthBackend(ab) default: log.Fatal("invalid auth backend") } |