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

Commit

Permalink
make frontend prefixes configurable
Browse files Browse the repository at this point in the history
Signed-off-by: Jörn Friedrich Dreyer <[email protected]>
  • Loading branch information
butonic committed Jul 9, 2020
1 parent fcd3fc2 commit b75cfbf
Show file tree
Hide file tree
Showing 3 changed files with 34 additions and 2 deletions.
4 changes: 3 additions & 1 deletion pkg/command/frontend.go
Original file line number Diff line number Diff line change
Expand Up @@ -120,12 +120,13 @@ func Frontend(cfg *config.Config) *cli.Command {
// TODO build services dynamically
"services": map[string]interface{}{
"datagateway": map[string]interface{}{
"prefix": cfg.Reva.Frontend.DatagatewayPrefix,
"transfer_shared_secret": cfg.Reva.TransferSecret,
"timeout": 86400,
"insecure": true,
},
"ocdav": map[string]interface{}{
"prefix": "",
"prefix": cfg.Reva.Frontend.OCDavPrefix,
"chunk_folder": "/var/tmp/reva/chunks",
"files_namespace": cfg.Reva.OCDav.DavFilesNamespace,
"webdav_namespace": cfg.Reva.OCDav.WebdavNamespace,
Expand All @@ -134,6 +135,7 @@ func Frontend(cfg *config.Config) *cli.Command {
"disable_tus": cfg.Reva.UploadDisableTus,
},
"ocs": map[string]interface{}{
"prefix": cfg.Reva.Frontend.OCSPrefix,
"config": map[string]interface{}{
"version": "1.8",
"website": "reva",
Expand Down
11 changes: 10 additions & 1 deletion pkg/config/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,15 @@ type Users struct {
JSON string
}

// FrontendPort defines the available frontend configuration.
type FrontendPort struct {
Port

DatagatewayPrefix string
OCDavPrefix string
OCSPrefix string
}

// StoragePort defines the available storage configuration.
type StoragePort struct {
Port
Expand Down Expand Up @@ -230,7 +239,7 @@ type Reva struct {
OCDav OCDav
Storages StorageConfig
// Ports are used to configure which services to start on which port
Frontend Port
Frontend FrontendPort
DataGateway Port
Gateway Gateway
Users Users
Expand Down
21 changes: 21 additions & 0 deletions pkg/flagset/frontend.go
Original file line number Diff line number Diff line change
Expand Up @@ -147,6 +147,27 @@ func FrontendWithConfig(cfg *config.Config) []cli.Flag {
Usage: "--service ocdav [--service ocs]",
EnvVars: []string{"REVA_FRONTEND_SERVICES"},
},
&cli.StringFlag{
Name: "datagateway-prefix",
Value: "data",
Usage: "datagateway prefix",
EnvVars: []string{"REVA_FRONTEND_DATAGATEWAY_PREFIX"},
Destination: &cfg.Reva.Frontend.DatagatewayPrefix,
},
&cli.StringFlag{
Name: "ocdav-prefix",
Value: "",
Usage: "owncloud webdav endpoint prefix",
EnvVars: []string{"REVA_FRONTEND_OCDAV_PREFIX"},
Destination: &cfg.Reva.Frontend.OCDavPrefix,
},
&cli.StringFlag{
Name: "ocs-prefix",
Value: "ocs",
Usage: "open collaboration services endpoint prefix",
EnvVars: []string{"REVA_FRONTEND_OCS_PREFIX"},
Destination: &cfg.Reva.Frontend.OCDavPrefix,
},

// Gateway

Expand Down

0 comments on commit b75cfbf

Please sign in to comment.