You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+1Lines changed: 1 addition & 0 deletions
Original file line number
Diff line number
Diff line change
@@ -42,6 +42,7 @@ docker-compose up
42
42
|`BIND_ADDRESS`| The addresses that can access to the web interface and the port, use unix:///abspath/to/file.socket for unix domain socket. | 0.0.0.0:80 |
43
43
|`SESSION_SECRET`| The secret key used to encrypt the session cookies. Set this to a random value | N/A |
44
44
|`SESSION_SECRET_FILE`| Optional filepath for the secret key used to encrypt the session cookies. Leave `SESSION_SECRET` blank to take effect | N/A |
45
+
|`SESSION_MAX_DURATION`| Max time in days a remembered session is refreshed and valid. Non-refreshed session is valid for 7 days max, regardless of this setting. | 90 |
45
46
|`SUBNET_RANGES`| The list of address subdivision ranges. Format: `SR Name:10.0.1.0/24; SR2:10.0.2.0/24,10.0.3.0/24` Each CIDR must be inside one of the server interfaces. | N/A |
46
47
|`WGUI_USERNAME`| The username for the login page. Used for db initialization only |`admin`|
47
48
|`WGUI_PASSWORD`| The password for the user on the login page. Will be hashed automatically. Used for db initialization only |`admin`|
Copy file name to clipboardExpand all lines: main.go
+12-8Lines changed: 12 additions & 8 deletions
Original file line number
Diff line number
Diff line change
@@ -1,6 +1,7 @@
1
1
package main
2
2
3
3
import (
4
+
"crypto/sha512"
4
5
"embed"
5
6
"flag"
6
7
"fmt"
@@ -48,6 +49,7 @@ var (
48
49
flagTelegramAllowConfRequest=false
49
50
flagTelegramFloodWait=60
50
51
flagSessionSecret=util.RandomString(32)
52
+
flagSessionMaxDuration=90
51
53
flagWgConfTemplatestring
52
54
flagBasePathstring
53
55
flagSubnetRangesstring
@@ -91,6 +93,7 @@ func init() {
91
93
flag.StringVar(&flagWgConfTemplate, "wg-conf-template", util.LookupEnvOrString("WG_CONF_TEMPLATE", flagWgConfTemplate), "Path to custom wg.conf template.")
92
94
flag.StringVar(&flagBasePath, "base-path", util.LookupEnvOrString("BASE_PATH", flagBasePath), "The base path of the URL")
93
95
flag.StringVar(&flagSubnetRanges, "subnet-ranges", util.LookupEnvOrString("SUBNET_RANGES", flagSubnetRanges), "IP ranges to choose from when assigning an IP for a client.")
96
+
flag.IntVar(&flagSessionMaxDuration, "session-max-duration", util.LookupEnvOrInt("SESSION_MAX_DURATION", flagSessionMaxDuration), "Max time in days a remembered session is refreshed and valid.")
0 commit comments