aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--config.go27
-rw-r--r--doc/config.md10
-rw-r--r--run.go7
3 files changed, 30 insertions, 14 deletions
diff --git a/config.go b/config.go
index e141bbc..6db6dda 100644
--- a/config.go
+++ b/config.go
@@ -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
diff --git a/run.go b/run.go
index 80001c7..dde772b 100644
--- a/run.go
+++ b/run.go
@@ -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")
}