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

Config for mapping home directory to different storage providers #480

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions changelog/unreleased/home-mapping.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
Enhancement: Functionality to map home directory to different storage providers

We added a parameter in reva that allows us to redirect /home requests to
different storage providers based on a mapping derived from the user attributes,
which was previously not possible since we hardcode the /home path for all
users. This PR adds the config for that parameter.

https://github.com/owncloud/ocis-reva/pull/480
https://github.com/cs3org/reva/pull/1142
1 change: 1 addition & 0 deletions pkg/command/gateway.go
Original file line number Diff line number Diff line change
Expand Up @@ -111,6 +111,7 @@ func Gateway(cfg *config.Config) *cli.Command {
"datagateway": urlWithScheme(cfg.Reva.DataGateway.URL),
"transfer_shared_secret": cfg.Reva.TransferSecret,
"transfer_expires": cfg.Reva.TransferExpires,
"home_mapping": cfg.Reva.Gateway.HomeMapping,
},
"authregistry": map[string]interface{}{
"driver": "static",
Expand Down
3 changes: 2 additions & 1 deletion pkg/config/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,10 @@ type Gateway struct {
Port
CommitShareToStorageGrant bool
CommitShareToStorageRef bool
DisableHomeCreationOnLogin bool
ShareFolder string
LinkGrants string
DisableHomeCreationOnLogin bool
HomeMapping string
}

// StorageRegistry defines the available storage registry configuration
Expand Down
7 changes: 7 additions & 0 deletions pkg/flagset/gateway.go
Original file line number Diff line number Diff line change
Expand Up @@ -104,6 +104,13 @@ func GatewayWithConfig(cfg *config.Config) []cli.Flag {
EnvVars: []string{"REVA_GATEWAY_DISABLE_HOME_CREATION_ON_LOGIN"},
Destination: &cfg.Reva.Gateway.DisableHomeCreationOnLogin,
},
&cli.StringFlag{
Name: "storage-home-mapping",
Value: "",
Usage: "mapping template for user home paths to user-specific mount points",
EnvVars: []string{"REVA_STORAGE_HOME_MAPPING"},
Destination: &cfg.Reva.Gateway.HomeMapping,
},

// other services

Expand Down