Skip to content
Snippets Groups Projects
Commit 808a7b74 authored by František Dvořák's avatar František Dvořák
Browse files

Implement changes in ownCloud integration - finalize

parent eb8fe6a2
No related branches found
No related tags found
No related merge requests found
......@@ -52,9 +52,9 @@ singleuser:
- name: owncloud-home
mountPath: '/home/jovyan:shared'
- name: owncloud-shared
mountPath: '/home/jovyan/Shared:shared'
mountPath: '/owncloud/shared:shared'
- name: owncloud-spaces
mountPath: '/home/jovyan/Spaces:shared'
mountPath: '/owncloud/spaces:shared'
# - name: scratch
# mountPath: '/scratch'
memory:
......@@ -85,9 +85,9 @@ singleuser:
image: "valtri/single-user:jupyter-4e-collab"
cmd: jupyterhub-singleuser-webdav-wrapper
extraFiles:
wait-owncloud.sh:
wait-remote-home.sh:
mode: 0755
mountPath: /usr/local/bin/jupyterhub-singleuser-webdav-wrapper
mountPath: /usr/local/bin/jupyterhub-wait-remote-home
stringData: |-
#! /bin/sh
......@@ -104,6 +104,12 @@ singleuser:
sleep 0.5
i=$((i+1))
done
singleuser-webdav-wrapper.sh:
mode: 0755
mountPath: /usr/local/bin/jupyterhub-singleuser-webdav-wrapper
stringData: |-
#! /bin/sh
/usr/local/bin/jupyterhub-wait-remote-home
cd .
......@@ -156,6 +162,7 @@ hub:
egi-notebooks-b2drop: |-
{% raw %}
import base64
import json
from jinja2 import BaseLoader
from jinja2 import Environment
from egi_notebooks_hub.onedata import OnedataSpawner
......@@ -260,10 +267,12 @@ hub:
)
try:
resp = await http_client.fetch(req)
ocis_infos = json.loads(resp.body.decode("utf8", "replace"))
self.log.info("OCIS response: %s", ocis_infos)
if len(ocis_infos) >= 1 and "root" in ocis_infos[0]:
owncloud_url = get(ocis_infos[0]["root"], "webDavUrl", None)
body = json.loads(resp.body.decode("utf8", "replace"))
self.log.debug("OCIS response: %s", body)
if "value" in body:
ocis_infos = body["value"]
if len(ocis_infos) >= 1 and "root" in ocis_infos[0]:
owncloud_url = ocis_infos[0]["root"].get("webDavUrl", None)
except HTTPClientError as e:
self.log.error("can't query ownCloud: %s", e)
self.log.info("ownCloud %s URL: %s", type, owncloud_url)
......@@ -319,7 +328,7 @@ hub:
}
# ownCloud user home
await self.append_owncloud_sidecar(spawner, "home", self.OCIS_PERSONAL_SPACE, fallback_url=self.OCIS_URL + "/remote.php/webdav/", headers=headers)
await self.append_owncloud_sidecar(spawner, "home", self.OCIS_PERSONAL_SPACE, headers=headers)
await self.append_owncloud_sidecar(spawner, "shared", self.OCIS_SHARED_WITH_ME, headers=headers)
await self.append_owncloud_sidecar(spawner, "spaces", self.OCIS_SPACES, headers=headers)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment