haiwen / seafile-docker

A Docker image for Seafile server
Other
544 stars 184 forks source link

SERVICE_URL in ccnet.conf has wrong port #182

Closed der-eismann closed 4 years ago

der-eismann commented 4 years ago

I just created a new Seafile instance with the seafileltd/seafile-mc:7.0.5 image and I noticed a bug which I couldn't fix myself.

After the service is up and running the small avatar in the upper right corner can't be loaded because it uses the wrong URL. My envvars are set as follows:

        - name: SEAFILE_SERVER_HOSTNAME
          value: cloud.example.com

However the request for the small avatar is pointing at

Request URL: http://cloud.example.com:8000/media/avatars/2/1/847b25dba1a14e86ec73b6676d525b/resized/72/01984a199964cd97522c4d3c23e1a9f6.png

Notice the port 8000? That should be 80. The only value with 8000 in the config is the SERVICE_URL in the ccnet.conf and I have no idea where this gets its value from.

It would be great if the bootstrapper could set the correct value here.

renfeipeng commented 4 years ago

You can remove ‘:8000’ in ccnet.conf and run the 'docker-compose restart' command to restart.

renfeipeng commented 4 years ago

This is a special configuration, so you need to change the configuration according to the actual situation. Sorry for some impact on your use.

der-eismann commented 4 years ago

Yes that's what I did, but it's not a special configuration. This docker stack is supposed to run on port 80 & 443, so the SERVICE_URL should be set by the bootstrapper to the same value as FILE_SERVER_ROOT (without the seafhttp part). The idea of containers is to pass everything inside with environment variables and have it running without adjusting configuration by hand.

renfeipeng commented 4 years ago

However, some users will use ports other than 80 and 443, and this will be the same.

der-eismann commented 4 years ago

So instead of setting a usable default for some users everyone has to adjust it.

Kerwood commented 4 years ago

Why was this issue closed ? I had the same issue and did the same workaround. But its not only the port that's causing troubles. If you are using SSL, the browser will warn you about other content not using SSL.

seafile-cert

SERVICE_URL should be an environment variable. If its not present then set the value to http://the-domain-here:8000 or what ever the default value is.

Kerwood commented 4 years ago

Just realised that the http issue also affects the FILE_SERVER_ROOT variable in seahub_settings.py.

What does the SEAFILE_SERVER_LETSENCRYPT environment variable actually do? Does it try and get a certificate from LE or does it only change http to https in the configs?