From f50701ebbc41a3ccfaacc3fbf5c6d2d40160d94d Mon Sep 17 00:00:00 2001 From: micbar Date: Tue, 13 Oct 2026 17:40:46 +0200 Subject: [PATCH] fix: add config to skip share manager migrations --- .woodpecker.star | 2 ++ services/sharing/pkg/config/config.go | 1 + services/sharing/pkg/revaconfig/config.go | 1 + 3 files changed, 4 insertions(+) diff --git a/.woodpecker.star b/.woodpecker.star index 1f861166a0..510b1b5bd5 100644 --- a/.woodpecker.star +++ b/.woodpecker.star @@ -2456,6 +2456,8 @@ def opencloudServer(storage = "decomposed", depends_on = [], deploy_type = "", e "SEARCH_DEBUG_ADDR": "0.0.0.0:9224", "SETTINGS_DEBUG_ADDR": "0.0.0.0:9194", "SHARING_DEBUG_ADDR": "0.0.0.0:9151", + # the ocwrapper restarts the server mid-migration and leaves a stale migration lock behind + "SHARING_USER_JSONCS3_SKIP_MIGRATIONS": True, "SSE_DEBUG_ADDR": "0.0.0.0:9139", "STORAGE_PUBLICLINK_DEBUG_ADDR": "0.0.0.0:9179", "STORAGE_SHARES_DEBUG_ADDR": "0.0.0.0:9156", diff --git a/services/sharing/pkg/config/config.go b/services/sharing/pkg/config/config.go index 20f83bbe4a..25b77a8d5d 100644 --- a/services/sharing/pkg/config/config.go +++ b/services/sharing/pkg/config/config.go @@ -102,6 +102,7 @@ type UserSharingJSONCS3Driver struct { SystemUserAPIKey string `yaml:"system_user_api_key" env:"OC_SYSTEM_USER_API_KEY;SHARING_USER_JSONCS3_SYSTEM_USER_API_KEY" desc:"API key for the STORAGE-SYSTEM system user." introductionVersion:"1.0.0"` CacheTTL int `yaml:"cache_ttl" env:"SHARING_USER_JSONCS3_CACHE_TTL" desc:"TTL for the internal caches in seconds." introductionVersion:"1.0.0"` MaxConcurrency int `yaml:"max_concurrency" env:"OC_MAX_CONCURRENCY;SHARING_USER_JSONCS3_MAX_CONCURRENCY" desc:"Maximum number of concurrent go-routines. Higher values can potentially get work done faster but will also cause more load on the system. Values of 0 or below will be ignored and the default value will be used." introductionVersion:"1.0.0"` + SkipMigrations bool `yaml:"skip_migrations" env:"SHARING_USER_JSONCS3_SKIP_MIGRATIONS" desc:"Do not run the share manager data migrations on startup. Only meant for test environments, skipped migrations are not applied later." introductionVersion:"%%NEXT%%"` } // ServiceAccount is the configuration for the used service account diff --git a/services/sharing/pkg/revaconfig/config.go b/services/sharing/pkg/revaconfig/config.go index 278d4359c3..434a71ecee 100644 --- a/services/sharing/pkg/revaconfig/config.go +++ b/services/sharing/pkg/revaconfig/config.go @@ -78,6 +78,7 @@ func SharingConfigFromStruct(cfg *config.Config, logger log.Logger) (map[string] "machine_auth_apikey": cfg.UserSharingDrivers.JSONCS3.SystemUserAPIKey, "ttl": cfg.UserSharingDrivers.JSONCS3.CacheTTL, "max_concurrency": cfg.UserSharingDrivers.JSONCS3.MaxConcurrency, + "skip_migrations": cfg.UserSharingDrivers.JSONCS3.SkipMigrations, "service_account_id": cfg.ServiceAccount.ServiceAccountID, "service_account_secret": cfg.ServiceAccount.ServiceAccountSecret, "events": map[string]any{