-
Notifications
You must be signed in to change notification settings - Fork 400
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
App Submission: ONLYOFFICE Document Server for Nextcloud #1288
Changes from 4 commits
df17d65
fca674f
564a590
a270829
952043b
af600c7
eebfbb4
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
version: '3.9' | ||
Check notice on line 1 in onlyoffice-nextcloud/docker-compose.yml GitHub Actions / Lint appsPotentially using unsafe user in service "web"
Check notice on line 1 in onlyoffice-nextcloud/docker-compose.yml GitHub Actions / Lint appsPotentially using unsafe user in service "documentserver"
|
||
services: | ||
app_proxy: | ||
environment: | ||
APP_HOST: onlyoffice-nextcloud_web_1 | ||
APP_PORT: 3000 | ||
|
||
web: | ||
image: a4004/onlyoffice-nextcloud-web:1.0.4@sha256:774bd9bda641e6be49286921637840efba050fdfd022934dfd9ee9b6ec8d0a63 | ||
restart: on-failure | ||
environment: | ||
- DOCS_ADDRESS=http://$DEFAULT_INTERFACE_IP:$DOCSERVER_PORT | ||
- DOCS_INTERNAL_ADDRESS=http://$DEFAULT_INTERFACE_IP:$DOCSERVER_PORT | ||
- NEXTCLOUD_INTERNAL_ADDRESS=http://$DOCKER_INTERFACE_IP:$APP_NEXTCLOUD_PORT | ||
- NEXTCLOUD_WEB_URL=http://$DEVICE_DOMAIN_NAME:$APP_NEXTCLOUD_PORT | ||
|
||
documentserver: | ||
image: onlyoffice/documentserver:8.1@sha256:9b74cb0e05580bced87f9af69de68d5f4c9e5b3340448ddc94333f5f7f4eba85 | ||
restart: on-failure | ||
stop_grace_period: 1m | ||
ports: | ||
Check notice on line 21 in onlyoffice-nextcloud/docker-compose.yml GitHub Actions / Lint appsExternal port mapping "5672:80"
|
||
- 5672:80 | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. might as well use |
||
environment: | ||
- JWT_ENABLED=false | ||
- ONLYOFFICE_HTTPS_HSTS_ENABLED=false | ||
- USE_UNAUTHORIZED_STORAGE=true | ||
- ALLOW_PRIVATE_IP_ADDRESS=true | ||
- ALLOW_META_IP_ADDRESS=true | ||
volumes: | ||
- ${APP_DATA_DIR}/data/logs:/var/log/onlyoffice | ||
- ${APP_DATA_DIR}/data/certs:/var/www/onlyoffice/Data | ||
- ${APP_DATA_DIR}/data/cache:/var/lib/onlyoffice | ||
- ${APP_DATA_DIR}/data/db:/var/lib/postgresql |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
#!/usr/bin/env bash | ||
|
||
export DOCSERVER_PORT=5672 | ||
export APP_DOCSERVER_PORT=3014 | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Is |
||
|
||
export DEFAULT_INTERFACE_IP=$(ip addr show $(ip route | grep default | awk '{print $5}') | grep 'inet ' | awk '{print $2}' | cut -d/ -f1) | ||
export DOCKER_INTERFACE_IP=$(ip addr show docker0 | grep 'inet ' | awk '{print $2}' | cut -d/ -f1) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. If we end up going with the simplifications here #1288 (comment), then we can remove these exports. |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
manifestVersion: 1 | ||
id: onlyoffice-nextcloud | ||
category: files | ||
name: ONLYOFFICE Document Server | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. It looks like they call themselves I'm not familiar with ONLYOFFICE, so I'll defer to you here. But an added benefit to shortening the name is that it will show up without an ellipses on the homescreen: vs |
||
version: "8.1" | ||
tagline: Run your private office with the ONLYOFFICE | ||
description: >- | ||
ONLYOFFICE Document Server for Nextcloud | ||
|
||
|
||
Create and edit text docs, spreadsheets and presentations. Operate | ||
complex objects and calculations. View images, videos and PDFs. Work | ||
on device or choose your cloud. | ||
|
||
|
||
ONLYOFFICE by Ascensio System SIA offers a powerful office suite that | ||
comprises online editors for text documents, spreadsheets and presentations | ||
highly compatible with Microsoft Office and OpenDocument file formats. | ||
ONLYOFFICE provides users with multiple editing tools and collaborative features | ||
ensuring greater team workflow, and seamless work with complex formatting and | ||
objects within your web solution. | ||
releaseNotes: "" | ||
developer: Ascensio System SIA | ||
website: https://www.onlyoffice.com/ | ||
dependencies: | ||
- nextcloud | ||
repo: https://github.com/ONLYOFFICE/DocumentServer | ||
support: https://forum.onlyoffice.com/ | ||
port: 3014 | ||
gallery: | ||
- 1.jpg | ||
- 2.jpg | ||
- 3.jpg | ||
- 4.jpg | ||
- 5.jpg | ||
path: "" | ||
defaultUsername: "" | ||
defaultPassword: "" | ||
submitter: a4004 | ||
submission: https://github.com/getumbrel/umbrel-apps/pull/1288 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think we can simplify this a bit and avoid needing to run ip-related commands in the
exports.sh
. I'm not very familiar with the Nextcloud/ONLYOFFICE ecosystem, so please let me know if anything I suggest here doesn't make sense or has unintended consequences:DOCS_ADDRESS=http://$DEFAULT_INTERFACE_IP:$DOCSERVER_PORT
I'm thinking that most users will be accessing Nextcloud via
umbrel.local
not their IP address, so if they are using their local IP address in the nextcloud/onlyoffice config they will get hit with cors errors when clicking on a document in Nextcloud fromhttp://umbrel.local:8081
and it tries to make a request to$DEFAULT_INTERFACE_IP:5672
.Shall we change this to
DOCS_ADDRESS=http://$DEVICE_DOMAIN_NAME:$DOCSERVER_PORT
(which will be http://umbrel.local:5672) and then include instructions saying that if a user is accessing Nextcloud from a different hostname/ip, they should change make the appropriate change toONLYOFFICE Docs address
in their Nextcloud settings?**Edit: sorry @a4004 I sent you down the wrong path by accidently including
:$DOCSERVER_PORT
after the container name below **DOCS_INTERNAL_ADDRESS=http://$DEFAULT_INTERFACE_IP:$DOCSERVER_PORT
This is for internal requests to the
documentserver
container, so we can just use the container name here and Docker's internal DNS will resolve it to the correct IP address. So I think we can change this toDOCS_INTERNAL_ADDRESS=http://onlyoffice-nextcloud_documentserver_1
.The user will then copy-paste
http://onlyoffice-nextcloud_documentserver_1
into the ONLYOFFICE settings in Nextcloud.NEXTCLOUD_INTERNAL_ADDRESS=http://$DOCKER_INTERFACE_IP:$APP_NEXTCLOUD_PORT
I think we can get away without the export.sh ip command here as well. We actually have access to the gateway IP for the umbrel docker network as an env var. Check it out: https://github.com/getumbrel/umbrel/blob/570acdabcab13ac237fba992f491d126fff30810/packages/umbreld/source/modules/apps/legacy-compat/app-script#L10
So we should be able to use
NEXTCLOUD_INTERNAL_ADDRESS=http://$GATEWAY_IP:$APP_NEXTCLOUD_PORT
which will yieldhttp://10.21.0.1:8081/
for the user to copy-paste into the ONLYOFFICE settings in Nextcloud.So a user would end up with this:
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@nmfretz Is it not better to use something like
http://nextcloud_web_1:8081
? We are using container hostname reference on torrenting apps like Prowlarr, Radarr and Sonarr.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That's actually a good point.
I have tested both
http://nextcloud_web_1/
andhttp://nextcloud_web_1:8081/
but it doesn't appear to work for some reason. Nextcloud is throwing an errorError when trying to connect (Error occurred in the document service: Error while downloading the document file to be converted.) (version 8.1.1.26)
.Perhaps I'm doing something wrong here or it's not set up for this type of communication, not too sure but I agree with the idea of using container hostnames over IPs for sure.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@joaovictor-local @a4004, ya the issue here is that the Nextcloud app doesn't have the
web
container name as a trusted proxy in itsconfig.php
, so instead we are using an IP that it does trust (e.g.,10.21.0.1
or172.17.0.1
).umbrel-apps/nextcloud/docker-compose.yml
Line 47 in 49580db
umbrel-apps/nextcloud/exports.sh
Lines 3 to 4 in 49580db
For this to work, the Nextcloud config.php would have to include
nextcloud_web_1
under trusted_domains. Then in the field forServer address for internal requests from ONLYOFFICE Docs
a user would usehttp://nextcloud_web_1
, without a port specified since we want the default port 80 inside the web container (not 8081).I do really like the simplicity of using container names @joaovictor-local, so we could consider the following:
nextcloud_web_1
in the config.phpNEXTCLOUD_INTERNAL_ADDRESS=http://nextcloud_web_1
a4004/onlyoffice-nextcloud-web
UI (or maybe just the app description) telling users to update Nextcloud if they haven't.What do you guys think?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Update: I have updated Nextcloud to allow connection via nextcloud_web_1 #1297