forked from haiwen/seafile-docker
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
6 changed files
with
367 additions
and
85 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
*** seafile-server-7.0.4.orig/seahub/thirdpart/wsgidav/addons/seafile/seahub_db.py 2019-05-28 04:13:37.000000000 +0000 | ||
--- seafile-server-7.0.4/seahub/thirdpart/wsgidav/addons/seafile/seahub_db.py 2019-10-30 18:19:08.451625194 +0000 | ||
*************** from sqlalchemy.orm import sessionmaker | ||
*** 7,12 **** | ||
--- 7,16 ---- | ||
from sqlalchemy.pool import Pool | ||
from sqlalchemy.ext.automap import automap_base | ||
|
||
+ from seaf_utils import SEAFILE_CENTRAL_CONF_DIR, SEAFILE_CONF_DIR | ||
+ import os | ||
+ import sys | ||
+ | ||
Base = automap_base() | ||
|
||
import wsgidav.util as util | ||
*************** def init_db_session_class(): | ||
*** 24,29 **** | ||
--- 28,39 ---- | ||
return None | ||
|
||
def create_seahub_db_engine(): | ||
+ path = SEAFILE_CENTRAL_CONF_DIR if SEAFILE_CENTRAL_CONF_DIR else SEAFILE_CONF_DIR; | ||
+ if os.path.exists(path): | ||
+ sys.path.insert(0, path) | ||
+ | ||
+ | ||
+ | ||
import seahub_settings | ||
db_infos = seahub_settings.DATABASES['default'] | ||
#import local_settings | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
import time | ||
import os | ||
|
||
from utils import (get_command_output, logdbg, listen_on_https, | ||
behind_ssl_termination, get_conf, render_template, call) | ||
|
||
|
||
def wait_for_nginx(): | ||
while True: | ||
logdbg('waiting for nginx server to be ready') | ||
output = get_command_output('netstat -nltp') | ||
if ':80 ' in output: | ||
logdbg(output) | ||
logdbg('nginx is ready') | ||
return | ||
time.sleep(2) | ||
|
||
|
||
def change_nginx_config(https=None, skip_writing_shared_conf=False): | ||
if https is None: | ||
https = listen_on_https() | ||
|
||
domain = get_conf('SEAFILE_SERVER_HOSTNAME', 'seafile.example.com') | ||
|
||
nginx_shared_file = '/shared/nginx/conf/seafile.nginx.conf' | ||
|
||
if not os.path.isfile(nginx_shared_file): | ||
nginx_etc_file = '/etc/nginx/sites-enabled/seafile.nginx.conf' | ||
context = { | ||
'https': https, | ||
# 'behind_ssl_termination': behind_ssl_termination(), | ||
'domain': domain, | ||
# 'enable_webdav': get_conf('ENABLE_WEBDAV', '0') != '0' | ||
} | ||
render_template('/templates/seafile.nginx.conf.template', | ||
nginx_etc_file, context) | ||
if not skip_writing_shared_conf: | ||
call( | ||
'mv {0} {1} && ln -sf {1} {0}'.format(nginx_etc_file, nginx_shared_file)) | ||
|
||
call('nginx -s reload') | ||
time.sleep(2) |
Oops, something went wrong.