Add unsafe options to config
ci/woodpecker/push/woodpecker Pipeline was successful
Details
ci/woodpecker/push/woodpecker Pipeline was successful
Details
This commit is contained in:
parent
6431645905
commit
f8af758814
|
@ -24,6 +24,7 @@ type Config struct {
|
||||||
PagerStyle string `toml:"pagerStyle"`
|
PagerStyle string `toml:"pagerStyle"`
|
||||||
IgnorePkgUpdates []string `toml:"ignorePkgUpdates"`
|
IgnorePkgUpdates []string `toml:"ignorePkgUpdates"`
|
||||||
Repos []Repo `toml:"repo"`
|
Repos []Repo `toml:"repo"`
|
||||||
|
Unsafe Unsafe `toml:"unsafe"`
|
||||||
}
|
}
|
||||||
|
|
||||||
// Repo represents a LURE repo within a configuration file
|
// Repo represents a LURE repo within a configuration file
|
||||||
|
@ -31,3 +32,7 @@ type Repo struct {
|
||||||
Name string `toml:"name"`
|
Name string `toml:"name"`
|
||||||
URL string `toml:"url"`
|
URL string `toml:"url"`
|
||||||
}
|
}
|
||||||
|
|
||||||
|
type Unsafe struct {
|
||||||
|
AllowRunAsRoot bool `toml:"allowRunAsRoot"`
|
||||||
|
}
|
||||||
|
|
2
main.go
2
main.go
|
@ -58,7 +58,7 @@ func init() {
|
||||||
}
|
}
|
||||||
|
|
||||||
func main() {
|
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()
|
log.Fatal("Running LURE as root is forbidden as it may cause catastrophic damage to your system").Send()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue