Add Umask support

This commit is contained in:
Mukhtar Akere
2025-03-15 21:30:19 +01:00
parent b4e4db27fb
commit e2ff3b26de
2 changed files with 14 additions and 1 deletions

View File

@@ -12,11 +12,24 @@ import (
"github.com/sirrobot01/debrid-blackhole/pkg/version"
"github.com/sirrobot01/debrid-blackhole/pkg/web"
"github.com/sirrobot01/debrid-blackhole/pkg/worker"
"os"
"runtime/debug"
"strconv"
"sync"
"syscall"
)
func Start(ctx context.Context) error {
if umaskStr := os.Getenv("UMASK"); umaskStr != "" {
umask, err := strconv.ParseInt(umaskStr, 8, 32)
if err != nil {
return fmt.Errorf("invalid UMASK value: %s", umaskStr)
}
// Set umask
syscall.Umask(int(umask))
}
cfg := config.GetConfig()
var wg sync.WaitGroup
errChan := make(chan error)