CollaboraOnline / online

Collabora Online is a collaborative online office suite based on LibreOffice technology. This is also the source for the Collabora Office apps for iOS and Android.
https://collaboraonline.com
Other
1.79k stars 681 forks source link

CODE yields http ressources although using ssl.termination=true #3186

Closed nursoda closed 3 years ago

nursoda commented 3 years ago

Describe the bug

Due to resource URLs delivered with http:// proto, I cannot use CODE without TLS in the backend (behind a terminating reverse-proxy).

To Reproduce

Server setup

Collabora Configuration

Expected behavior

Connection via proxy where loolwsd acts as working via https, but actually uses http

Actual behavior

Additional context / Possible cause

Mixed Content: The page at 'https://MYSERVER/apps/files/?dir=/&fileid=6' was loaded over HTTPS, but requested an insecure form action 'http://MYSERVER/loleaflet/…/loleaflet.html? WOPISrc=https%3A%2F%MYSERVER%2Findex.php%2Fapps%2Frichdocuments%2Fwopi%2Ffiles%2F… &title=test.odt&lang=de&closebutton=1&revisionhistory=1'. This request has been blocked; the content must be served over HTTPS.

Complete listing of https://MYSERVER/hosting/discovery
nursoda commented 3 years ago

I found the solution myself as I re-read the SSL configuration documentation again. It would have been helpful to have an example there… So the solution is:

In case anyone else stumbles upon this, I leave the description as it was.

wethinkagile commented 2 years ago

Would be great having someone proof-reading this and put into README. E.g. in above example I spotted a couple of extra ", which are probably not necessary.

mike-lloyd03 commented 2 years ago

I'm having this same problem and I have my environment variables set up the same as yours. I've confirmed these are being passed to the web server with ps. But I still get the "mixed active content" error and Collabora fails to load. I might just set up TLS between code and Nextcloud just to get this working but that seems like a pain. Is there a quick way to do that?

ps aux output:

UID          PID    PPID  C STIME TTY          TIME CMD
cool           1       0  0 22:29 ?        00:00:05 /usr/bin/coolwsd --version --o:sys_template_path=/opt/cool/systemplate --o:child_root_path=/opt/cool/child-roots --o:file_server_root_path=/usr/share/coolwsd --o:logging.color=false --o:ssl.termination=true --o:ssl.enable=false

Relevant sections of docker compose file:

app:                                        
  image: nextcloud:22-apache                
  hostname: HOSTNAME               
  restart: unless-stopped                   
  ports:                                    
    - 8082:80                               
  volumes:                                  
    - /etc/localtime:/etc/localtime:ro      
    - /mnt/data/nextcloud/data:/var/www/html
  environment:                              
    - POSTGRES_HOST=db                      
    - REDIS_HOST=redis                      
  env_file:                                 
    - .env                                  
  depends_on:                               
    - db                                    
    - redis                                 
  networks:                                 
    - proxy-tier                            
    - default                               
    - code                                  

code:                                                             
  image: collabora/code:21.11.1.4.1                               
  restart: unless-stopped                                         
  networks:                                                       
    - default                                                     
    - code                                                        
  env_file:                                                       
    - .env                                                        
  ports:                                                          
    - 9980:9980                                                   
  volumes:                                                        
    - /etc/localtime:/etc/localtime:ro                            
  depends_on:                                                     
    - app                                                         
  cap_add:                                                        
    - MKNOD                                                       
  environment:                                                    
    - "extra_params=--o:ssl.termination=true --o:ssl.enable=false"
wethinkagile commented 2 years ago

I came to the same conclusion, disliked the error handling of the setup the most.