-
Notifications
You must be signed in to change notification settings - Fork 1
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
Support open-with #161
Comments
First exploration of this: I'm seeing the config related to appprovider / appregistry - will find the code related to this and see if it's supposed to listen on the /app prefix. Currently it's not in my test server, but maybe I misconfigured it:
|
# docker-compose configuration file for WOPI server + Postgres + apps (CodiMD, Etherpad, Onlyoffice), for dev purposes
#
# Run with e.g.: HOST_HOSTNAME=`hostname` DBCODIPWD='your_codimd_db_pwd' DBETHPWD=`your_etherpad_db_pwd` CODEADMINPWD=`your_collabora_admin_pwd` WOPIVER=latest docker-compose -f dev_codimd_wopi.yaml up -d
#
version: "3.1"
services:
wopiserver:
#image: cs3org/wopiserver:${WOPIVER}-xrootd
image: wopiserver:cern
container_name: wopiserver
hostname: cbox-wopiserver
network_mode: host
restart: always
secrets:
- cboxcert.pem
- cboxkey.pem
- codimd_apikey
- etherpad_apikey
environment:
- DEBUG_METRICS=false
- HOST_HOSTNAME=${HOST_HOSTNAME}
- XRD_TIMEOUTRESOLUTION=1
volumes:
- config:/etc/wopi
- logs:/var/log/wopi
- wopi_recovery:/var/spool/wopirecovery
- wopi_local_storage:/var/wopi_local_storage
- /var/lib/sss/pipes:/var/lib/sss/pipes
healthcheck:
test: ["CMD", "curl", "--insecure", "https://localhost:8443"]
interval: 600s
timeout: 5s
retries: 3
database:
image: postgres:11.6-alpine
container_name: codimd-postgres
hostname: cbox-codimd-postgres
network_mode: appsnet
environment:
- POSTGRES_USER=codimd
- POSTGRES_PASSWORD=${DBCODIPWD}
- POSTGRES_DB=codimd
volumes:
- database-data:/var/lib/postgresql/data
- upload-data:/home/hackmd/app/public/uploads
restart: always
codimd:
image: gitlab-registry.cern.ch/authoring/notes/codimd:cernbox-integration
#image: gitlab-registry.cern.ch/lopresti/codimd:cernbox-integration
container_name: codimd-web
hostname: cbox-codimd-web
network_mode: appsnet
environment:
- CMD_DB_URL=postgres://codimd:${DBCODIPWD}@codimd-postgres/codimd
- CMD_AUTO_VERSION_CHECK=false
- CMD_USECDN=false
- CMD_ALLOW_ANONYMOUS=true
- CMD_ALLOW_ANONYMOUS_EDITS=true
- CMD_ALLOW_ANONYMOUS_VIEWS=true
- CMD_ALLOW_FREEURL=true
- CMD_EMAIL=false
- CMD_ALLOW_EMAIL_REGISTER=false
- CMD_ALLOW_GRAVATAR=true
- CMD_ALLOW_PDF_EXPORT=true
- NODE_TLS_REJECT_UNAUTHORIZED=0
- CMD_DOMAIN=${HOST_HOSTNAME}
- CMD_URL_ADDPORT=true
- CMD_URL_PATH=
- CMD_USESSL=true
- CMD_PROTOCOL_USESSL=true
- CMD_APPLIANCE_MODE=true
- CMD_API_BODY_LIMIT=210000
- CMD_FILEPICKER_URL=https://filepicker-dev.cernbox.cern.ch
# this is a workaround for the PDF export
- QT_QPA_PLATFORM=
# the following must be stored properly, this is a test key
- CMD_API_KEY=testsecret
secrets:
- cert.pem
- key.pem
- dhparam.pem
- codimd_apikey
depends_on:
- database
ports:
- 3000:3000
restart: always
etherpad:
# the cern tag is to be created with the following build command, from a checkout of github.com/ether/etherpad-lite and
# after having amended the settings.json.docker file with etherpad_settings.json.docker_patch:
# docker build --build-arg ETHERPAD_PLUGINS="ep_sciencemesh ep_font_size ep_font_family ep_font_color ep_spellcheck ep_table_of_contents ep_subscript_and_superscript ep_mammoth ep_print ep_comments_page ep_embedded_hyperlinks2 ep_auth_session ep_align ep_special_characters ep_markdown ep_image_upload ep_mathjax" --build-arg INSTALL_SOFFICE=True --tag etherpad/etherpad:cern .
image: etherpad/etherpad:cern
container_name: etherpad
hostname: cbox-etherpad
network_mode: appsnet
restart: always
ports:
- 9001:9001
environment:
- SOFFICE=/usr/bin/soffice
- DB_TYPE=postgres
- DB_HOST=codimd-postgres
- DB_PORT=5432
- DB_USER=etherpad
- DB_PASS=${DBETHPWD}
- TITLE=Etherpad for CERNBox
- DEFAULT_PAD_TEXT=This is Etherpad for CERNBox
#- LOGLEVEL=DEBUG
secrets:
- cert.pem
- key.pem
- etherpad_apikey
command: ["node", "node_modules/ep_etherpad-lite/node/server.js", "--apikey", "/var/run/secrets/etherpad_apikey"]
healthcheck:
test: ["CMD", "curl", "-k", "https://localhost:9001"]
interval: 600s
timeout: 5s
retries: 3
onlyoffice:
image: onlyoffice/documentserver:latest
container_name: onlyoffice
hostname: cbox-onlyoffice
network_mode: appsnet
restart: always
ports:
- 8000:443
- 8880:80
volumes:
- oo-data:/var/www/onlyoffice/Data
- oo-logs:/var/log/onlyoffice
environment:
- USE_UNAUTHORIZED_STORAGE="true"
healthcheck:
test: ["CMD", "curl", "http://localhost"]
interval: 600s
timeout: 5s
retries: 3
collabora:
image: collabora/code:latest
container_name: collabora
hostname: cbox-collabora
network_mode: appsnet
restart: always
ports:
- 9980:9980
environment:
- server_name=${HOST_HOSTNAME}:9980
- domain=wopiqa\.cernbox\.cern\.ch:8443
- cert_domain=1
- DONT_GEN_SSL_CERT=1
- extra_params=--o:ssl.cert_file_path=/var/run/secrets/cert.pem --o:ssl.key_file_path=/var/run/secrets/key.pem --o:ssl.ca_file_path=/var/run/secrets/ca-chain.pem
- username=admin
- password=${CODEADMINPWD}
secrets:
- cert.pem
- key.pem
- ca-chain.pem
healthcheck:
test: ["CMD", "curl", "-k", "https://localhost:9980"]
interval: 600s
timeout: 5s
retries: 3
secrets:
cboxcert.pem:
file: /etc/grid-security/cernbox-hostcert.pem
cboxkey.pem:
file: /etc/grid-security/cernbox-hostkey.pem
cert.pem:
file: /etc/grid-security/hostcert.pem
key.pem:
file: /etc/grid-security/hostkey.pem
# the key file was obtained as:
# cd /var/lib/puppet/ssl/private_keys && cp ${HOST_HOSTNAME}.pem ${HOST_HOSTNAME}.key && chmod 644 ${HOST_HOSTNAME}.key
dhparam.pem:
file: /etc/grid-security/dhparam.pem
ca-chain.pem:
file: /root/APPS/etc/ca-chain.pem
codimd_apikey:
file: /etc/wopi/codimd_apikey
etherpad_apikey:
file: /etc/wopi/etherpad_apikey
volumes:
config: {}
logs: {}
wopi_recovery: {}
wopi_local_storage: {}
database-data: {}
upload-data: {}
oo-logs: {}
oo-data: {}
networks:
appsnet: |
Working on this in https://github.com/pondersource/dev-stock/tree/sciencemesh-open-with |
How should I configure apps in Reva? I don't see much documentation in https://reva.link/docs/config/http/services/appprovider/ and the docker compose @glpatcern sent me doesn't include a reva config file, I think? I also don't see anything in https://github.com/cs3org/reva/tree/master/examples I'll try out https://reva.link/docs/tutorials/wopi-tutorial/ Got quite far with that now I think (see https://github.com/pondersource/dev-stock/commits/sciencemesh-open-with) but now uploading example.txt to Reva is not working. I tried https://reva.link/docs/tutorials/share-tutorial/#5-1-3-upload-the-example-txt-file but got:
|
Hm, still getting a malformed response to 'Put "http://localhost:19000/data/simple/2009075f-806e-4ae5-ba4f-5594a382590a?xs=764efa883dda1e11db47671c4a3bbd9e&xs_type=md5"', will go back to when the OCMD tutorial was working and bisect from there. |
OK, so ocmd-server-1.toml is running a data provider on http :19001 with driver "localhome". That is the correct driver for revad1.toml which I'm testing with now (will need to test this with revanc1.toml etc as well!) Trying now:
|
Next issue:
|
This might be useful (thanks @glpatcern!): https://github.com/cs3org/reva/tree/master/examples/storage-references |
Hm, still getting
even though I have https://github.com/pondersource/dev-stock/blob/sciencemesh-open-with/sciencemesh-open-with.toml#L97 |
We really need a working demo of this, so we can add it to Reva's example folder or point to it from the docs. Apparently there still is something wrong in my config, configuring Reva is hard! :( |
@glpatcern I think if you don't know how open-with works in Reva then nobody will! :) Can you please document it somewhere? |
I will! I acknowledge the documentation is scattered and incomplete. To start with, we have:
Instead, https://developer.sciencemesh.io/docs/technical-documentation/iop/iop-optional-configs/codimd/codimd needs a significant refresh - I'm working on it. So for now you could target the Reva app provider for Collabora (and already the app provider + mimetype configuration documentation is to be improved) and the configuration of Reva + WOPI server. But let's keep in touch for any update on this. |
An update:
|
After talking with @glpatcern
The steps are these:
|
And I have updated the app examples to fix what we found on the way: you have both a Collabora and CodiMD example in the Reva codebase. Suggest to start with Collabora as it's simpler (single container). |
So I just run WOPI server on my workstation by these steps: ℹ️ 1- I cloned this repository. 2- I changed the type of this bash file from shell to bash by changing the 3- install rpm build component on my machine by these commands:
4- build the docker image using this command:
5- run wopi server by this command:
|
So, I think I should describe current condition:
I restart the reva server but: 1- When I am browsing the |
when I update the reva.toml and add this section:
reva will crash. I checked log: So I removed the existing and the error disappeared but a new error interrupted :
so I create a custom-mime-types-demo.json file inside /etc/revad like this : |
so, Error changed to:
|
whith this final config :
I am facing with bellow error
|
Collabora installation guide ℹ️ |
I see a bit of confusion in the above comments, trying to clear things out:
Therefore |
please adjust me if I am wrong. CodeiMD and Collabora are interchangeable with each other. that's right? ❓ |
They almost are. CodiMD is not a WOPI native application (and it is deployed with two containers), and it requires an extra configuration option in In terms of Helm charts, the reference is https://developer.sciencemesh.io/docs/technical-documentation/iop/iop-optional-configs/codimd/codimd but I understand you're not using those. |
Ok, I will work with Collabora then. thank you for the hints and guidance. I will share as I finished the R&D phase. 🙏 |
If you share your docker-compose files, I can help kick-starting this also on CodiMD. With Collabora, clearly the idea is to connect it to wopiserver and reva: the Nextcloud tutorial is actually of no use as it would connect it directly to Nextcloud. |
I guess we are wrong somehow:
But the token generate api works properly ind it indicate our reva is in healthy mode. |
Thank to @glpatcern We had a instructive chat and he provide me some great hints: next is:
and then: finally: |
|
ℹ️ So It seems I should configure my wopiserver like this : |
ℹ️ @glpatcern found a point in my reva.tomel file. configuration sample: |
😁 💥
returns:
|
ℹ️ 🔴
instead you should configure it as per the same link
|
💥 ℹ️
|
@navid-shokri did you get the wopiserver up and running? And for the parameters, you can specify either the |
Yes, it is Up and running. I sent a sample and a random string. the latest example that I sent was just for checking the request structure. |
OK, more specifically does it show
No, the |
I thought to provide here a summary of what we need to progress with the open-with flow, also given the findings in the ScienceMesh "hackathons". In terms of configuration:
In terms of ScienceMesh app developments:
For local apps, in addition to the CS3API Locks in the
For local apps reva provides a "discovery" endpoint at |
Superseded by sciencemesh/nc-sciencemesh#53 |
out of scope:
The text was updated successfully, but these errors were encountered: