fix(pia): set port forward file owned with PUID and PGID

This commit is contained in:
Quentin McGaw
2022-06-25 15:44:29 +00:00
parent 2805c3388a
commit 62ad8bcd8f
3 changed files with 16 additions and 11 deletions

View File

@@ -15,6 +15,9 @@ import (
type Loop struct {
statusManager *loopstate.State
state *state.State
// Fixed parameters
puid int
pgid int
// Objects
client *http.Client
portAllower PortAllower
@@ -33,7 +36,7 @@ const defaultBackoffTime = 5 * time.Second
func NewLoop(settings settings.PortForwarding,
client *http.Client, portAllower PortAllower,
logger Logger) *Loop {
logger Logger, puid, pgid int) *Loop {
start := make(chan struct{})
running := make(chan models.LoopStatus)
stop := make(chan struct{})
@@ -45,6 +48,8 @@ func NewLoop(settings settings.PortForwarding,
return &Loop{
statusManager: statusManager,
state: state,
puid: puid,
pgid: pgid,
// Objects
client: client,
portAllower: portAllower,