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

allow configuring user sharing driver, default to json #115

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
5 changes: 5 additions & 0 deletions changelog/unreleased/user-sharing-driver-json.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
Enhancement: Allow configuring user sharing driver

We now default to `json` which persists shares in the sharing manager in a json file instead of an in memory db.

https://github.com/owncloud/ocis-reva/pull/115
4 changes: 2 additions & 2 deletions pkg/command/sharing.go
Original file line number Diff line number Diff line change
Expand Up @@ -84,10 +84,10 @@ func Sharing(cfg *config.Config) *cli.Command {
// TODO build services dynamically
"services": map[string]interface{}{
"usershareprovider": map[string]interface{}{
"driver": "memory",
"driver": cfg.Reva.Sharing.UserDriver,
},
"publicshareprovider": map[string]interface{}{
"driver": "memory",
"driver": cfg.Reva.Sharing.PublicDriver,
},
},
},
Expand Down
9 changes: 8 additions & 1 deletion pkg/config/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,13 @@ type Gateway struct {
DisableHomeCreationOnLogin bool
}

// Sharing defines the available sharing configuration.
type Sharing struct {
Port
UserDriver string
PublicDriver string
}

// Port defines the available port configuration.
type Port struct {
// MaxCPUs can be a number or a percentage
Expand Down Expand Up @@ -212,7 +219,7 @@ type Reva struct {
Users Users
AuthBasic Port
AuthBearer Port
Sharing Port
Sharing Sharing
StorageRoot StoragePort
StorageHome StoragePort
StorageHomeData StoragePort
Expand Down
14 changes: 14 additions & 0 deletions pkg/flagset/sharing.go
Original file line number Diff line number Diff line change
Expand Up @@ -120,5 +120,19 @@ func SharingWithConfig(cfg *config.Config) []cli.Flag {
Usage: "--service usershareprovider [--service publicshareprovider]",
EnvVars: []string{"REVA_SHARING_SERVICES"},
},
&cli.StringFlag{
Name: "user-driver",
Value: "json",
Usage: "driver to use for the UserShareProvider",
EnvVars: []string{"REVA_SHARING_USER_DRIVER"},
Destination: &cfg.Reva.Sharing.UserDriver,
},
&cli.StringFlag{
Name: "public-driver",
Value: "memory",
Usage: "driver to use for the PublicShareProvider",
EnvVars: []string{"REVA_SHARING_PUBLIC_DRIVER"},
Destination: &cfg.Reva.Sharing.PublicDriver,
},
}
}