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 e718239 commit 8bc8f46
Show file tree
Hide file tree
Showing 4 changed files with 29 additions and 12 deletions.
2 changes: 0 additions & 2 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -291,8 +291,6 @@ github.com/crewjam/saml v0.4.5/go.mod h1:qCJQpUtZte9R1ZjUBcW8qtCNlinbO363ooNl02S
github.com/cs3org/cato v0.0.0-20200828125504-e418fc54dd5e/go.mod h1:XJEZ3/EQuI3BXTp/6DUzFr850vlxq11I6satRtz0YQ4=
github.com/cs3org/go-cs3apis v0.0.0-20210916072651-dd30db9dbe58 h1:BxySl8qrPon7Yd98Ly8y45esk1zKaddnatKSgeoblXY=
github.com/cs3org/go-cs3apis v0.0.0-20210916072651-dd30db9dbe58/go.mod h1:UXha4TguuB52H14EMoSsCqDj7k8a/t7g4gVP+bgY5LY=
github.com/cs3org/reva v1.13.1-0.20210921133241-ce466cb89fdc h1:AS7xNqqxpsrg+xbTQU1GxBl0Tquiq7zH96iISsiXVVU=
github.com/cs3org/reva v1.13.1-0.20210921133241-ce466cb89fdc/go.mod h1:FQw3Asg4VbzthnQPRELjJPxGCSwvMq9FOWjJ1/r1ImU=
github.com/cs3org/reva v1.13.1-0.20210923072026-e96fa872a8f5 h1:qpmh61BjoH5GRg+XtLSW3J58QDa2sk58Ul9NXCAnqKE=
github.com/cs3org/reva v1.13.1-0.20210923072026-e96fa872a8f5/go.mod h1:FQw3Asg4VbzthnQPRELjJPxGCSwvMq9FOWjJ1/r1ImU=
github.com/cubewise-code/go-mime v0.0.0-20200519001935-8c5762b177d8 h1:Z9lwXumT5ACSmJ7WGnFl+OMLLjpz5uR2fyz7dC255FI=
Expand Down
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 8bc8f46

Please sign in to comment.