mirror of
https://github.com/vx3r/wg-gen-web.git
synced 2024-11-26 04:19:41 +01:00
PreUp, PostUp, PreDown, PostDown added
This commit is contained in:
parent
727b5c4049
commit
26dec5ce7a
@ -35,6 +35,10 @@ func ReadServer() (*model.Server, error) {
|
||||
server.Address = "fd9f:6666::10:6:6:1/112, 10.6.6.1/24"
|
||||
server.Dns = "fd9f::10:0:0:2, 10.0.0.2"
|
||||
server.PersistentKeepalive = 16
|
||||
server.PreUp = "echo WireGuard PreUp"
|
||||
server.PostUp = "echo WireGuard PostUp"
|
||||
server.PreDown = "echo WireGuard PreDown"
|
||||
server.PostDown = "echo WireGuard PostDown"
|
||||
server.Created = time.Now().UTC()
|
||||
server.Updated = server.Created
|
||||
|
||||
|
@ -15,4 +15,8 @@ type Server struct {
|
||||
Endpoint string `json:"endpoint"`
|
||||
PersistentKeepalive int `json:"persistentKeepalive"`
|
||||
Dns string `json:"dns"`
|
||||
PreUp string `json:"preUp"`
|
||||
PostUp string `json:"postUp"`
|
||||
PreDown string `json:"preDown"`
|
||||
PostDown string `json:"postDown"`
|
||||
}
|
||||
|
@ -217,6 +217,10 @@ Address = {{.}}
|
||||
{{end}}
|
||||
ListenPort = {{.Server.ListenPort}}
|
||||
PrivateKey = {{.Server.PrivateKey}}
|
||||
PreUp = {{.Server.PreUp}}
|
||||
PostUp = {{.Server.PostUp}}
|
||||
PreDown = {{.Server.PreDown}}
|
||||
PostDown = {{.Server.PostDown}}
|
||||
{{$server := .Server}}
|
||||
{{range .Clients}}
|
||||
{{if .Enable}}
|
||||
|
@ -55,6 +55,14 @@
|
||||
</v-chip>
|
||||
</template>
|
||||
</v-combobox>
|
||||
<v-text-field
|
||||
v-model="server.preUp"
|
||||
label="PreUp: script snippets which will be executed by bash before setting up the interface"
|
||||
/>
|
||||
<v-text-field
|
||||
v-model="server.postUp"
|
||||
label="PostUp: script snippets which will be executed by bash after setting up the interface"
|
||||
/>
|
||||
</v-col>
|
||||
<v-col cols="6">
|
||||
<v-text-field
|
||||
@ -96,6 +104,14 @@
|
||||
</v-chip>
|
||||
</template>
|
||||
</v-combobox>
|
||||
<v-text-field
|
||||
v-model="server.preDown"
|
||||
label="PreDown: script snippets which will be executed by bash before setting down the interface"
|
||||
/>
|
||||
<v-text-field
|
||||
v-model="server.postDown "
|
||||
label="PostDown : script snippets which will be executed by bash after setting down the interface"
|
||||
/>
|
||||
</v-col>
|
||||
</div>
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user