mirror of
https://github.com/NginxProxyManager/nginx-proxy-manager.git
synced 2026-11-21 21:16:42 +00:00
Dabase setup widget
This commit is contained in:
1 parent
853ef909a7
commit
741c9c982f
25 files changed
+1133
-66
No files matched your search
@@ -0,0 +1,38 @@
|
||||
package schema
|
||||
|
||||
import "fmt"
|
||||
|
||||
// SetupDatabase is the schema for incoming data validation.
|
||||
// Fields required by postgres and mysql are checked by
|
||||
// config.DBConfig.IsValid once the driver is known.
|
||||
func SetupDatabase() string {
|
||||
stdField := stringMinMax(1, 255)
|
||||
return fmt.Sprintf(`
|
||||
{
|
||||
"type": "object",
|
||||
"additionalProperties": false,
|
||||
"required": [
|
||||
"driver"
|
||||
],
|
||||
"properties": {
|
||||
"driver": {
|
||||
"type": "string",
|
||||
"enum": ["sqlite", "postgres", "mysql"]
|
||||
},
|
||||
"host": %s,
|
||||
"port": {
|
||||
"type": "integer",
|
||||
"minimum": 1,
|
||||
"maximum": 65535
|
||||
},
|
||||
"username": %s,
|
||||
"password": %s,
|
||||
"name": %s,
|
||||
"sslmode": {
|
||||
"type": "string",
|
||||
"enum": ["disable", "allow", "prefer", "require", "verify-ca", "verify-full"]
|
||||
}
|
||||
}
|
||||
}
|
||||
`, stdField, stdField, stringMinMax(0, 255), stdField)
|
||||
}
|
||||
Reference in new issue
Block a user