Skip to content

Commit

Permalink
make urls configurable
Browse files Browse the repository at this point in the history
Co-authored-by: Pascal Wengerter <pwengerter@owncloud.com>
  • Loading branch information
wkloucek and Pascal Wengerter committed Sep 23, 2021
1 parent 7568482 commit 7f38afb
Show file tree
Hide file tree
Showing 3 changed files with 29 additions and 10 deletions.
10 changes: 5 additions & 5 deletions storage/pkg/command/frontend.go
Original file line number Diff line number Diff line change
Expand Up @@ -59,16 +59,16 @@ func Frontend(cfg *config.Config) *cli.Command {
"enabled": true,
"version": "2.0.0",
"formats": []string{"tar", "zip"},
"archiver_url": "/archiver",
"archiver_url": cfg.Reva.Archiver.ArchiverURL,
},
}

appproviders := []map[string]interface{}{
appProviders := []map[string]interface{}{
{
"enabled": true,
"version": "1.0.0",
"apps_url": "/app/list",
"open_url": "/app/open",
"apps_url": cfg.Reva.AppProvider.AppsURL,
"open_url": cfg.Reva.AppProvider.OpenURL,
},
}

Expand All @@ -79,7 +79,7 @@ func Frontend(cfg *config.Config) *cli.Command {
"undelete": true,
"versioning": true,
"archivers": archivers,
"app_providers": appproviders,
"app_providers": appProviders,
}

if cfg.Reva.DefaultUploadProtocol == "tus" {
Expand Down
3 changes: 3 additions & 0 deletions storage/pkg/config/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,8 @@ type AppProvider struct {
ExternalAddr string
Driver string
WopiDriver WopiDriver
AppsURL string
OpenURL string
}

type WopiDriver struct {
Expand Down Expand Up @@ -415,6 +417,7 @@ type OCDav struct {
type Archiver struct {
MaxNumFiles int64
MaxSize int64
ArchiverURL string
}

// Reva defines the available reva configuration.
Expand Down
26 changes: 21 additions & 5 deletions storage/pkg/flagset/frontend.go
Original file line number Diff line number Diff line change
Expand Up @@ -219,11 +219,27 @@ func FrontendWithConfig(cfg *config.Config) []cli.Flag {

// Archiver
&cli.StringFlag{
Name: "default-upload-protocol",
Value: flags.OverrideDefaultString(cfg.Reva.DefaultUploadProtocol, "tus"),
Usage: "Default upload chunking protocol to be used out of tus/v1/ng",
EnvVars: []string{"STORAGE_FRONTEND_DEFAULT_UPLOAD_PROTOCOL"},
Destination: &cfg.Reva.Archiver.,
Name: "archiver-url",
Value: flags.OverrideDefaultString(cfg.Reva.Archiver.ArchiverURL, "/archiver"),
Usage: "URL where the archiver is reachable",
EnvVars: []string{"STORAGE_FRONTEND_ARCHIVER_URL"},
Destination: &cfg.Reva.Archiver.ArchiverURL,
},

// App Provider
&cli.StringFlag{
Name: "appprovider-apps-url",
Value: flags.OverrideDefaultString(cfg.Reva.AppProvider.AppsURL, "/app/list"),
Usage: "URL where the archiver is reachable",
EnvVars: []string{"STORAGE_FRONTEND_APP_PROVIDER_APPS_URL"},
Destination: &cfg.Reva.AppProvider.AppsURL,
},
&cli.StringFlag{
Name: "appprovider-open-url",
Value: flags.OverrideDefaultString(cfg.Reva.AppProvider.OpenURL, "/app/open"),
Usage: "URL where the archiver is reachable",
EnvVars: []string{"STORAGE_FRONTEND_APP_PROVIDER_OPEN_URL"},
Destination: &cfg.Reva.AppProvider.OpenURL,
},

// Reva Middlewares Config
Expand Down

0 comments on commit 7f38afb

Please sign in to comment.