mirror of
https://github.com/ngoduykhanh/wireguard-ui.git
synced 2025-07-26 20:00:27 +03:00
Fix PreUp, PostUp, PreDown, and PostDown
* Escaping HTML in several places. * Adds PreUp config when one didn't exist. * Adds environment variable support for PreUp and PreDown. closes #549 closes #655 closes #656 See also -------- - https://github.com/samrocketman/addons-homeassistant/issues/9 Co-authored-by: Robert Willert <rwillert@users.noreply.github.com>
This commit is contained in:
parent
2fdafd34ca
commit
2084a81297
10 changed files with 55 additions and 22 deletions
|
@ -64,7 +64,9 @@ func (o *JsonDB) Init() error {
|
|||
serverInterface := new(model.ServerInterface)
|
||||
serverInterface.Addresses = util.LookupEnvOrStrings(util.ServerAddressesEnvVar, []string{util.DefaultServerAddress})
|
||||
serverInterface.ListenPort = util.LookupEnvOrInt(util.ServerListenPortEnvVar, util.DefaultServerPort)
|
||||
serverInterface.PreUp = util.LookupEnvOrString(util.ServerPreUpScriptEnvVar, "")
|
||||
serverInterface.PostUp = util.LookupEnvOrString(util.ServerPostUpScriptEnvVar, "")
|
||||
serverInterface.PreDown = util.LookupEnvOrString(util.ServerPreDownScriptEnvVar, "")
|
||||
serverInterface.PostDown = util.LookupEnvOrString(util.ServerPostDownScriptEnvVar, "")
|
||||
serverInterface.UpdatedAt = time.Now().UTC()
|
||||
o.conn.Write("server", "interfaces", serverInterface)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue