ControlPanel icon indicating copy to clipboard operation
ControlPanel copied to clipboard

control panel won't connect to community server over https

Open loigu opened this issue 5 years ago • 3 comments

While trying to solve problem with fulltext search in CS (https://github.com/ONLYOFFICE/Docker-CommunityServer/issues/113), on suggestion of @Carazyda I tried to install controlpanel. I have dificulty making it connect to existing installation of document & community server. (everything runs in docker)

I suspect the problem might be that control panel is trying to connect to community server through http while it is running on https (thus won't return json).

root@controlpanel:/var/www/onlyoffice/controlpanel# cat /var/log/onlyoffice/web.controlpanel.12-31.log

2020-12-31 06:38:09 - error: http://onlyoffice.fritz.box/api/2.0/settings/controlpanel.json Unexpected token in JSON at position 0 2020-12-31 06:38:09 - error: http://onlyoffice.fritz.box/api/2.0/portal.json Unexpected token in JSON at position 0

(the correct address is https://.....) - when I try through web browser it returns html "access denied" on http:// and correct json data on https://. Is there a way how to explain to control panel that community server is running on https? The run script obviously expects http :-( root@controlpanel:/var/www/onlyoffice/controlpanel# cat run-controlpanel.sh

... sed 's/http://onlyoffice-community-server/http://'${ONLYOFFICE_COMMUNITYSERVER_HOST}'/' -i www/config/production.json; ...

other issue you might want to know about is that there is error in doc on page https://helpcenter.onlyoffice.com/installation/groups-install-docker.aspx:

... sudo docker run --net onlyoffice -i -t -d --restart=always --name onlyoffice-control-panel
-v /var/run/docker.sock:/var/run/docker.sock
-v /app/onlyoffice/CommunityServer/data:/app/onlyoffice/CommunityServer/data
-v /app/onlyoffice/ControlPanel/data:/var/www/onlyoffice-controlpanel/Data
-v /app/onlyoffice/ControlPanel/logs:/var/log/onlyoffice-controlpanel
onlyoffice/controlpanel ...

^ the server expects mountpoints /var/www/onlyoffice/Data & /var/log/onlyoffice, not -controlpanel (I had to dig into the container to find the correct paths)

loigu avatar Dec 31 '20 07:12 loigu

The control panel "starts" - listens on :80, but gives endless redirect to self responses (until web browser gives up with too many redirects)

loigu avatar Dec 31 '20 07:12 loigu

Hello @loigu ControlPanel and CommunityServer should work each other on a local docker network, for example address http://onlyoffice-community-server, you can see at in config www/config/production.json. If communityserver don't available on this address - you can change it to correct one.

Carazyda avatar Jan 11 '21 11:01 Carazyda

So to further this discussion. I have been trying with no luck. I have installed community server and control panel sharing the same network. I get the same result in the log file. Basically the resource /api/2.0/settings/controlpanel.json does not work.. calling it using curl from the control-panel docker instance returns

<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>Error</title>
</head>
<body>
<pre>Cannot GET /api/2.0/settings/controlpanel.json</pre>
</body>
</html>

This seems to apply to the following resources that the control-panel is trying to load from the community-server

  • api/2.0/people/@self.json
  • api/2.0/portal.json
  • api/2.0/settings/companywhitelabel.json
  • api/2.0/settings/controlpanel.json

Beyond this, I have no idea why the community server requires the CONTROL_PANEL_PORT_80_TCP and CONTROL_PANEL_PORT_80_TCP_ADDR environment variables... shouldn't this be the other way around?

mcesnik avatar Sep 09 '21 19:09 mcesnik