-
Notifications
You must be signed in to change notification settings - Fork 189
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
[full-ci] read-only storagehome and storageusers #2230
Conversation
Thanks for opening this pull request! The maintainers of this repository would appreciate it if you would create a changelog item based on your changes. |
8bb09c9
to
d0e727d
Compare
6f71e74
to
efe7c15
Compare
💥 Acceptance tests Core-API-Tests-ocis-storage-10 failed. The build is cancelled... |
1 similar comment
💥 Acceptance tests Core-API-Tests-ocis-storage-10 failed. The build is cancelled... |
fde16ff
to
0e22703
Compare
Kudos, SonarCloud Quality Gate passed! |
@@ -142,6 +142,12 @@ func storageHomeConfigFromStruct(c *cli.Context, cfg *config.Config) map[string] | |||
}, | |||
}, | |||
} | |||
if cfg.Reva.StorageHome.ReadOnly { | |||
gcfg := rcfg["grpc"].(map[string]interface{}) | |||
gcfg["interceptors"] = map[string]interface{}{ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This would replace an existing map. You will have to check if it exists and create a new map or append to the existing one. Move that to a function with a name that explains what it does, eg. 'appendInterceptor()' then we can use it to add arbitrary interceptors... Or maybe even generic map[string]interface{}
things 🤔
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes. But the whole struct is created in L113. I don't see a case where there is already another interceptor.
I was digging into it but let us merge now. We will see what is needed when we have a real use case for more interceptors.
if cfg.Reva.StorageUsers.ReadOnly { | ||
gcfg := rcfg["grpc"].(map[string]interface{}) | ||
gcfg["interceptors"] = map[string]interface{}{ | ||
"readonly": map[string]interface{}{}, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same here
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
same answer.
Description
For migration scenarios it can be handy to use a storage provider in read-only mode. For example if we use the ownCloud SQL driver to connect to a ownCloud Classic, readonly mode is a vital step in the migration process.
How it works
read-only
interceptor uses a list of known request types which are allowed.WebUI
Config
STORAGE_HOME_READ_ONLY=true
andSTORAGE_USERS_READ_ONLY=true
OCIS_STORAGE_READ_ONLY=true
Known Issue
storagehome
andstorageusers
which share the same physical storage (which is IMO weird and will be changed in the future)Related Issue
Motivation and Context
How Has This Been Tested?
Screenshots (if appropriate):
Types of changes
Checklist: