-
Notifications
You must be signed in to change notification settings - Fork 183
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
[Spaces] [Desktop] OCIS Spaces Migration API #3574
Comments
@dragotin @michaelstingl @TheOneRing I think this is pretty much it, please let me know any comments. |
I'm against jsonifying the local settings also the local path could contain sensitive information the user does not want to share with a server and I don't think any decisions should be made based on the local path. |
@TheOneRing can you propose a request payload and expected response with the required attributes that you think will be needed? Thanks! |
I think all we need is something like this: Body: {
"version": "2.11",
"folders": [
"/",
"/Documents",
"/eos/a/Alice",
"/Shares/"
]
} Response: 400 {
"error": "Migration failed due to"
} Response: 200 {
"folders": {
"/": [
{
"space_id": "PERSONAL SPACE ID OF gonzalhu",
"path": "/"
}
],
"/Documents": [
{
"space_id": "PERSONAL SPACE ID OF gonzalhu",
"path": "/Documents"
}
],
"/eos/a/Alice": [
{
"space_id": "PERSONAL SPACE ID OF Alice",
"path": "/"
}
],
"/Share": [
{
"error": "Shares can't be migrated"
}
]
}
} The client will then map the folder sync pairs to the spaces using the space id and the new relative paths. |
@TheOneRing asked me for feedback, so, with the iOS client's internals in mind, here's - in broad strokes - what I think should work to convert an OC10 (spaces-incapable) account to a spaces-backed account:
{
"folders": {
"/": [
{
"space_id": "PERSONAL SPACE ID OF gonzalhu",
"path": "/"
}
],
"/Documents": [
{
"space_id": "PERSONAL SPACE ID OF gonzalhu",
"path": "/Documents"
}
],
"/eos/a/Alice": [
{
"space_id": "PERSONAL SPACE ID OF Alice",
"path": "/"
},
"/vanished/share" : [
"error" : "This share could not be migrated and has been removed.",
"removed" : true
]
]
},
} I omitted the error message when replicating @TheOneRing's example because the endpoint would not take any parameters or configuration. Instead, it would only return the map to use when mapping legacy paths to their migrated driveID + path pairs. And each client would then leverage that map to translate/migrate its data set and settings. Regarding shares: the map would also include the legacy root paths of all shares, mapped to the drive ID + path pairs they have been migrated to. Where shares can't be migrated (and would need to be removed), the share's respective root path would appear in the map with an error and an indication that it has been removed. |
We discussed that that the sync client is as dummy as possible and does not perform any complex logic, therefore, we push it to the server and hence we We want migration to be progressive, per user, per account. There isn't another way for a production migration to make it transparent. We only allow our users to have one account configured at a time, so migration could be even per user, that depends on your requirements. Our sync clients query the following endpoint: This endpoint is public and does not contain any user-specific behaviour, so I'm against adding capabilities based on username here. So, I'm pretty much in favour on taking @TheOneRing proposal to make it simply and just having this static capability. |
@labkode Thanks for sharing the context and thoughts behind this. There are still a few things that aren't clear to me, however:
I.e. would it have to also identify all share roots in the account's folder tree and also send those shares along to get info on them?
|
What additional information besides the user name and the old dav url are needed? I've already spend days (felt like years) trying to figure out how customers managed to break the owncloud.cfg by applying clever deployment tricks. |
Shares will be exposed under a new endpoint outside of the current personal folder, i.e they won't be mounted inside a personal home space anymore. The current remote path for default installations is
Right. We cannot have a state on the server per user, and having the state per-user-client is even more difficult.
Because the server does not know what remote folders the user is querying. |
@TheOneRing @felix-schwarz any news on this? |
Ok, let me try to summarize this, and make it actionable: ReasoningThe client sends parts of the old configuration to an endpoint on the server side to get knowledge about the space ID and a path component if applicable. If that call succeeds, the client will be able to compute if it can re-use already synced folders by looking up the content of the For the site administrators it is a way to be in control how many migrations happen and if they happened. The migration step is a one time activity. If the client has once successfully received the information, it does not try to call the migration endpoint again. FlowCapabilityThere is a capability if the migration endpoint should called at all. Capabilities are not user specific, so this is the general switch for all users. Send ConfigurationThe client sends a json document to a specific migration endpoint
In case the client should not yet be migrated, the server responds with Note: The local client paths are useless for the migration routine on the server because local paths are completely under the control of the different clients. If one user has two desktop clients f. ex. the local paths can be different on each. The migration needs to work for both, however. Questions
|
About Shares:I'd suggest to not migrate the Shares at all to reduce complexity in the client implementations. If a legacy user syncs the entire cloud with only one sync connection, the flow would look like:
and the sync client would only migrate the Personal space. In the first sync run, the @labkode How would that work with the CERN projects that you have in the legacy system? |
@dragotin that is what Hannah proposed and I think it can work. The only part that is missing is that we won't enable this migration for all users at the same time for obvious reasons, so we need to keep control on when the sync client triggers the migration. For that I proposed to have a different status code
|
Agreed, that is what @TheOneRing suggested, I just wanted to summarize the facts again so that we're all on the same page. I added your 204 suggestion to my summary above, thanks. |
@dragotin any update on the implementation? |
This issue has been automatically marked as stale because it has not had recent activity. It will be closed in 10 days if no further activity occurs. Thank you for your contributions. |
@fmoc @TheOneRing can you give an update? |
Can be tested with the 3.0-pre-release builds. A branded build was sent to @labkode |
This issue has been automatically marked as stale because it has not had recent activity. It will be closed in 10 days if no further activity occurs. Thank you for your contributions. |
This issue describes a possible API to be implemented in the server that the sync client can use to translate existing sync folder pairs to spaces endpoints.
Follow-up of #3528
How to trigger space migration?
The sync client will read the usual capabilities endpoint:
If the
migration>space_migration>enabled
equalstrue
then the following logic is performed.Configuration
Let's take the following Mac OS Desktop Sync client configuration as an example:
The sync client needs to extract the relevant information in a parseable common format, I use JSON as it is wide spreaded. I suggest the sync clients send ALL the information available but redacts or omits secrets. The approach of sending all the configuration information is a safeguard to prevent the case where we miss some field and then we need another version of the sync client to handle it (and another round of desktop sync client updates).
Payload Request (PAYREQ)
This is an example of the desktop client whose config has not been migrated, i.e all the sync folder pairs
are on the old format.
Payload Response (PAYRES)
API
204: account not enabled to be migrated, nothing to do
200: configuration for account already migrated, nothing to do.
201: client applies configuration to migrate to spaces
Request
curl -X POST remote.server/space-migration --data-binary @/tmp/request-payload.json
The workflow will be like this for old and new clients to make the migration not breaking existing clients.
Old clients that do not know about new capability
New clients that now to handle the new capability
FAQ
When you are an operator you want to take a quick look at the webserver logs and quickly identify the request and behaviour expressed by the server.
The logs from a user account
gonzalhu
will look like this:verify
parameter?The verify is sent as a way to perform a double-commit on the sync client and to differentiate from the
200
response without the verify. It also helps the operator to understand what is going on. For example, if the verify is not seen that means that the sync client crashed/quit and the migration couldn't be completed in a safe way. The last thing we want is to leave a sync client broken and having to perform manual investigations on the user computer to fix it.The text was updated successfully, but these errors were encountered: