modify seafdav config

This commit is contained in:
sniper-py 2020-06-16 17:31:27 +08:00
parent b2fa1ee7a1
commit 873656cd59
3 changed files with 14 additions and 2 deletions

View file

@ -69,7 +69,7 @@ server {
}
location /seafdav {
proxy_pass http://127.0.0.1:8080/seafdav;
proxy_pass http://127.0.0.1:8080;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;

View file

@ -69,7 +69,7 @@ server {
}
location /seafdav {
proxy_pass http://127.0.0.1:8080/seafdav;
proxy_pass http://127.0.0.1:8080;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;

View file

@ -206,6 +206,18 @@ COMPRESS_CACHE_BACKEND = 'locmem'""")
with open(join(topdir, 'conf', 'seahub_settings.py'), 'w') as fp:
fp.writelines(fp_lines)
# Modify seafdav config
if os.path.exists(join(topdir, 'conf', 'seafdav.conf')):
with open(join(topdir, 'conf', 'seafdav.conf'), 'r') as fp:
fp_lines = fp.readlines()
if 'share_name = /\n' in fp_lines:
replace_index = fp_lines.index('share_name = /\n')
replace_line = 'share_name = /seafdav\n'
fp_lines[replace_index] = replace_line
with open(join(topdir, 'conf', 'seafdav.conf'), 'w') as fp:
fp.writelines(fp_lines)
# After the setup script creates all the files inside the
# container, we need to move them to the shared volume
#