1
0
mirror of https://github.com/haiwen/seafile-server.git synced 2025-05-10 17:16:39 +00:00

Fix the arguments of ccnet init.

This commit is contained in:
ly1217 2019-10-22 19:53:25 -07:00
parent cafce2ba74
commit 171895d25e
5 changed files with 2 additions and 50 deletions

View File

@ -56,8 +56,6 @@ class ServerCtl(object):
self.central_conf_dir,
'-c',
self.ccnet_conf_dir,
'--name',
'test',
'--host',
'test.seafile.com',
]

View File

@ -32,9 +32,9 @@ from .service import create_org, get_orgs_by_user, get_org_by_url_prefix, \
from .service import get_related_users_by_repo, get_related_users_by_org_repo
from .service import post_empty_file, del_file
from .service import CCNET_CONF_PATH, CCNET_SERVER_ADDR, CCNET_SERVER_PORT, \
from .service import CCNET_CONF_PATH, CCNET_SERVER_ADDR, \
MAX_UPLOAD_FILE_SIZE, MAX_DOWNLOAD_DIR_SIZE, FILE_SERVER_ROOT, \
CALC_SHARE_USAGE, SERVICE_URL, FILE_SERVER_PORT, SERVER_ID, \
CALC_SHARE_USAGE, SERVICE_URL, FILE_SERVER_PORT, \
SEAFILE_CENTRAL_CONF_DIR, LDAP_HOST
from .service import send_message

View File

@ -806,7 +806,6 @@ class CcnetConfigurator(AbstractConfigurator):
ccnet_init,
'-F', env_mgr.central_config_dir,
'--config-dir', self.ccnet_dir,
'--name', self.server_name,
'--host', self.ip_or_domain,
]

View File

@ -498,7 +498,6 @@ if [[ "${use_existing_ccnet}" != "true" ]]; then
if ! LD_LIBRARY_PATH=$SEAFILE_LD_LIBRARY_PATH "${ccnet_init}" \
-F "${default_conf_dir}" \
-c "${default_ccnet_conf_dir}" \
--name "${server_name}" \
--host "${ip_or_domain}"; then
err_and_quit;
fi

View File

@ -47,11 +47,9 @@ SCRIPT_NAME = os.path.basename(sys.argv[0])
PYTHON = sys.executable
conf = {}
CONF_SERVER_NAME = 'server_name'
CONF_CCNET_DIR = 'ccnet_dir'
CONF_SEAFILE_DIR = 'seafile_dir'
CONF_SEAHUB_DIR = 'seafile_dir'
CONF_CCNET_PORT = 'ccnet_port'
CONF_SEAFILE_PORT = 'seafile_port'
CONF_FILESERVER_PORT = 'fileserver_port'
CONF_IP_OR_DOMAIN = 'ip_or_domain'
@ -304,21 +302,6 @@ Press [ENTER] to continue
print welcome_msg
raw_input()
def get_server_name():
def validate(name):
r = re.compile(r'^[\w]{3,15}$')
return bool(r.match(name))
question = 'What is the name of the server?'
key = 'server name'
note = '3 - 15 letters or digits'
conf[CONF_SERVER_NAME] = ask_question(question,
key=key,
note=note,
validate=validate)
def get_server_ip_or_domain():
def validate(s):
r = r'^[^.].+\..+[^.]$'
@ -352,24 +335,6 @@ def get_ccnet_conf_dir():
conf[CONF_CCNET_DIR] = ccnet_conf_dir
def get_ccnet_port():
def validate(s):
try:
port = int(s)
except ValueError:
return False
return port > 0 and port < 65536
question = 'Which port do you want to use for the ccnet server?'
key = 'ccnet server port'
default = '10001'
conf[CONF_CCNET_PORT] = ask_question(question,
key=key,
default=default,
validate=validate)
def get_seafile_port():
def validate(s):
try:
@ -568,9 +533,7 @@ def check_python_dependencies(silent=False):
def config_ccnet_seafile():
get_ccnet_conf_dir()
if not conf[CONF_CCNET_CONF_EXISTS]:
get_server_name()
get_server_ip_or_domain()
get_ccnet_port()
get_seafile_data_dir()
if not conf[CONF_SEAFILE_CONF_EXISTS]:
@ -584,11 +547,8 @@ def config_ccnet_seafile():
highlight(conf[CONF_CCNET_DIR]))
else:
info('ccnet conf dir: %s' % highlight(conf[CONF_CCNET_DIR]))
info('server name: %s' %
highlight(conf[CONF_SERVER_NAME]))
info('server host: %s' %
highlight(conf[CONF_IP_OR_DOMAIN]))
info('ccnet port: %s' % highlight(conf[CONF_CCNET_PORT]))
if conf[CONF_SEAFILE_CONF_EXISTS]:
info('seafile: use existing config in %s' %
@ -619,10 +579,6 @@ def init_ccnet_seafile():
conf[CONF_SEAFILE_CENTRAL_CONF_DIR],
'-c',
conf[CONF_CCNET_DIR],
'--name',
conf[CONF_SERVER_NAME],
'--port',
conf[CONF_CCNET_PORT],
'--host',
conf[CONF_IP_OR_DOMAIN],
]