Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add AppRegistry config for static driver #2561

Closed
wants to merge 3 commits into from
Closed
Show file tree
Hide file tree
Changes from 2 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/reva-appregistry-config.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
Enhancement: Add AppRegistry config for static driver

We added the reva config for the static driver of the AppRegistry.

https://github.com/owncloud/ocis/pull/2561
6 changes: 6 additions & 0 deletions storage/pkg/command/gateway.go
Original file line number Diff line number Diff line change
Expand Up @@ -167,6 +167,12 @@ func gatewayConfigFromStruct(c *cli.Context, cfg *config.Config, logger log.Logg
},
"appregistry": map[string]interface{}{
"driver": "static",
"drivers": map[string]interface{}{
"static": map[string]interface{}{
"providers": cfg.Reva.AppRegistry.Providers,
"mime_types": cfg.Reva.AppRegistry.MimeTypes,
},
},
},
"storageregistry": map[string]interface{}{
"driver": cfg.Reva.StorageRegistry.Driver,
Expand Down
22 changes: 21 additions & 1 deletion storage/pkg/config/config.go
Original file line number Diff line number Diff line change
@@ -1,6 +1,10 @@
package config

import "context"
import (
"context"

registrypb "github.com/cs3org/go-cs3apis/cs3/app/registry/v1beta1"
)

// Log defines the available logging configuration.
type Log struct {
Expand Down Expand Up @@ -62,6 +66,21 @@ type WopiDriver struct {
WopiURL string
}

// AppRegistry defines the available app registry configuration
type AppRegistry struct {
Providers map[string]registrypb.ProviderInfo
MimeTypes map[string]MimeTypeConfig
}

// MimeTypeConfig defines the config for a mime type
type MimeTypeConfig struct {
Extension string
Name string
Description string
Icon string
DefaultApp string
}

// Sharing defines the available sharing configuration.
type Sharing struct {
Port
Expand Down Expand Up @@ -450,6 +469,7 @@ type Reva struct {
StoragePublicLink PublicStorage
StorageMetadata StoragePort
AppProvider AppProvider
AppRegistry AppRegistry
// Configs can be used to configure the reva instance.
// Services and Ports will be ignored if this is used
Configs map[string]interface{}
Expand Down