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

Commit

Permalink
Merge pull request #363 from butonic/add-datagateway-prefix
Browse files Browse the repository at this point in the history
make frontend prefixes configurable
  • Loading branch information
Vincent Petry authored Jul 9, 2020
2 parents fcd3fc2 + 5bd5824 commit bd7479b
Show file tree
Hide file tree
Showing 4 changed files with 48 additions and 2 deletions.
14 changes: 14 additions & 0 deletions changelog/unreleased/make-frontend-prefixes-configurable.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
Enhancement: make frontend prefixes configurable

We introduce three new environment variables and preconfigure them the following way:

```
REVA_FRONTEND_DATAGATEWAY_PREFIX="data"
REVA_FRONTEND_OCDAV_PREFIX=""
REVA_FRONTEND_OCS_PREFIX="ocs"
```

This restores the reva defaults that were changed upstream.

https://github.com/owncloud/ocis-reva/pull/363
https://github.com/cs3org/reva/pull/936/files#diff-51bf4fb310f7362f5c4306581132fc3bR63
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.OCSPrefix,
},

// Gateway

Expand Down

0 comments on commit bd7479b

Please sign in to comment.