haiwen / seahub

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

Disable gzip compression on pages #308

Closed tdicks closed 7 years ago

tdicks commented 9 years ago

I'm running Seahub through an IIS reverse proxy and would like to rewrite the content outputted by seahub to adjust the links to be correct. Unfortunately I can't do the rewrite as the page output is gzipped so I wondered if there's a way to disable the compression.

I believe Seahub uses django which I have no experience in whatsoever, so I'm wondering if the configuration setting might be in there rather than Seahub itself. Any pointers?

lins05 commented 9 years ago

What do you mean by " to adjust the links to be correct"?

On Tue, Nov 25, 2014 at 9:09 PM, tdicks notifications@github.com wrote:

I'm running Seahub through an IIS reverse proxy and would like to rewrite the content outputted by seahub to adjust the links to be correct. Unfortunately I can't do the rewrite as the page output is gzipped so I wondered if there's a way to disable the compression.

I believe Seahub uses django which I have no experience in whatsoever, so I'm wondering if the configuration setting might be in there rather than Seahub itself. Any pointers?

— Reply to this email directly or view it on GitHub https://github.com/haiwen/seahub/issues/308.

tdicks commented 9 years ago

If the output of the proxied service (in this case seahub) isn't gzipped, the URL Rewrite module can parse the HTML and change any links matching the internal URL to one which is externally accessible. The problem is the module can't do this when the output from seahub is compressed.

lins05 commented 9 years ago

Yeah, I understand what you mean, by I'm curious about why do you want to rewrite the links inside the HTML?

On Tue, Nov 25, 2014 at 10:12 PM, tdicks notifications@github.com wrote:

If the output of the proxied service (in this case seahub) isn't gzipped, the URL Rewrite module can parse the HTML and change any links matching the internal URL to one which is externally accessible. The problem is the module can't do this when the output from seahub is compressed.

— Reply to this email directly or view it on GitHub https://github.com/haiwen/seahub/issues/308#issuecomment-64404539.

tdicks commented 9 years ago

Oh right! When I access Seahub on the port it's actually running on (8777), file downloads work fine. Via the reverse proxy with IIS, I can navigate the site but can't download single files or folders as a ZIP, it just comes up with Sorry, but the requested page could not be found..

I changed the SERVICE_URL in ccnet.conf to make the share download links generate properly, but I might not fully understand the impact of doing this elsewhere in Seahub.

lins05 commented 9 years ago

Can you paste your ccnet.conf and seahub_settings.py?

On Tue, Nov 25, 2014 at 10:38 PM, tdicks notifications@github.com wrote:

Oh right! When I access Seahub on the port it's actually running on (8777), file downloads work fine. Via the reverse proxy with IIS, I can navigate the site but can't download single files or folders as a ZIP, it just comes up with Sorry, but the requested page could not be found..

I changed the SERVICE_URL in ccnet.conf to make the share download links generate properly, but I might not fully understand the impact of doing this elsewhere in Seahub.

— Reply to this email directly or view it on GitHub https://github.com/haiwen/seahub/issues/308#issuecomment-64408168.

tdicks commented 9 years ago

Yep sure, here's ccnet.conf:

[General]
USER_NAME = my-seafile
ID = 33130e7454daafe4e8a7fb663cbd5cae75ca097c
NAME = captec-extshare
SERVICE_URL = http://extshare.captec-group.com

[Network]
PORT = 10001

[Client]
PORT = 13418

And this is seahub_settings.py:

SECRET_KEY = 'xxx'
CLOUD_MODE = True
SITE_TITLE = 'Captec External Share'
SITE_NAME = SITE_TITLE
BRANDING_CSS = 'custom/captec.css'
LOGO_PATH = 'custom/captec_logo.jpg'

# Email settings
EMAIL_USE_TLS = True
EMAIL_HOST = 'xxx'        # smtp server
EMAIL_HOST_USER = 'xxx'    # username and domain
EMAIL_HOST_PASSWORD = 'xxx'    # password
EMAIL_PORT = '25'
DEFAULT_FROM_EMAIL = 'xxx'
SERVER_EMAIL = 'xxx'

Private config items are replaced with xxx. I remember there was another config file I had to edit to change the Seahub port to 8777.