-
Notifications
You must be signed in to change notification settings - Fork 26
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
Use endpoint for cs3ref + use parent_id for relative paths in CS3Iface #67
Conversation
@dragotin and @wkloucek, shall we schedule some discussion to see how to proceed? I guess you're trying to support spaces, but the key point here is first to define how the |
Update: following yesterday's "hackathon", this is feasible with some more extensions and after cs3org/cs3apis#167 is implemented in Reva. Shouldn't take much effort, we have already sketched the code for |
2577bb5
to
a5de943
Compare
ce05d30
to
4fa41e4
Compare
This requires cs3org/cs3apis#167 and its implementation in Reva in order to work
@glpatcern the |
@glpatcern please feel free to try cs3org/reva#2691. That should unblock the WOPI server on REVA edge. |
Thanks, looks good indeed but I won't have time to test it before Thursday I fear. Will do the equivalent code on Reva master for the eos provider - actually that PR could target Reva master and then get merged to Reva edge. |
I tried it today with the latest oCIS and needed to merge master into this branch and apply following patch to make it work: diff --git a/src/core/cs3iface.py b/src/core/cs3iface.py
index c51de8c..962ca42 100644
--- a/src/core/cs3iface.py
+++ b/src/core/cs3iface.py
@@ -95,8 +95,7 @@ def stat(endpoint, fileref, userid, versioninv=1):
inode = common.encodeinode(statInfo.info.id.storage_id, statInfo.info.id.opaque_id)
# in case we got a relative path, build an hybrid path that can be used to reference the file:
# note that as per specs the parent_id MUST be available in this case
- filepath = statInfo.info.path if statInfo.info.path[0] == '/' else \
- statInfo.info.parent_id.opaque_id + '/' + os.path.basename(statInfo.info.path)
+ filepath = statInfo.info.parent_id.opaque_id + '/' + os.path.basename(statInfo.info.path)
log.info('msg="Invoked stat" fileref="%s" inode="%s" filepath="%s" elapsedTimems="%.1f"' %
(fileref, inode, filepath, (tend-tstart)*1000))
return {
@@ -257,7 +256,7 @@ def readfile(endpoint, filepath, userid, lockid):
# Download
try:
- protocol = [p for p in initfiledownloadres.protocols if p.protocol == "simple"][0]
+ protocol = [p for p in initfiledownloadres.protocols if p.protocol == "simple" or p.protocol == "spaces"][0]
headers = {
'x-access-token': userid,
'x-reva-transfer': protocol.token # needed if the downloads pass through the data gateway in reva
@@ -304,7 +303,7 @@ def writefile(endpoint, filepath, userid, content, lockid, islock=False):
# Upload
try:
# Get the endpoint for simple protocol
- protocol = [p for p in initfileuploadres.protocols if p.protocol == "simple"][0]
+ protocol = [p for p in initfileuploadres.protocols if p.protocol == "simple" or p.protocol == "spaces"][0]
headers = {
'x-access-token': userid,
'Upload-Length': size, Also I had to ensure that external locks are disabled ( Then I could open files in edit mode, though I didn't succeed on saving files. This was most likely caused by the Set/GetXattr logic. From the logs I see that Set/GetXattr on REVA edge might be broken. Also I am not sure why a stat on current REVA edge returns a full path (it didn't the last time I checked) |
@wkloucek thanks for this, you can definitely push the patch on |
No description provided.