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

[bug] Office Documents Are Not Viewable #807

Open
Kuvwert opened this issue Jan 17, 2025 · 18 comments
Open

[bug] Office Documents Are Not Viewable #807

Kuvwert opened this issue Jan 17, 2025 · 18 comments

Comments

@Kuvwert
Copy link

Kuvwert commented Jan 17, 2025

Bug Report: Unable to Access Office Docs in Fresh Install of Filestash

Description of the Bug

After a fresh installation of Filestash, attempting to open Office Docs like .DOCX or .CSV files via the WebDAV integration results in a failure to load. Errors related to Content-Security-Policy are observed in the browser console.

Steps to Reproduce

  1. Perform a fresh installation of Filestash:
    • Run: curl -O https://downloads.filestash.app/latest/docker-compose.yml
    • Run: docker-compose up -d
  2. Add the IP address and port mapping to Nginx Proxy Manager.
  3. Access Filestash successfully via domain with HTTPS.
  4. Complete onboarding:
    • Set up admin password.
  5. Navigate to the admin panel (https://domain.tld/admin) and enable only WebDAV.
  6. Log in:
    • Go to https://domain.tld/.
    • Add WebDAV credentials for Nextcloud.
    • Log in successfully.
  7. Browse to the Nextcloud directory and attempt to open a .DOCX or .CSV file.

Observed Errors

  • Firefox Console Error:
    Content-Security-Policy: The page’s settings blocked the loading of a resource (frame-ancestors) at because it violates the following directive: “frame-ancestors http://127.0.0.1/:* http://app:*”.

  • Network Tab:
    Network Tab Screenshot

Notes

  • Unable to test this issue on the demo server (https://demo.filestash.app) as no office documents seem to be available to attempt opening.

Expected Behavior

Office documents, such as .DOCX or .CSV files, should load successfully by default when opened through Filestash.

Additional Information

  • Filestash Version: Latest
  • Browser: Firefox
  • Environment: Default Docker Compose setup with Nginx Proxy Manager and HTTPS enabled.

Current Docker Compose (Default):
version: '2'
services:
app:
container_name: filestash
image: machines/filestash:latest
restart: always
environment:
- APPLICATION_URL=
- CANARY=true
- OFFICE_URL=http://wopi_server:9980
- OFFICE_FILESTASH_URL=http://app:8334
- OFFICE_REWRITE_URL=http://127.0.0.1:9980
ports:
- "8334:8334"
volumes:
- filestash:/app/data/state/

wopi_server:
container_name: filestash_wopi
image: collabora/code:24.04.10.2.1
restart: always
environment:
- "extra_params=--o:ssl.enable=false"
- aliasgroup1="https://.*:443"
command:
- /bin/bash
- -c
- |
curl -o /usr/share/coolwsd/browser/dist/branding-desktop.css https://gist.githubusercontent.com/mickael-kerjean/bc1f57cd312cf04731d30185cc4e7ba2/raw/d706dcdf23c21441e5af289d871b33defc2770ea/destop.css
/bin/su -s /bin/bash -c '/start-collabora-online.sh' cool
user: root
ports:
- "9980:9980"

volumes:
filestash: {}

@Kuvwert Kuvwert changed the title Office Documents Are Not Viewable [bug] Office Documents Are Not Viewable Jan 17, 2025
@homegrownhrbs
Copy link

Can confirm. Document viewer no longer functions at all.

Spun up a Debian VM and installed docker compose and used the default compose YML and i cannot get office documents to load.

I didn't get a console error, but using the default docker-compose.yml I am unable to load office documents.

I also attempted to spin up an AWS instance and there is no office viewer at all in that version? Seems like an oversight.

@homegrownhrbs
Copy link

homegrownhrbs commented Jan 21, 2025

UPDATE:

It looks like the filestash demo server is now working with the the collabora document viewer.

Could we get updated instructions on how to make collabora work with the docker-compose?

I again tested this morning on a fresh VM and the default docker compose does not work with office docs by default.

Note: I'm only accessing the service via localhost:8334 i have not set up reverse proxy on this test scenario

@Kuvwert
Copy link
Author

Kuvwert commented Jan 21, 2025

Right Cool!

@mickael-kerjean could you share the compose file or the config details that the demo server is using that makes the collabora office integration work as intended?

@mickael-kerjean
Copy link
Owner

the demo server that's available from https://www.filestash.app/word-online.html has this config:

~# cat docker-compose.yml
version: '2'
services:
  app:
    container_name: filestash
    image: machines/filestash:latest
    restart: always
    environment:
    - APPLICATION_URL=demo.filestash.app
    - CANARY=true
    - OFFICE_URL=https://office.filestash.app
    - OFFICE_FILESTASH_URL=https://demo.filestash.app
    ports:
    - "8334:8334"
    volumes:
    - filestash:/app/data/state/

  wopi_server:
    container_name: filestash_wopi
    image: collabora/code:24.04.10.2.1
    restart: always
    environment:
    - aliasgroup1=https://.*:443
    command:
    - /bin/bash
    - -c
    - |
         curl -o /usr/share/coolwsd/browser/dist/branding-desktop.css https://gist.githubusercontent.com/mickael-kerjean/bc1f57cd312cf04731d30185cc4e7ba2/raw/af0b24a4faf442e8b0be145878e416057affc824/desktop.css
         /bin/su -s /bin/bash -c '/start-collabora-online.sh' cool
    user: root
    ports:
    - "9980:9980"

volumes:
    filestash: {}

@Kuvwert
Copy link
Author

Kuvwert commented Jan 22, 2025

Okay it looks from the demo config, the collabora server needs to be exposed as well as the main filestash app.

@homegrownhrbs I have tested it and the collabora documents become accessible once you add an entry in your reverse proxy for the document server and specify the URL in the docker compose environment variables:

environment:

Maybe some Documentation or Comments in the docker compose file would alleviate some of the confusion about this going forward (Especially considering this step was not necessary with the original onlyoffice backend)

@homegrownhrbs
Copy link

I see,
Thank you, but I am hoping to not expose other services.

Is it possible to go back to onlyoffice that did not require that?

Currently i am having to import all my documents back to google drive because i cannot get document-viewing working properly :(

@mickael-kerjean do you happen to have a docker-compose.yml script with an alternative document viewer enabled instead of the collabora? Sorry to be such a hassle :< I'd gladly send you a donation for your time

@HeikoGr
Copy link

HeikoGr commented Jan 28, 2025

There is no need to expose Filestash or Collabora.
You "only" need an valid SSL/TLS certificate for each service.

I was struggling a lot just because my docker host was not able to properly resolve my own domain...

@jeeftor
Copy link

jeeftor commented Feb 6, 2025

What about the OFFICE_REWRITE_URL is that needed?

@jeeftor
Copy link

jeeftor commented Feb 6, 2025

Do you have a working version? (docker compose)

I have files.subdomain.net and office.subdomain.net working - yet I still get

Image

When I try to open an office file

@jeeftor
Copy link

jeeftor commented Feb 6, 2025

It seems my office container is reporting:

Image

@HeikoGr
Copy link

HeikoGr commented Feb 6, 2025

This is my compose.yaml

services:
  app:
    container_name: filestash
    image: machines/filestash:latest
    restart: always
    environment:
    - APPLICATION_URL=files.DOMAIN.XYZ
    - CANARY=true
    - OFFICE_URL=https://collabora.DOMAIN.XYZ
    - OFFICE_FILESTASH_URL=https://files.DOMAIN.XYZ
    ports:
    - "8334:8334"
    volumes:
    - filestash:/app/data/state/

  wopi_server:
    container_name: filestash_wopi
    image: collabora/code:24.04.12.2.1
    restart: always
    environment:
    - "extra_params=--o:ssl.enable=false --o:ssl.termination=true"
    - aliasgroup1='https://files.DOMAIN.XYZ
    command:
    - /bin/bash
    - -c
    - |
         curl -o /usr/share/coolwsd/browser/dist/branding-desktop.css https://gist.githubusercontent.com/mickael-kerjean/bc1f57cd312cf04731d30185cc4e7ba2/raw/d706dcdf23c21441e5af289d871b33defc2770ea/destop.css
         /bin/su -s /bin/bash -c '/start-collabora-online.sh' cool
    user: root
    ports:
    - "9980:9980"

volumes:
  filestash: {}

In my LAN there is pihole running which acts as an DNS server which points the files and collabora subdomains to nginx proxy manager . This npm serves these subdomains with an wildcard certificate *.DOMAIN.XYZ

as mentioned above the host running the docker containers wasn‘t using the pihole DNS server but my routers DNS…

@abeloris
Copy link

abeloris commented Feb 7, 2025

If anyone wants to use onlyoffice at the moment, i have made this fork that has the onlyoffice plugin installed and a working example of the docker compose file with onlyoffice. 😄

@mickael-kerjean do you happen to have a docker-compose.yml script with an alternative document viewer enabled instead of the collabora? Sorry to be such a hassle :< I'd gladly send you a donation for your time

@steff9488
Copy link

steff9488 commented Feb 9, 2025

@HeikoGr @abeloris

I have a setup with a caddy reverse proxy on an opnsense box getting lets encrypt cert and pointing to collabora and filestash. I could not get it to work with ur compose also not with edding the filestash url. It also doesnt work with the original compose. Do i need a special setting for caddy?

The onlyoffice fork works perfectly though, but i would like to stay on the official docker branch. What du you guys suggest to do?

@abeloris
Copy link

abeloris commented Feb 9, 2025

@HeikoGr @abeloris

I have a setup with a caddy reverse proxy on an opnsense box getting lets encrypt cert and pointing to collabora and filestash. I could not get it to work with ur compose also not with edding the filestash url. It also doesnt work with the original compose. Do i need a special setting for caddy?

The onlyoffice fork works perfectly though, but i would like to stay on the official docker branch. What du you guys suggest to do?

My fork is working because I've added the onlyoffice plugin. I am actually using the fork until the main one gets fixed. I'll be trying to sync the fork each week too.

I don't know what you could do, we may have to wait until mickael fixes the main version and collabora 😛

@jeeftor
Copy link

jeeftor commented Feb 10, 2025

Are you publishing docker images or do I need to build my own with your fork?

@jeeftor
Copy link

jeeftor commented Feb 10, 2025

That was different on mine

I'm using caddy internally as with a wildcard cert - and overrides in unbound within the lan.

@abeloris
Copy link

abeloris commented Feb 10, 2025

Are you publishing docker images or do I need to build my own with your fork?

You can use my fork by just copying the onlyoffice docker compose file and do a: docker compose up -d --build
But I'm going to try to publish an image to docker hub (I've never done that xd).

@abeloris
Copy link

Are you publishing docker images or do I need to build my own with your fork?

I've published my fork to abeloris/filestash-onlyoffice in dockerhub, let me know if it works as intended.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

7 participants