Implement permission provisioning and watchers
Remove rule reset from roles cli command Add generic "provision" command for each binary and (re)set perm. rules Permission rules are now separated and part of AccessControl service Facility for watchers was added.
This commit is contained in:
@@ -50,11 +50,18 @@ func main() {
|
||||
switch command {
|
||||
case "help":
|
||||
flag.PrintDefaults()
|
||||
case "provision":
|
||||
if err := compose.Provision(ctx); err != nil {
|
||||
println("Failed to provision compose: ", err.Error())
|
||||
os.Exit(1)
|
||||
}
|
||||
default:
|
||||
// Checks subscription, will os.Exit(1) if there is an error
|
||||
// Disabled for now, system service is the only one that validates subscription
|
||||
// ctx = subscription.Monitor(ctx)
|
||||
|
||||
compose.StartWatchers(ctx)
|
||||
|
||||
if err := compose.StartRestAPI(ctx); err != nil {
|
||||
log.Fatal("failed to start compose REST API", zap.Error(err))
|
||||
}
|
||||
|
||||
@@ -78,6 +78,20 @@ func main() {
|
||||
switch command {
|
||||
case "help":
|
||||
flag.PrintDefaults()
|
||||
|
||||
case "provision":
|
||||
if err := system.Provision(ctx); err != nil {
|
||||
println("Failed to provision system: ", err.Error())
|
||||
os.Exit(1)
|
||||
}
|
||||
if err := compose.Provision(ctx); err != nil {
|
||||
println("Failed to provision compose: ", err.Error())
|
||||
os.Exit(1)
|
||||
}
|
||||
if err := messaging.Provision(ctx); err != nil {
|
||||
println("Failed to provision messaging: ", err.Error())
|
||||
os.Exit(1)
|
||||
}
|
||||
default:
|
||||
// Initialize configuration of our services
|
||||
if err := system.Init(ctx); err != nil {
|
||||
@@ -103,6 +117,10 @@ func main() {
|
||||
go metrics.NewMonitor(flags.monitor.Interval)
|
||||
}
|
||||
|
||||
system.StartWatchers(ctx)
|
||||
compose.StartWatchers(ctx)
|
||||
messaging.StartWatchers(ctx)
|
||||
|
||||
r := chi.NewRouter()
|
||||
|
||||
// logging, cors and such
|
||||
|
||||
@@ -50,6 +50,12 @@ func main() {
|
||||
switch command {
|
||||
case "help":
|
||||
flag.PrintDefaults()
|
||||
|
||||
case "provision":
|
||||
if err := messaging.Provision(ctx); err != nil {
|
||||
println("Failed to provision messagign: ", err.Error())
|
||||
os.Exit(1)
|
||||
}
|
||||
default:
|
||||
// Checks subscription, will os.Exit(1) if there is an error
|
||||
// Disabled for now, system service is the only one that validates subscription
|
||||
|
||||
@@ -46,6 +46,11 @@ func main() {
|
||||
switch command {
|
||||
case "help":
|
||||
flag.PrintDefaults()
|
||||
case "provision":
|
||||
if err := system.Provision(ctx); err != nil {
|
||||
println("Failed to provision system: ", err.Error())
|
||||
os.Exit(1)
|
||||
}
|
||||
default:
|
||||
// Checks subscription, will os.Exit(1) if there is an error
|
||||
ctx = subscription.Monitor(ctx)
|
||||
|
||||
Reference in New Issue
Block a user