diff --git a/README.md b/README.md index 598a994..7ec9ea9 100644 --- a/README.md +++ b/README.md @@ -58,6 +58,7 @@ Note: | `WGUI_MTU` | The default MTU used in global settings | `1450` | | `WGUI_PERSISTENT_KEEPALIVE` | The default persistent keepalive for WireGuard in global settings | `15` | | `WGUI_FORWARD_MARK` | The default WireGuard forward mark | `0xca6c` | +| `WGUI_TABLE` | The default WireGuard table value settings | `auto` | | `WGUI_CONFIG_FILE_PATH` | The default WireGuard config file path used in global settings | `/etc/wireguard/wg0.conf` | | `WG_CONF_TEMPLATE` | The custom `wg.conf` config file template. Please refer to our [default template](https://github.com/ngoduykhanh/wireguard-ui/blob/master/templates/wg.conf) | N/A | | `EMAIL_FROM_ADDRESS` | The sender email address | N/A | diff --git a/model/setting.go b/model/setting.go index e871591..df3cda2 100644 --- a/model/setting.go +++ b/model/setting.go @@ -11,6 +11,7 @@ type GlobalSetting struct { MTU int `json:"mtu,string"` PersistentKeepalive int `json:"persistent_keepalive,string"` ForwardMark string `json:"forward_mark"` + Table string `json:"table"` ConfigFilePath string `json:"config_file_path"` UpdatedAt time.Time `json:"updated_at"` } diff --git a/store/jsondb/jsondb.go b/store/jsondb/jsondb.go index f39a452..d5ef629 100644 --- a/store/jsondb/jsondb.go +++ b/store/jsondb/jsondb.go @@ -97,6 +97,7 @@ func (o *JsonDB) Init() error { globalSetting.MTU = util.LookupEnvOrInt(util.MTUEnvVar, util.DefaultMTU) globalSetting.PersistentKeepalive = util.LookupEnvOrInt(util.PersistentKeepaliveEnvVar, util.DefaultPersistentKeepalive) globalSetting.ForwardMark = util.LookupEnvOrString(util.ForwardMarkEnvVar, util.DefaultForwardMark) + globalSetting.Table = util.LookupEnvOrString(util.TableEnvVar, util.DefaultTable) globalSetting.ConfigFilePath = util.LookupEnvOrString(util.ConfigFilePathEnvVar, util.DefaultConfigFilePath) globalSetting.UpdatedAt = time.Now().UTC() o.conn.Write("server", "global_settings", globalSetting) diff --git a/templates/global_settings.html b/templates/global_settings.html index e013349..50c1d87 100644 --- a/templates/global_settings.html +++ b/templates/global_settings.html @@ -61,6 +61,12 @@ Global Settings name="forward_mark" placeholder="Forward Mark" value="{{ .globalSettings.ForwardMark }}"> +
fwmark
on all packets going out of WireGuard's UDP socket. Default value: 0xca6c
Table
setting in the wg conf file. Default value: auto