Add unsafe options to config
ci/woodpecker/push/woodpecker Pipeline was successful Details

This commit is contained in:
Elara 2023-05-04 17:56:46 -07:00
parent 6431645905
commit f8af758814
2 changed files with 6 additions and 1 deletions

View File

@ -24,6 +24,7 @@ type Config struct {
PagerStyle string `toml:"pagerStyle"`
IgnorePkgUpdates []string `toml:"ignorePkgUpdates"`
Repos []Repo `toml:"repo"`
Unsafe Unsafe `toml:"unsafe"`
}
// Repo represents a LURE repo within a configuration file
@ -31,3 +32,7 @@ type Repo struct {
Name string `toml:"name"`
URL string `toml:"url"`
}
type Unsafe struct {
AllowRunAsRoot bool `toml:"allowRunAsRoot"`
}

View File

@ -58,7 +58,7 @@ func init() {
}
func main() {
if os.Geteuid() == 0 {
if !cfg.Unsafe.AllowRunAsRoot && os.Geteuid() == 0 {
log.Fatal("Running LURE as root is forbidden as it may cause catastrophic damage to your system").Send()
}