Skip to content

Commit

Permalink
Merge pull request #3743 from owncloud/exit-on-parse-error
Browse files Browse the repository at this point in the history
Exit when encountering config parsing errors
  • Loading branch information
micbar authored May 9, 2022
2 parents 19d7acb + f6e2f46 commit 8145478
Show file tree
Hide file tree
Showing 34 changed files with 54 additions and 4 deletions.
1 change: 1 addition & 0 deletions changelog/unreleased/change-ocis-init.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,3 +10,4 @@ bootstrap you a configuration file for a secure oCIS instance.

https://github.com/owncloud/ocis/pull/3551
https://github.com/owncloud/ocis/issues/3524
https://github.com/owncloud/ocis/pull/3743
2 changes: 2 additions & 0 deletions extensions/accounts/pkg/command/server.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ package command
import (
"context"
"fmt"
"os"

"github.com/oklog/run"
"github.com/owncloud/ocis/v2/extensions/accounts/pkg/config"
Expand All @@ -28,6 +29,7 @@ func Server(cfg *config.Config) *cli.Command {
err := parser.ParseConfig(cfg)
if err != nil {
fmt.Printf("%v", err)
os.Exit(1)
}
return err
},
Expand Down
1 change: 1 addition & 0 deletions extensions/app-provider/pkg/command/server.go
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ func Server(cfg *config.Config) *cli.Command {
err := parser.ParseConfig(cfg)
if err != nil {
fmt.Printf("%v", err)
os.Exit(1)
}
return err
},
Expand Down
1 change: 1 addition & 0 deletions extensions/app-registry/pkg/command/server.go
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ func Server(cfg *config.Config) *cli.Command {
err := parser.ParseConfig(cfg)
if err != nil {
fmt.Printf("%v", err)
os.Exit(1)
}
return err
},
Expand Down
2 changes: 2 additions & 0 deletions extensions/audit/pkg/command/server.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ package command
import (
"context"
"fmt"
"os"

"github.com/cs3org/reva/v2/pkg/events"
"github.com/cs3org/reva/v2/pkg/events/server"
Expand All @@ -25,6 +26,7 @@ func Server(cfg *config.Config) *cli.Command {
err := parser.ParseConfig(cfg)
if err != nil {
fmt.Printf("%v", err)
os.Exit(1)
}
return err
},
Expand Down
1 change: 1 addition & 0 deletions extensions/auth-basic/pkg/command/server.go
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ func Server(cfg *config.Config) *cli.Command {
err := parser.ParseConfig(cfg)
if err != nil {
fmt.Printf("%v", err)
os.Exit(1)
}
return err
},
Expand Down
1 change: 1 addition & 0 deletions extensions/auth-bearer/pkg/command/server.go
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ func Server(cfg *config.Config) *cli.Command {
err := parser.ParseConfig(cfg)
if err != nil {
fmt.Printf("%v", err)
os.Exit(1)
}
return err
},
Expand Down
1 change: 1 addition & 0 deletions extensions/auth-machine/pkg/command/server.go
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ func Server(cfg *config.Config) *cli.Command {
err := parser.ParseConfig(cfg)
if err != nil {
fmt.Printf("%v", err)
os.Exit(1)
}
return err
},
Expand Down
1 change: 1 addition & 0 deletions extensions/frontend/pkg/command/server.go
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ func Server(cfg *config.Config) *cli.Command {
err := parser.ParseConfig(cfg)
if err != nil {
fmt.Printf("%v", err)
os.Exit(1)
}
return err
},
Expand Down
1 change: 1 addition & 0 deletions extensions/gateway/pkg/command/server.go
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ func Server(cfg *config.Config) *cli.Command {
err := parser.ParseConfig(cfg)
if err != nil {
fmt.Printf("%v", err)
os.Exit(1)
}
return err
},
Expand Down
2 changes: 2 additions & 0 deletions extensions/glauth/pkg/command/server.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ package command
import (
"context"
"fmt"
"os"

accountssvc "github.com/owncloud/ocis/v2/protogen/gen/ocis/services/accounts/v0"

Expand Down Expand Up @@ -31,6 +32,7 @@ func Server(cfg *config.Config) *cli.Command {
err := parser.ParseConfig(cfg)
if err != nil {
fmt.Printf("%v", err)
os.Exit(1)
}
return err
},
Expand Down
2 changes: 2 additions & 0 deletions extensions/graph-explorer/pkg/command/server.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ package command
import (
"context"
"fmt"
"os"

"github.com/oklog/run"
"github.com/owncloud/ocis/v2/extensions/graph-explorer/pkg/config"
Expand All @@ -26,6 +27,7 @@ func Server(cfg *config.Config) *cli.Command {
err := parser.ParseConfig(cfg)
if err != nil {
fmt.Printf("%v", err)
os.Exit(1)
}
return err
},
Expand Down
2 changes: 2 additions & 0 deletions extensions/graph/pkg/command/server.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ package command
import (
"context"
"fmt"
"os"

"github.com/oklog/run"
"github.com/owncloud/ocis/v2/extensions/graph/pkg/config"
Expand All @@ -26,6 +27,7 @@ func Server(cfg *config.Config) *cli.Command {
err := parser.ParseConfig(cfg)
if err != nil {
fmt.Printf("%v", err)
os.Exit(1)
}
return err
},
Expand Down
1 change: 1 addition & 0 deletions extensions/groups/pkg/command/server.go
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ func Server(cfg *config.Config) *cli.Command {
err := parser.ParseConfig(cfg)
if err != nil {
fmt.Printf("%v", err)
os.Exit(1)
}
return err
},
Expand Down
1 change: 1 addition & 0 deletions extensions/idm/pkg/command/server.go
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ func Server(cfg *config.Config) *cli.Command {
err := parser.ParseConfig(cfg)
if err != nil {
fmt.Printf("%v", err)
os.Exit(1)
}
return err
},
Expand Down
2 changes: 2 additions & 0 deletions extensions/idp/pkg/command/server.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ package command
import (
"context"
"fmt"
"os"

"github.com/oklog/run"
"github.com/owncloud/ocis/v2/extensions/idp/pkg/config"
Expand All @@ -26,6 +27,7 @@ func Server(cfg *config.Config) *cli.Command {
err := parser.ParseConfig(cfg)
if err != nil {
fmt.Printf("%v", err)
os.Exit(1)
}
return err
},
Expand Down
2 changes: 2 additions & 0 deletions extensions/nats/pkg/command/server.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ package command
import (
"context"
"fmt"
"os"

"github.com/oklog/run"

Expand All @@ -23,6 +24,7 @@ func Server(cfg *config.Config) *cli.Command {
err := parser.ParseConfig(cfg)
if err != nil {
fmt.Printf("%v", err)
os.Exit(1)
}
return err
},
Expand Down
2 changes: 2 additions & 0 deletions extensions/notifications/pkg/command/server.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ package command

import (
"fmt"
"os"

"github.com/cs3org/reva/v2/pkg/events"
"github.com/cs3org/reva/v2/pkg/events/server"
Expand All @@ -24,6 +25,7 @@ func Server(cfg *config.Config) *cli.Command {
err := parser.ParseConfig(cfg)
if err != nil {
fmt.Printf("%v", err)
os.Exit(1)
}
return err
},
Expand Down
2 changes: 2 additions & 0 deletions extensions/ocdav/pkg/command/server.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ package command
import (
"context"
"fmt"
"os"

"github.com/cs3org/reva/v2/pkg/micro/ocdav"
"github.com/oklog/run"
Expand All @@ -25,6 +26,7 @@ func Server(cfg *config.Config) *cli.Command {
err := parser.ParseConfig(cfg)
if err != nil {
fmt.Printf("%v", err)
os.Exit(1)
}
return err
},
Expand Down
2 changes: 2 additions & 0 deletions extensions/ocs/pkg/command/server.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ package command
import (
"context"
"fmt"
"os"

"github.com/owncloud/ocis/v2/extensions/ocs/pkg/config/parser"
"github.com/owncloud/ocis/v2/extensions/ocs/pkg/logging"
Expand All @@ -27,6 +28,7 @@ func Server(cfg *config.Config) *cli.Command {
err := parser.ParseConfig(cfg)
if err != nil {
fmt.Printf("%v", err)
os.Exit(1)
}
return err
},
Expand Down
2 changes: 2 additions & 0 deletions extensions/proxy/pkg/command/server.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import (
"crypto/tls"
"fmt"
"net/http"
"os"
"time"

accountssvc "github.com/owncloud/ocis/v2/protogen/gen/ocis/services/accounts/v0"
Expand Down Expand Up @@ -46,6 +47,7 @@ func Server(cfg *config.Config) *cli.Command {
err := parser.ParseConfig(cfg)
if err != nil {
fmt.Printf("%v", err)
os.Exit(1)
}
return err
},
Expand Down
2 changes: 2 additions & 0 deletions extensions/search/pkg/command/server.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ package command
import (
"context"
"fmt"
"os"

"github.com/oklog/run"
"github.com/owncloud/ocis/v2/extensions/search/pkg/config"
Expand All @@ -26,6 +27,7 @@ func Server(cfg *config.Config) *cli.Command {
err := parser.ParseConfig(cfg)
if err != nil {
fmt.Printf("%v", err)
os.Exit(1)
}
return err
},
Expand Down
2 changes: 2 additions & 0 deletions extensions/settings/pkg/command/server.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ package command
import (
"context"
"fmt"
"os"

"github.com/oklog/run"
"github.com/owncloud/ocis/v2/extensions/settings/pkg/config"
Expand All @@ -27,6 +28,7 @@ func Server(cfg *config.Config) *cli.Command {
err := parser.ParseConfig(cfg)
if err != nil {
fmt.Printf("%v", err)
os.Exit(1)
}
return err
},
Expand Down
1 change: 1 addition & 0 deletions extensions/sharing/pkg/command/server.go
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ func Server(cfg *config.Config) *cli.Command {
err := parser.ParseConfig(cfg)
if err != nil {
fmt.Printf("%v", err)
os.Exit(1)
}
return err
},
Expand Down
1 change: 1 addition & 0 deletions extensions/storage-publiclink/pkg/command/server.go
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ func Server(cfg *config.Config) *cli.Command {
err := parser.ParseConfig(cfg)
if err != nil {
fmt.Printf("%v", err)
os.Exit(1)
}
return err
},
Expand Down
1 change: 1 addition & 0 deletions extensions/storage-shares/pkg/command/server.go
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ func Server(cfg *config.Config) *cli.Command {
err := parser.ParseConfig(cfg)
if err != nil {
fmt.Printf("%v", err)
os.Exit(1)
}
return err
},
Expand Down
1 change: 1 addition & 0 deletions extensions/storage-system/pkg/command/server.go
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ func Server(cfg *config.Config) *cli.Command {
err := parser.ParseConfig(cfg)
if err != nil {
fmt.Printf("%v", err)
os.Exit(1)
}
return err
},
Expand Down
1 change: 1 addition & 0 deletions extensions/storage-users/pkg/command/server.go
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ func Server(cfg *config.Config) *cli.Command {
err := parser.ParseConfig(cfg)
if err != nil {
fmt.Printf("%v", err)
os.Exit(1)
}
return err
},
Expand Down
2 changes: 2 additions & 0 deletions extensions/store/pkg/command/server.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ package command
import (
"context"
"fmt"
"os"

"github.com/oklog/run"

Expand All @@ -27,6 +28,7 @@ func Server(cfg *config.Config) *cli.Command {
err := parser.ParseConfig(cfg)
if err != nil {
fmt.Printf("%v", err)
os.Exit(1)
}
return err
},
Expand Down
2 changes: 2 additions & 0 deletions extensions/thumbnails/pkg/command/server.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ package command
import (
"context"
"fmt"
"os"

"github.com/oklog/run"
"github.com/owncloud/ocis/v2/extensions/thumbnails/pkg/config"
Expand All @@ -27,6 +28,7 @@ func Server(cfg *config.Config) *cli.Command {
err := parser.ParseConfig(cfg)
if err != nil {
fmt.Printf("%v", err)
os.Exit(1)
}
return err
},
Expand Down
1 change: 1 addition & 0 deletions extensions/users/pkg/command/server.go
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ func Server(cfg *config.Config) *cli.Command {
err := parser.ParseConfig(cfg)
if err != nil {
fmt.Printf("%v", err)
os.Exit(1)
}
return err
},
Expand Down
2 changes: 2 additions & 0 deletions extensions/web/pkg/command/server.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import (
"encoding/json"
"fmt"
"io/ioutil"
"os"

"github.com/oklog/run"
"github.com/owncloud/ocis/v2/extensions/web/pkg/config"
Expand All @@ -27,6 +28,7 @@ func Server(cfg *config.Config) *cli.Command {
err := parser.ParseConfig(cfg)
if err != nil {
fmt.Printf("%v", err)
os.Exit(1)
}
return err
},
Expand Down
2 changes: 2 additions & 0 deletions extensions/webdav/pkg/command/server.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ package command
import (
"context"
"fmt"
"os"

"github.com/oklog/run"
"github.com/owncloud/ocis/v2/extensions/webdav/pkg/config"
Expand All @@ -26,6 +27,7 @@ func Server(cfg *config.Config) *cli.Command {
err := parser.ParseConfig(cfg)
if err != nil {
fmt.Printf("%v", err)
os.Exit(1)
}
return err
},
Expand Down
Loading

0 comments on commit 8145478

Please sign in to comment.