This commit is contained in:
romanbuk52 2023-12-14 21:29:32 +00:00 committed by GitHub
commit 743305bb0c
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 4 additions and 2 deletions

View file

@ -63,7 +63,7 @@ docker-compose up
| `SMTP_PASSWORD` | The SMTP user password | N/A | | `SMTP_PASSWORD` | The SMTP user password | N/A |
| `SMTP_AUTH_TYPE` | The SMTP authentication type. Possible values: `PLAIN`, `LOGIN`, `NONE` | `NONE` | | `SMTP_AUTH_TYPE` | The SMTP authentication type. Possible values: `PLAIN`, `LOGIN`, `NONE` | `NONE` |
| `SMTP_ENCRYPTION` | the encryption method. Possible values: `NONE`, `SSL`, `SSLTLS`, `TLS`, `STARTTLS` | `STARTTLS` | | `SMTP_ENCRYPTION` | the encryption method. Possible values: `NONE`, `SSL`, `SSLTLS`, `TLS`, `STARTTLS` | `STARTTLS` |
| `WG_DATABASE_PATH` | The path to database where stores all WG data | `/etc/wireguard/db` |
### Defaults for server configuration ### Defaults for server configuration
These environment variables are used to control the default server settings used when initializing the database. These environment variables are used to control the default server settings used when initializing the database.

View file

@ -41,6 +41,7 @@ var (
flagSessionSecret string = util.RandomString(32) flagSessionSecret string = util.RandomString(32)
flagWgConfTemplate string flagWgConfTemplate string
flagBasePath string flagBasePath string
flagDBPath string = "/etc/wireguard/db"
) )
const ( const (
@ -80,6 +81,7 @@ func init() {
flag.StringVar(&flagSessionSecret, "session-secret", util.LookupEnvOrString("SESSION_SECRET", flagSessionSecret), "The key used to encrypt session cookies.") flag.StringVar(&flagSessionSecret, "session-secret", util.LookupEnvOrString("SESSION_SECRET", flagSessionSecret), "The key used to encrypt session cookies.")
flag.StringVar(&flagWgConfTemplate, "wg-conf-template", util.LookupEnvOrString("WG_CONF_TEMPLATE", flagWgConfTemplate), "Path to custom wg.conf template.") flag.StringVar(&flagWgConfTemplate, "wg-conf-template", util.LookupEnvOrString("WG_CONF_TEMPLATE", flagWgConfTemplate), "Path to custom wg.conf template.")
flag.StringVar(&flagBasePath, "base-path", util.LookupEnvOrString("BASE_PATH", flagBasePath), "The base path of the URL") flag.StringVar(&flagBasePath, "base-path", util.LookupEnvOrString("BASE_PATH", flagBasePath), "The base path of the URL")
flag.StringVar(&flagDBPath, "database-path", util.LookupEnvOrString("WG_DATABASE_PATH", flagDBPath), "The custom path to database.")
flag.Parse() flag.Parse()
// update runtime config // update runtime config
@ -120,7 +122,7 @@ func init() {
} }
func main() { func main() {
db, err := jsondb.New("./db") db, err := jsondb.New(flagDBPath)
if err != nil { if err != nil {
panic(err) panic(err)
} }