migration fixes

Signed-off-by: Jörn Friedrich Dreyer <jfd@butonic.de>
This commit is contained in:
Jörn Friedrich Dreyer
2022-08-25 15:19:02 +00:00
parent 7636a90a23
commit 1287d1ba52

View File

@@ -14,10 +14,10 @@ import (
"github.com/owncloud/ocis/v2/ocis-pkg/config"
"github.com/owncloud/ocis/v2/ocis-pkg/config/parser"
oclog "github.com/owncloud/ocis/v2/ocis-pkg/log"
"github.com/owncloud/ocis/v2/ocis/pkg/register"
sharing "github.com/owncloud/ocis/v2/services/sharing/pkg/config"
sharingparser "github.com/owncloud/ocis/v2/services/sharing/pkg/config/parser"
"github.com/rs/zerolog"
"github.com/urfave/cli/v2"
)
@@ -70,7 +70,7 @@ func MigrateShares(cfg *config.Config) *cli.Command {
},
},
Action: func(c *cli.Context) error {
log := zerolog.New(zerolog.ConsoleWriter{Out: os.Stderr}).With().Timestamp().Logger()
log := oclog.LoggerFromConfig("migrate", cfg.Log)
ctx := log.WithContext(context.Background())
rcfg := revaShareConfig(cfg.Sharing)
oldDriver := c.String("from")
@@ -155,7 +155,7 @@ func MigratePublicShares(cfg *config.Config) *cli.Command {
},
},
Action: func(c *cli.Context) error {
log := zerolog.New(zerolog.ConsoleWriter{Out: os.Stderr}).With().Timestamp().Logger()
log := oclog.LoggerFromConfig("migrate", cfg.Log)
ctx := log.WithContext(context.Background())
rcfg := revaPublicShareConfig(cfg.Sharing)
@@ -254,6 +254,13 @@ func revaShareConfig(cfg *sharing.Config) map[string]interface{} {
"service_user_idp": cfg.UserSharingDrivers.CS3.SystemUserIDP,
"machine_auth_apikey": cfg.UserSharingDrivers.CS3.SystemUserAPIKey,
},
"jsoncs3": map[string]interface{}{
"gateway_addr": cfg.UserSharingDrivers.JSONCS3.ProviderAddr,
"provider_addr": cfg.UserSharingDrivers.JSONCS3.ProviderAddr,
"service_user_id": cfg.UserSharingDrivers.JSONCS3.SystemUserID,
"service_user_idp": cfg.UserSharingDrivers.JSONCS3.SystemUserIDP,
"machine_auth_apikey": cfg.UserSharingDrivers.JSONCS3.SystemUserAPIKey,
},
}
}