Skip to content
This repository has been archived by the owner on Jan 27, 2021. It is now read-only.

Commit

Permalink
Don't create dummy index.html for webapp #25
Browse files Browse the repository at this point in the history
Downstream does not require webapp anymore
  • Loading branch information
IljaN committed Mar 9, 2020
1 parent 565c6ee commit 8ceb6fd
Show file tree
Hide file tree
Showing 4 changed files with 19 additions and 14 deletions.
6 changes: 6 additions & 0 deletions changelog/unreleased/disable-identifier.md
Original file line number Diff line number Diff line change
@@ -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
6 changes: 6 additions & 0 deletions docs/getting-started.md
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down Expand Up @@ -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

Expand Down
7 changes: 7 additions & 0 deletions pkg/flagset/flagset.go
Original file line number Diff line number Diff line change
Expand Up @@ -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,
},
}
}
14 changes: 0 additions & 14 deletions pkg/service/v0/service.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 8ceb6fd

Please sign in to comment.