haiwen / seahub

The web end of seafile server.
seafile.com
Other
526 stars 368 forks source link

Wrong paths, for non-default SITE_ROOT and MEDIA_URL #313

Closed allo- closed 7 years ago

allo- commented 9 years ago

I deployed seafile with MEDIA_URL=/seahub-media/, but the default avatar still uses /media/avatars/default.png.

While searching for the source of the other /media/ path, i found

<img src="https://cloud.seafile.com/media/img/seafile_logo.png" alt="" /> with hardcoded path in seahub/seahub/templates/file_edit.html

window.location.href.replace(/\/repo\/[-a-z0-9]{36}\/.*/, '/media/cors/result.html?%s') in seahub/seahub/templates/repo.html

allo- commented 9 years ago

And deleting a user in /seafile/sys/useradmin/ redirects to / instead to SITE_ROOT.

imwhatiam commented 9 years ago
  1. after you change MEDIA_URL, you should clean seahub cache(/tmp/seahub_cache).
  2. we have checked the code of deleting an user, but didn't find any problem about SITE_ROOT, and for more info about SITE_ROOT , please see http://manual.seafile.com/deploy/deploy_Seahub_at_Non-root_domain.html.
allo- commented 9 years ago

I followed this howto. I will check for the cache. btw: using MEDIA_URL and seafile http-server is really weird. Its always SITE_ROOT + MEDIA_URL for where the files are and MEDIA_URL where they are linked. So using ´´/seafile/´´ Prefix i get links for /seafile/media but can only access the files under /seafile/seafile/media.

Not sure if config problem, so i resorted to serving media via /seafile-media from the real webserver, which works. Except the Avatar URL seemd wrong (maybe the url is written on user-creation to the DB?) and the other minor stuff may cause problems (i only found them, but did not test them).

allo- commented 9 years ago

Removed Cache: Avatar works now, removing users does not.

Steps to reproduce:

not sure if related to this bug. You may have a look at the other two files with literal "media" and close the bug.

allo- commented 9 years ago

another issue related to the paths: They seem to need http://site in front. Setting up with relativ paths (to have seafile.intranet and seafile.myinternetdomain) got different wrong links depending on which relative (to /, i.e. /seafile/) path was used. not sure, if its possible to setup two seahub instances for this purpose. Does ccnet itself work without domains in the protocol?

freeplant commented 7 years ago

This issue is obsolete.