From 721cde18b3a2be17135a7b270a2d1e8d6cf0a19a Mon Sep 17 00:00:00 2001 From: Giuseppe Lo Presti Date: Tue, 31 Oct 2023 09:58:13 +0100 Subject: [PATCH] Prepared config for serving cernbox web from reva --- examples/cernbox/cernbox.toml | 6 ++++-- examples/cernbox/nginx/nginx.conf | 22 +++++++++++----------- tests/sciencemesh/init.sh | 11 +++-------- 3 files changed, 18 insertions(+), 21 deletions(-) diff --git a/examples/cernbox/cernbox.toml b/examples/cernbox/cernbox.toml index 4939ceeef72..60431906fc3 100644 --- a/examples/cernbox/cernbox.toml +++ b/examples/cernbox/cernbox.toml @@ -188,8 +188,7 @@ driver = "json" provider_domain = "{{ vars.provider_domain }}" webdav_endpoint = "{{ vars.external_reva_endpoint }}" webdav_prefix = "{{ vars.external_reva_endpoint }}/remote.php/dav/files" -# TODO the following should become {{ vars.external_reva_endpoint }}/external/{{.Token}}/... -webapp_template = "https://your.revad.org/external/sciencemesh/{{.Token}}/{relative-path-to-shared-resource}" +webapp_template = "{{ vars.external_reva_endpoint }}/external/sciencemesh/{{.Token}}/{relative-path-to-shared-resource}" [grpc.services.ocmshareprovider.drivers.json] file = "{{ vars.ocmshares_json_file }}" @@ -383,5 +382,8 @@ address = ":443" [http.services.sysinfo] +#[http.services.ui] +#address = ":443" + [http.middlewares.cors] [http.middlewares.log] diff --git a/examples/cernbox/nginx/nginx.conf b/examples/cernbox/nginx/nginx.conf index db32df8bc0f..c1e4b8c5e6c 100644 --- a/examples/cernbox/nginx/nginx.conf +++ b/examples/cernbox/nginx/nginx.conf @@ -44,16 +44,14 @@ http { server your.revad.org:443; } - server - { + server { listen 80; server_name localhost; return 301 https://$host$request_uri; } # https://ssl-config.mozilla.org/#server=nginx&version=1.20.1&config=intermediate&openssl=1.0.2k&guideline=5.6 - server - { + server { listen 443 ssl http2; server_name localhost; @@ -73,14 +71,12 @@ http { proxy_buffering off; proxy_request_buffering off; - location ^~ /data - { + location ^~ /data { proxy_pass https://revad; proxy_set_header Host $host; } - location ~ /s/[^/]*/download - { + location ~ /s/[^/]*/download { proxy_pass https://revad; proxy_set_header Host $host; } @@ -130,8 +126,7 @@ http { proxy_set_header Host $host; } - location ^~ /status.php - { + location ^~ /status.php { proxy_pass https://revad; proxy_set_header Host $host; } @@ -144,7 +139,7 @@ http { } location ^~ /cernbox { - root /var/www/; + root /var/www/cernbox; etag off; gzip_static on; } @@ -157,5 +152,10 @@ http { gzip_static on; try_files $uri /index.html; } + +# location / { +# proxy_pass https://revad/ui; +# proxy_set_header Host $host; +# } } } diff --git a/tests/sciencemesh/init.sh b/tests/sciencemesh/init.sh index e4be0973b5c..ad4b754ce75 100755 --- a/tests/sciencemesh/init.sh +++ b/tests/sciencemesh/init.sh @@ -9,10 +9,8 @@ BRANCH_NEXTCLOUD_APP=nextcloud REPO_OWNCLOUD_APP=https://github.com/sciencemesh/nc-sciencemesh BRANCH_OWNCLOUD_APP=owncloud +# TODO will be dropped in favour of Reva directly serving the UI CBOX_WEB=https://github.com/cernbox/web-release/releases/latest/download -# TODO(lopresti) the CERNBox extensions are not released as a 'latest' bundle -# and are for now pushed from a tgz file in this repo -#CBOX_EXT=https://github.com/... REPO_WOPISERVER=https://github.com/cs3org/wopiserver TAG_WOPISERVER=master @@ -52,19 +50,16 @@ TAG_WOPISERVER=master mkdir -p temp/cernbox-1-conf temp/cernbox-2-conf && \ cp cernbox/nginx/* temp/cernbox-1-conf && \ cp cernbox/nginx/* temp/cernbox-2-conf && \ - mkdir -p ./cernbox-web-sciencemesh/web ./cernbox-web-sciencemesh/cernbox && \ cd cernbox-web-sciencemesh && \ + mkdir -p ./web && mkdir -p ./cernbox && \ wget ${CBOX_WEB}/web.tar.gz && \ tar xf web.tar.gz -C ./web --strip-components=1 && \ rm -rf web.tar.gz && \ tar xf ../cernbox/cernbox-extensions-bundle.tgz && \ sed -i "s|\"web-app-draw-io\":\"./web-app-draw-io-.........mjs\",|,|" web/index.html && \ - chmod -R 755 ./web ./cernbox && \ - chown -R 101:101 ./web/ ./cernbox && \ + chmod -R 755 * chown -R 101:101 * && \ cd - -#sed -i "s|WEB_APPS_MAP = {\"web-app-draw-io\":\"./web-app-draw-io-.........mjs\",|WEB_APPS_MAP = {\"web-app-sciencemesh-app\":\".\/web-app-sciencemesh-app-a5ecef59.mjs\",|" web/index.html && \ - # wopiserver source code for the config. [ ! -d "wopi-sciencemesh" ] && \ git clone --branch ${TAG_WOPISERVER} ${REPO_WOPISERVER} wopi-sciencemesh && \