{"action":"created","issue":{"url":"https://api.github.com/repos/haiwen/seahub/issues/418","labels_url":"https://api.github.com/repos/haiwen/seahub/issues/418/labels{/name}","comments_url":"https://api.github.com/repos/haiwen/seahub/issues/418/comments","events_url":"https://api.github.com/repos/haiwen/seahub/issues/418/events","html_url":"https://github.com/haiwen/seahub/issues/418","id":62655644,"number":418,"title":"Thumbnail (thumbnail_src) does not consider SITE_ROOT settings","user":{"login":"m33x","id":883685,"avatar_url":"https://avatars.githubusercontent.com/u/883685?v=3","gravatar_id":"","url":"https://api.github.com/users/m33x","html_url":"https://github.com/m33x","followers_url":"https://api.github.com/users/m33x/followers","following_url":"https://api.github.com/users/m33x/following{/other_user}","gists_url":"https://api.github.com/users/m33x/gists{/gist_id}","starred_url":"https://api.github.com/users/m33x/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/m33x/subscriptions","organizations_url":"https://api.github.com/users/m33x/orgs","repos_url":"https://api.github.com/users/m33x/repos","events_url":"https://api.github.com/users/m33x/events{/privacy}","received_events_url":"https://api.github.com/users/m33x/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":1,"created_at":"2015-03-18T10:39:42Z","updated_at":"2015-03-18T11:21:42Z","closed_at":null,"body":"Hi,\r\n\r\nmy Seafile instance does not run on https://example.org but instead on https://example.org/sea/\r\n\r\nThis can be accomplished by settings the \r\n```sh\r\nSITE_ROOT = '/sea/'\r\n```\r\nin the seahub_settings.py file.\r\n\r\nHowever, thumbnails do not work anymore, because /seahub/thumbnail/utils.py needs to be changed from this\r\n```sh\r\nimport posixpath\r\nfrom seahub.utils import get_service_url\r\ndef get_thumbnail_src(repo_id, obj_id, size):\r\n    return posixpath.join(get_service_url(), \"thumbnail\", repo_id,\r\n                          obj_id, size)\r\n```\r\nto\r\n```sh\r\nimport posixpath\r\nfrom seahub.utils import get_service_url\r\ndef get_thumbnail_src(repo_id, obj_id, size):\r\n    return posixpath.join(get_service_url(), \"/sea/thumbnail\", repo_id,\r\n                          obj_id, size)\r\n```\r\nOf course we need a generic solution for this, because hard coding the folder in this file isn't a great idea."},"comment":{"url":"https://api.github.com/repos/haiwen/seahub/issues/comments/82910427","html_url":"https://github.com/haiwen/seahub/issues/418#issuecomment-82910427","issue_url":"https://api.github.com/repos/haiwen/seahub/issues/418","id":82910427,"user":{"login":"lins05","id":717363,"avatar_url":"https://avatars.githubusercontent.com/u/717363?v=3","gravatar_id":"","url":"https://api.github.com/users/lins05","html_url":"https://github.com/lins05","followers_url":"https://api.github.com/users/lins05/followers","following_url":"https://api.github.com/users/lins05/following{/other_user}","gists_url":"https://api.github.com/users/lins05/gists{/gist_id}","starred_url":"https://api.github.com/users/lins05/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/lins05/subscriptions","organizations_url":"https://api.github.com/users/lins05/orgs","repos_url":"https://api.github.com/users/lins05/repos","events_url":"https://api.github.com/users/lins05/events{/privacy}","received_events_url":"https://api.github.com/users/lins05/received_events","type":"User","site_admin":false},"created_at":"2015-03-18T11:21:42Z","updated_at":"2015-03-18T11:21:42Z","body":"Set SERVICE_URL to `https://example.com/sea`, restart seahub and it should\nwork fine.\n\nOn Wed, Mar 18, 2015 at 6:39 PM, m33x <notifications@github.com> wrote:\n\n> Hi,\n>\n> my Seafile instance does not run on https://example.org but instead on\n> https://example.org/sea/\n>\n> This can be accomplished by settings the\n>\n> SITE_ROOT = '/sea/'\n>\n> in the seahub_settings.py file.\n>\n> However, thumbnails do not work anymore, because\n> /seahub/thumbnail/utils.py needs to be changed from this\n>\n> import posixpath\n> from seahub.utils import get_service_url\n> def get_thumbnail_src(repo_id, obj_id, size):\n>     return posixpath.join(get_service_url(), \"thumbnail\", repo_id,\n>                           obj_id, size)\n>\n> to\n>\n> import posixpath\n> from seahub.utils import get_service_url\n> def get_thumbnail_src(repo_id, obj_id, size):\n>     return posixpath.join(get_service_url(), \"/sea/thumbnail\", repo_id,\n>                           obj_id, size)\n>\n> Of course we need a generic solution for this, because hard coding the\n> folder in this file isn't a great idea.\n>\n> —\n> Reply to this email directly or view it on GitHub\n> <https://github.com/haiwen/seahub/issues/418>.\n>\n"}}