Skip to content
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

add OnlyOffice and CodiMD to wopi deployment example #2478

Merged
merged 12 commits into from
Oct 8, 2021
4 changes: 2 additions & 2 deletions deployments/continuous-deployment-config/ocis_wopi/latest.yml
Original file line number Diff line number Diff line change
Expand Up @@ -37,10 +37,10 @@
TRAEFIK_ACME_MAIL: wkloucek@owncloud.com
OCIS_DOCKER_TAG: latest
OCIS_DOMAIN: ocis.ocis-wopi.latest.owncloud.works
OCIS_WOPISERVER_DOCKER_TAG: latest
CS3ORG_WOPISERVER_DOCKER_TAG: latest
WOPISERVER_DOMAIN: wopiserver.ocis-wopi.latest.owncloud.works
COLLABORA_DOMAIN: collabora.ocis-wopi.latest.owncloud.works
ONLYOFFICE_DOMAIN: onlyoffice.ocis-wopi.latest.owncloud.works
CODIMD_DOMAIN: codimd.ocis-wopi.latest.owncloud.works
COMPOSE_FILE: docker-compose.yml:monitoring_tracing/docker-compose-additions.yml
- name: monitoring
git_url: https://github.com/owncloud-devops/monitoring-tracing-client.git
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,10 +37,10 @@
TRAEFIK_ACME_MAIL: wkloucek@owncloud.com
OCIS_DOCKER_TAG: 1
OCIS_DOMAIN: ocis.ocis-wopi.released.owncloud.works
OCIS_WOPISERVER_DOCKER_TAG: latest
CS3ORG_WOPISERVER_DOCKER_TAG: latest
WOPISERVER_DOMAIN: wopiserver.ocis-wopi.released.owncloud.works
COLLABORA_DOMAIN: collabora.ocis-wopi.released.owncloud.works
ONLYOFFICE_DOMAIN: onlyoffice.ocis-wopi.released.owncloud.works
CODIMD_DOMAIN: codimd.ocis-wopi.released.owncloud.works
COMPOSE_FILE: docker-compose.yml:monitoring_tracing/docker-compose-additions.yml
- name: monitoring
git_url: https://github.com/owncloud-devops/monitoring-tracing-client.git
Expand Down
16 changes: 12 additions & 4 deletions deployments/examples/ocis_wopi/.env
Original file line number Diff line number Diff line change
Expand Up @@ -29,10 +29,8 @@ STORAGE_TRANSFER_SECRET=
OCIS_MACHINE_AUTH_API_KEY=

### Wopi server settings ###
# oCIS Wopi server version. Defaults to "latest"
OCIS_WOPISERVER_DOCKER_TAG=
# cs3org wopi server version. Defaults to "latest"
CS3ORG_WOPISERVER_DOCKER_TAG=
WOPISERVER_DOCKER_TAG=
# cs3org wopi server domain. Defaults to "wopiserver.owncloud.test"
WOPISERVER_DOMAIN=
# JWT secret which is used for the documents to be request by the Wopi client from the cs3org Wopi server. Must be change in order to have a secure Wopi server. Defaults to "LoremIpsum567"
Expand All @@ -45,9 +43,19 @@ WOPI_IOP_SECRET=
COLLABORA_DOMAIN=
# Admin user for Collabora. Defaults to blank, provide one to enable access
COLLABORA_ADMIN_USER=
# Admin password for COllabora. Defaults to blank, provide one to enable access
# Admin password for Collabora. Defaults to blank, provide one to enable access
COLLABORA_ADMIN_PASSWORD=

### OnlyOffice settings ###
# Domain of OnlyOffice, where you can find the frontend. Defaults to "onlyoffice.owncloud.test"
ONLYOFFICE_DOMAIN=

### CodiMD settings ###
# Domain of Collabora, where you can find the frontend. Defaults to "codimd.owncloud.test"
CODIMD_DOMAIN=
# Secret which is used for the communication with the WOPI server. Must be changed in order to have a secure CodiMD. Defaults to "LoremIpsum456"
CODIMD_SECRET=


# If you want to use debugging and tracing with this stack,
# you need uncomment following line. Please see documentation at
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
#!/bin/sh
set -e

apk add curl

#TODO: app driver itself should try again until CodiMD is up...

retries=10
while [[ $retries -gt 0 ]]; do
if curl --silent --show-error --fail http://codimd:3000 > /dev/null; then
ocis storage-app-provider server
else
echo "CodiMD is not yet available, trying again in 10 seconds"
sleep 10
retries=$((retries - 1))
fi
done
echo 'CodiMD was not available after 100 seconds'
exit 1
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
#!/bin/sh
set -e

apk add curl

#TODO: app driver itself should try again until OnlyOffice is up...

retries=10
while [[ $retries -gt 0 ]]; do
if curl --silent --show-error --fail http://onlyoffice/hosting/discovery > /dev/null; then
ocis storage-app-provider server
else
echo "OnlyOffice is not yet available, trying again in 10 seconds"
sleep 10
retries=$((retries - 1))
fi
done
echo 'OnlyOffice was not available after 100 seconds'
exit 1
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,6 @@

set -e

mkdir -p /var/tmp/ocis/.config/
cp /config/proxy-config.json /var/tmp/ocis/.config/proxy-config.json
cp /config/web-config.dist.json /var/tmp/ocis/.config/web-config.json
sed -i 's/ocis.owncloud.test/'${OCIS_DOMAIN:-ocis.owncloud.test}'/g' /var/tmp/ocis/.config/web-config.json

ocis server&
sleep 10

Expand All @@ -26,8 +21,4 @@ ocis accounts update --password $STORAGE_LDAP_BIND_PASSWORD $REVA_USER_UUID
echo "default secrets changed"
echo "##################################################"

ocis kill proxy
sleep 10
ocis proxy server # workaround for loading proxy configuration

wait # wait for oCIS to exit
82 changes: 82 additions & 0 deletions deployments/examples/ocis_wopi/config/ocis/mimetypes.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,82 @@
{
"application/pdf": {
"extension": "pdf",
"name": "PDF",
"description": "PDF document",
"icon": "",
"default_app": "",
"allow_creation": false
},
"application/vnd.oasis.opendocument.text": {
"extension": "odt",
"name": "OpenDocument",
"description": "OpenDocument text document",
"icon": "",
"default_app": "Collabora",
"allow_creation": true
},
"application/vnd.oasis.opendocument.spreadsheet": {
"extension": "ods",
"name": "OpenSpreadsheet",
"description": "OpenDocument spreadsheet document",
"icon": "",
"default_app": "Collabora",
"allow_creation": true
},
"application/vnd.oasis.opendocument.presentation": {
"extension": "odp",
"name": "OpenPresentation",
"description": "OpenDocument presentation document",
"icon": "",
"default_app": "Collabora",
"allow_creation": true
},
"application/vnd.openxmlformats-officedocument.wordprocessingml.document": {
"extension": "docx",
"name": "Microsoft Word",
"description": "Microsoft Word document",
"icon": "",
"default_app": "OnlyOffice",
"allow_creation": true
},
"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet": {
"extension": "xlsx",
"name": "Microsoft Excel",
"description": "Microsoft Excel document",
"icon": "",
"default_app": "OnlyOffice",
"allow_creation": true
},
"application/vnd.openxmlformats-officedocument.presentationml.presentation": {
"extension": "pptx",
"name": "Microsoft PowerPoint",
"description": "Microsoft PowerPoint document",
"icon": "",
"default_app": "OnlyOffice",
"allow_creation": true
},
"application/vnd.jupyter": {
"extension": "ipynb",
"name": "Jupyter Notebook",
"description": "Jupyter Notebook",
"icon": "",
"default_app": "",
"allow_creation": true
},
"text/markdown": {
"extension": "md",
"name": "Markdown file",
"description": "Markdown file",
"icon": "",
"default_app": "CodiMD",
"allow_creation": true
},
"application/compressed-markdown": {
"extension": "zmd",
"name": "Compressed markdown file",
"description": "Compressed markdown file",
"icon": "",
"default_app": "CodiMD",
"allow_creation": false
}
}
107 changes: 0 additions & 107 deletions deployments/examples/ocis_wopi/config/ocis/proxy-config.json

This file was deleted.

30 changes: 0 additions & 30 deletions deployments/examples/ocis_wopi/config/ocis/web-config.dist.json

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,8 @@ set -e

echo "${WOPISECRET}" > /etc/wopi/wopisecret
echo "${IOPSECRET}" > /etc/wopi/iopsecret

mkdir -p /var/run/secrets
echo "$CODIMDSECRET" > /var/run/secrets/codimd_apikey

cp /etc/wopi/wopiserver.conf.dist /etc/wopi/wopiserver.conf
sed -i 's/ocis.owncloud.test/'${OCIS_DOMAIN}'/g' /etc/wopi/wopiserver.conf
Expand All @@ -12,9 +13,6 @@ sed -i 's/wopiserver.owncloud.test/'${WOPISERVER_DOMAIN}'/g' /etc/wopi/wopiserve

touch /var/log/wopi/wopiserver.log

# wait for collabora to be up, else file types might be missing at https://wopiserver.owncloud.test/wopi/cbox/endpoints
while ! curl --output /dev/null --silent --head --fail http://collabora:9980; do sleep 1 && echo -n .; done;

/app/wopiserver.py &

tail -f /var/log/wopi/wopiserver.log
Loading