wireguard-ui/util/config.go
Matthew Nickson bc6f0f491f
Added MySQL as a datastore
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>
2022-03-16 22:49:18 +00:00

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"
)