switch to app provider, add codimd

This commit is contained in:
Willy Kloucek
2021-09-30 10:52:58 +02:00
parent 30a8132d12
commit 9f04fa774b
7 changed files with 156 additions and 162 deletions

View File

@@ -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

View File

@@ -0,0 +1,72 @@
{
"application/pdf": {
"extension": "pdf",
"name": "PDF",
"description": "PDF document",
"icon": "",
"default_app": ""
},
"application/vnd.oasis.opendocument.text": {
"extension": "odt",
"name": "OpenDocument",
"description": "OpenDocument text document",
"icon": "",
"default_app": "Collabora"
},
"application/vnd.oasis.opendocument.spreadsheet": {
"extension": "ods",
"name": "OpenSpreadsheet",
"description": "OpenDocument spreadsheet document",
"icon": "",
"default_app": "Collabora"
},
"application/vnd.oasis.opendocument.presentation": {
"extension": "odp",
"name": "OpenPresentation",
"description": "OpenDocument presentation document",
"icon": "",
"default_app": "Collabora"
},
"application/vnd.openxmlformats-officedocument.wordprocessingml.document": {
"extension": "docx",
"name": "Microsoft Word",
"description": "Microsoft Word document",
"icon": "",
"default_app": "OnlyOffice"
},
"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet": {
"extension": "xlsx",
"name": "Microsoft Excel",
"description": "Microsoft Excel document",
"icon": "",
"default_app": "OnlyOffice"
},
"application/vnd.openxmlformats-officedocument.presentationml.presentation": {
"extension": "pptx",
"name": "Microsoft PowerPoint",
"description": "Microsoft PowerPoint document",
"icon": "",
"default_app": "OnlyOffice"
},
"application/vnd.jupyter": {
"extension": "ipynb",
"name": "Jupyter Notebook",
"description": "Jupyter Notebook",
"icon": "",
"default_app": ""
},
"text/markdown": {
"extension": "md",
"name": "Markdown file",
"description": "Markdown file",
"icon": "",
"default_app": "CodiMD"
},
"application/compressed-markdown": {
"extension": "zmd",
"name": "Compressed markdown file",
"description": "Compressed markdown file",
"icon": "",
"default_app": "CodiMD"
}
}

View File

@@ -1,107 +0,0 @@
{
"HTTP": {
"Namespace": "com.owncloud"
},
"policy_selector": {
"static": {
"policy": "ocis"
}
},
"policies": [
{
"name": "ocis",
"routes": [
{
"endpoint": "/",
"backend": "http://localhost:9100"
},
{
"endpoint": "/.well-known/",
"backend": "http://localhost:9130"
},
{
"endpoint": "/konnect/",
"backend": "http://localhost:9130"
},
{
"endpoint": "/signin/",
"backend": "http://localhost:9130"
},
{
"type": "regex",
"endpoint": "/ocs/v[12].php/cloud/(users?|groups)",
"backend": "http://localhost:9110"
},
{
"endpoint": "/app/",
"backend": "http://localhost:9140"
},
{
"endpoint": "/ocs/",
"backend": "http://localhost:9140"
},
{
"type": "query",
"endpoint": "/remote.php/?preview=1",
"backend": "http://localhost:9115"
},
{
"endpoint": "/remote.php/",
"backend": "http://localhost:9140"
},
{
"endpoint": "/dav/",
"backend": "http://localhost:9140"
},
{
"endpoint": "/webdav/",
"backend": "http://localhost:9140"
},
{
"endpoint": "/status.php",
"backend": "http://localhost:9140"
},
{
"endpoint": "/index.php/",
"backend": "http://localhost:9140"
},
{
"endpoint": "/data",
"backend": "http://localhost:9140"
},
{
"endpoint": "/graph/",
"backend": "http://localhost:9120"
},
{
"endpoint": "/graph-explorer/",
"backend": "http://localhost:9135"
},
{
"endpoint": "/api/v0/accounts",
"backend": "http://localhost:9181"
},
{
"endpoint": "/accounts.js",
"backend": "http://localhost:9181"
},
{
"endpoint": "/api/v0/settings",
"backend": "http://localhost:9190"
},
{
"endpoint": "/settings.js",
"backend": "http://localhost:9190"
},
{
"endpoint": "/api/v0/wopi",
"backend": "http://ocis-wopiserver:9105"
},
{
"endpoint": "/wopi.js",
"backend": "http://ocis-wopiserver:9105"
}
]
}
]
}

View File

@@ -1,30 +0,0 @@
{
"server": "https://ocis.owncloud.test",
"theme": "owncloud",
"version": "0.1.0",
"openIdConnect": {
"metadata_url": "https://ocis.owncloud.test/.well-known/openid-configuration",
"authority": "https://ocis.owncloud.test",
"client_id": "web",
"response_type": "code",
"scope": "openid profile email"
},
"apps": ["files"],
"external_apps": [
{
"id": "settings",
"path": "/settings.js"
},
{
"id": "accounts",
"path": "/accounts.js"
},
{
"id": "wopi",
"path": "/wopi.js"
}
],
"options": {
"hideSearchBar": true
}
}

View File

@@ -3,6 +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

View File

@@ -20,8 +20,8 @@ port = 8880
#codeurl = https://collabora.owncloud.test
# URL of your CodiMD service
#codimdurl = https://your-codimd-server.org
#codimdinturl = https://your-internal-codimd-server:3000
codimdurl = https://codimd.owncloud.test
codimdinturl = http://codimd:3000
# URL of your WOPI server or your HA proxy in front of it
wopiurl = https://wopiserver.owncloud.test
@@ -82,7 +82,7 @@ wopikey = /etc/grid-security/host.key
[bridge]
# SSL certificate check for the connected apps
#sslverify = True
sslverify = False
# Minimal time interval between two consecutive save operations [seconds]
#saveinterval = 200

View File

@@ -11,6 +11,7 @@ services:
- ${WOPISERVER_DOMAIN:-wopiserver.owncloud.test}
- ${COLLABORA_DOMAIN:-collabora.owncloud.test}
- ${ONLYOFFICE_DOMAIN:-onlyoffice.owncloud.test}
- ${CODIMD_DOMAIN:-codimd.owncloud.test}
command:
- "--log.level=${TRAEFIK_LOG_LEVEL:-ERROR}"
# letsencrypt configuration
@@ -53,6 +54,7 @@ services:
- /bin/sh
- /entrypoint-override.sh
environment:
PROXY_ENABLE_BASIC_AUTH: "true"
OCIS_URL: https://${OCIS_DOMAIN:-ocis.owncloud.test}
OCIS_DOMAIN: ${OCIS_DOMAIN:-ocis.owncloud.test}
OCIS_LOG_LEVEL: ${OCIS_LOG_LEVEL:-error} # make oCIS less verbose
@@ -63,15 +65,15 @@ services:
STORAGE_LDAP_BIND_PASSWORD: ${STORAGE_LDAP_BIND_PASSWORD:-reva}
OCIS_JWT_SECRET: ${OCIS_JWT_SECRET:-Pive-Fumkiu4}
OCIS_MACHINE_AUTH_API_KEY: ${OCIS_MACHINE_AUTH_API_KEY:-change-me-please}
STORAGE_TRANSFER_SECRET: ${STORAGE_TRANSFER_SECRET:-replace-me-with-a-transfer-secret}
# web ui
WEB_UI_CONFIG: "/var/tmp/ocis/.config/web-config.json"
# proxy
PROXY_CONFIG_FILE: "/var/tmp/ocis/.config/proxy-config.json"
OCIS_TRANSFER_SECRET: ${STORAGE_TRANSFER_SECRET:-replace-me-with-a-transfer-secret}
# app registry
STORAGE_APP_REGISTRY_MIMETYPES_JSON: /var/tmp/ocis/.config/mimetypes.json
WEB_ASSET_PATH: /var/tmp/web # TODO: remove
WEB_UI_CONFIG_APPS: files, search, media-viewer, external # TODO: remove
volumes:
- /home/kloucek/Projects/github.com/owncloud/web/dist:/var/tmp/web # TODO: remove
- ./config/ocis/entrypoint-override.sh:/entrypoint-override.sh
- ./config/ocis/web-config.dist.json:/config/web-config.dist.json
- ./config/ocis/proxy-config.json:/config/proxy-config.json
- ./config/ocis/mimetypes.json:/var/tmp/ocis/.config/mimetypes.json
- ocis-data:/var/tmp/ocis
labels:
- "traefik.enable=true"
@@ -88,14 +90,15 @@ services:
image: owncloud/ocis:${OCIS_DOCKER_TAG:-latest}
networks:
ocis-net:
entrypoint:
- /bin/sh
- /entrypoint-override.sh
#command: storage-app-provider server
#entrypoint:
# - /bin/sh
# - /entrypoint-override.sh
command: storage-app-provider server
environment:
STORAGE_GATEWAY_ENDPOINT: ocis:9142
STORAGE_GATEWAY_ENDPOINT: ${OCIS_ADDRESS:-ocis:9142}
APP_PROVIDER_BASIC_EXTERNAL_ADDR: ocis-appdriver-onlyoffice:9164
OCIS_JWT_SECRET: ${OCIS_JWT_SECRET:-Pive-Fumkiu4}
OCIS_MACHINE_AUTH_API_KEY: ${OCIS_MACHINE_AUTH_API_KEY:-change-me-please}
APP_PROVIDER_DRIVER: wopi
APP_PROVIDER_WOPI_DRIVER_APP_NAME: OnlyOffice
APP_PROVIDER_WOPI_DRIVER_APP_ICON_URI: https://www.pikpng.com/pngl/m/343-3435764_onlyoffice-desktop-editors-onlyoffice-logo-clipart.png
@@ -115,9 +118,10 @@ services:
ocis-net:
command: storage-app-provider server
environment:
STORAGE_GATEWAY_ENDPOINT: ocis:9142
STORAGE_GATEWAY_ENDPOINT: ${OCIS_ADDRESS:-ocis:9142}
APP_PROVIDER_BASIC_EXTERNAL_ADDR: ocis-appdriver-collabora:9164
OCIS_JWT_SECRET: ${OCIS_JWT_SECRET:-Pive-Fumkiu4}
OCIS_MACHINE_AUTH_API_KEY: ${OCIS_MACHINE_AUTH_API_KEY:-change-me-please}
APP_PROVIDER_DRIVER: wopi
APP_PROVIDER_WOPI_DRIVER_APP_NAME: Collabora
APP_PROVIDER_WOPI_DRIVER_APP_ICON_URI: https://www.collaboraoffice.com/wp-content/uploads/2019/01/CP-icon.png
@@ -129,15 +133,24 @@ services:
driver: "local"
restart: always
ocis-wopiserver:
image: owncloud/ocis-wopiserver:${OCIS_WOPISERVER_DOCKER_TAG:-latest}
ocis-appdriver-codimd:
image: owncloud/ocis:${OCIS_DOCKER_TAG:-latest}
networks:
ocis-net:
command: storage-app-provider server
environment:
OCIS_LOG_LEVEL: ${OCIS_LOG_LEVEL:-error} # make oCIS less verbose
WOPISERVER_REVA_GATEWAY_ADDR: ocis:9142
STORAGE_GATEWAY_ENDPOINT: ${OCIS_ADDRESS:-ocis:9142}
APP_PROVIDER_BASIC_EXTERNAL_ADDR: ocis-appdriver-codimd:9164
OCIS_JWT_SECRET: ${OCIS_JWT_SECRET:-Pive-Fumkiu4}
OCIS_MACHINE_AUTH_API_KEY: ${OCIS_MACHINE_AUTH_API_KEY:-change-me-please}
APP_PROVIDER_DRIVER: wopi
APP_PROVIDER_WOPI_DRIVER_APP_NAME: CodiMD
APP_PROVIDER_WOPI_DRIVER_APP_API_KEY: ${CODIMD_SECRET:-LoremIpsum456}
APP_PROVIDER_WOPI_DRIVER_APP_ICON_URI: https://avatars.githubusercontent.com/u/67865462?v=4
APP_PROVIDER_WOPI_DRIVER_APP_URL: https://${CODIMD_DOMAIN:-codimd.owncloud.test}
APP_PROVIDER_WOPI_DRIVER_INSECURE: "${INSECURE:-false}"
APP_PROVIDER_WOPI_DRIVER_IOP_SECRET: ${WOPI_IOP_SECRET:-LoremIpsum123}
APP_PROVIDER_WOPI_DRIVER_WOPI_URL: https://${WOPISERVER_DOMAIN:-wopiserver.owncloud.test}
logging:
driver: "local"
restart: always
@@ -152,9 +165,11 @@ services:
environment:
WOPISECRET: ${WOPI_JWT_SECRET:-LoremIpsum567}
IOPSECRET: ${WOPI_IOP_SECRET:-LoremIpsum123}
CODIMDSECRET: ${CODIMD_SECRET:-LoremIpsum456}
WOPISERVER_DOMAIN: ${WOPISERVER_DOMAIN:-wopiserver.owncloud.test}
COLLABORA_DOMAIN: ${COLLABORA_DOMAIN:-collabora.owncloud.test}
volumes:
#- /home/kloucek/Projects/github.com/cs3org/wopiserver/src/wopiserver.py:/app/wopiserver.py # TODO: remove
- ./config/wopiserver/entrypoint-override.sh:/entrypoint-override.sh
- ./config/wopiserver/wopiserver.conf.dist:/etc/wopi/wopiserver.conf.dist
- wopi-data:/var/wopi_local_storage
@@ -213,11 +228,58 @@ services:
driver: "local"
restart: always
codimd-db:
image: postgres:11.6-alpine
networks:
ocis-net:
environment:
POSTGRES_USER: codimd
POSTGRES_PASSWORD: codimd
POSTGRES_DB: codimd
volumes:
- codimd-db-data:/var/lib/postgresql/data
logging:
driver: "local"
restart: always
codimd:
image: gitlab-registry.cern.ch/authoring/notes/codimd:cernbox-integration
#image: gitlab-registry.cern.ch/authoring/notes/codimd:2.4.1 # TODO: remove
networks:
ocis-net:
environment:
CMD_DB_URL: postgres://codimd:codimd@codimd-db/codimd
CMD_AUTO_VERSION_CHECK: "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_USESSL: "false"
NODE_TLS_REJECT_UNAUTHORIZED: 0
CMD_APPLIANCE_MODE: "true"
CMD_SAVE_WEBHOOK: https:/${WOPISERVER_DOMAIN:-wopiserver.owncloud.test}/wopi/bridge
CMD_API_KEY: ${CODIMD_SECRET:-LoremIpsum456}
#CMD_DOMAIN: ocis.owncloud.test # TODO: remove
#CMD_URL_PATH: "byoa/codimd" # TODO: remove
labels:
- "traefik.enable=true"
- "traefik.http.routers.codimd.entrypoints=https"
- "traefik.http.routers.codimd.rule=Host(`${CODIMD_DOMAIN:-codimd.owncloud.test}`)"
- "traefik.http.routers.codimd.tls.certresolver=http"
- "traefik.http.routers.codimd.service=codimd"
- "traefik.http.services.codimd.loadbalancer.server.port=3000"
logging:
driver: "local"
restart: always
volumes:
certs:
ocis-data:
wopi-data:
wopi-logs:
codimd-db-data:
networks:
ocis-net: