diff --git a/.air.toml b/.air.toml index 37821e3..ee825ab 100644 --- a/.air.toml +++ b/.air.toml @@ -5,7 +5,7 @@ tmp_dir = "tmp" [build] args_bin = ["--config", "data/"] bin = "./tmp/main" - cmd = "bash -c 'go build -ldflags \"-X github.com/sirrobot01/debrid-blackhole/pkg/version.Version=0.0.0 -X github.com/sirrobot01/debrid-blackhole/pkg/version.Channel=nightly\" -o ./tmp/main .'" + cmd = "bash -c 'go build -ldflags \"-X github.com/sirrobot01/debrid-blackhole/pkg/version.Version=0.0.0 -X github.com/sirrobot01/debrid-blackhole/pkg/version.Channel=dev\" -o ./tmp/main .'" delay = 1000 exclude_dir = ["assets", "tmp", "vendor", "testdata", "data"] exclude_file = [] diff --git a/cmd/decypharr/main.go b/cmd/decypharr/main.go index 9aaaea0..384ffae 100644 --- a/cmd/decypharr/main.go +++ b/cmd/decypharr/main.go @@ -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)