mirror of
https://github.com/ngoduykhanh/wireguard-ui.git
synced 2025-06-07 00:46:58 +03:00

The specific datastore backend to use can now be set by using command line options or by using environment variables. The default datastore backend is still jsondb but mysql can now also be used as a backend. Environment variables have also been added to control settings relevant to the database. SQL queries are made by directly accessing the database/sql API. TLS is also supported. Signed-off-by: Matthew Nickson <mnickson@sidingsmedia.com>
39 lines
933 B
Go
39 lines
933 B
Go
package util
|
|
|
|
// Runtime config
|
|
var (
|
|
DisableLogin bool
|
|
BindAddress string
|
|
SmtpHostname string
|
|
SmtpPort int
|
|
SmtpUsername string
|
|
SmtpPassword string
|
|
SmtpNoTLSCheck bool
|
|
SmtpAuthType string
|
|
SendgridApiKey string
|
|
EmailFrom string
|
|
EmailFromName string
|
|
EmailSubject string
|
|
EmailContent string
|
|
SessionSecret []byte
|
|
DBType string
|
|
DBHost string
|
|
DBPort int
|
|
DBDatabase string
|
|
DBUsername string
|
|
DBPassword string
|
|
DBTLS string
|
|
)
|
|
|
|
const (
|
|
DefaultUsername = "admin"
|
|
DefaultPassword = "admin"
|
|
DefaultServerAddress = "10.252.1.0/24"
|
|
DefaultServerPort = 51820
|
|
DefaultDNS = "1.1.1.1"
|
|
DefaultMTU = 1450
|
|
DefaultPersistentKeepalive = 15
|
|
DefaultConfigFilePath = "/etc/wireguard/wg0.conf"
|
|
UsernameEnvVar = "WGUI_USERNAME"
|
|
PasswordEnvVar = "WGUI_PASSWORD"
|
|
)
|