diff --git a/changelog/unreleased/disable-identifier.md b/changelog/unreleased/disable-identifier.md new file mode 100644 index 000000000..799fe436d --- /dev/null +++ b/changelog/unreleased/disable-identifier.md @@ -0,0 +1,6 @@ +Change: Dummy index.html is not required anymore by upstream + +The workaround was required as identifier webapp was mandatory, but +we serve it from memory. This also introduces --disable-identifier-webapp flag. + +https://github.com/owncloud/ocis-konnectd/issues/25 diff --git a/docs/getting-started.md b/docs/getting-started.md index f91afff77..afb2f0e5b 100644 --- a/docs/getting-started.md +++ b/docs/getting-started.md @@ -153,6 +153,9 @@ KONNECTD_ALLOW_CLIENT_GUESTS KONNECTD_ALLOW_DYNAMIC_CLIENT_REGISTRATION : Allow dynamic OAuth2 client registration +KONNECTD_DISABLE_IDENTIFIER_WEBAPP +: Disable built-in identifier-webapp to use a frontend hosted elsewhere. Per default we use the built-in webapp. If set to false --identifier-client-path must be provided, defaults to `true` + #### Health @@ -287,6 +290,9 @@ If you prefer to configure the service with commandline flags you can see the av --allow-dynamic-client-registration : Allow dynamic OAuth2 client registration +--disable-identifier-webapp +: Disable built-in identifier-webapp to use a frontend hosted elsewhere. Per default we use the built-in webapp. If set to false --identifier-client-path must be provided, defaults to `true` + #### Health diff --git a/pkg/flagset/flagset.go b/pkg/flagset/flagset.go index 394739c79..a7c9c829c 100644 --- a/pkg/flagset/flagset.go +++ b/pkg/flagset/flagset.go @@ -298,5 +298,12 @@ func ServerWithConfig(cfg *config.Config) []cli.Flag { EnvVars: []string{"KONNECTD_ALLOW_DYNAMIC_CLIENT_REGISTRATION"}, Destination: &cfg.Konnectd.AllowDynamicClientRegistration, }, + &cli.BoolFlag{ + Name: "disable-identifier-webapp", + Usage: "Disable built-in identifier-webapp to use a frontend hosted elsewhere.", + EnvVars: []string{"KONNECTD_DISABLE_IDENTIFIER_WEBAPP"}, + Value: true, + Destination: &cfg.Konnectd.IdentifierWebAppDisabled, + }, } } diff --git a/pkg/service/v0/service.go b/pkg/service/v0/service.go index 9c245e6ed..630c91b65 100644 --- a/pkg/service/v0/service.go +++ b/pkg/service/v0/service.go @@ -70,20 +70,6 @@ func NewService(opts ...Option) Service { } func createConfigsIfNotExist(assets http.FileSystem) error { - err := os.MkdirAll("/var/tmp/konnectd", 0700) - if err != nil { - return err - } - - // This empty file is currently required to start konnect - // See: https://github.com/Kopano-dev/konnect/issues/25 - index, err := os.Create("/var/tmp/konnectd/index.html") - if err != nil { - return err - } - - index.Close() - if _, err := os.Stat("./config"); os.IsNotExist(err) { if err := os.Mkdir("./config", 0700); err != nil { return err