1
0
mirror of https://github.com/haiwen/seahub.git synced 2025-09-02 15:38:15 +00:00

Upgrade 9.0 10.0 (#5374)

* upgrade_9.0_10.0

* seafile-monitor.sh

* rm seahub-extra in scripts

* rm seafile_auth_token
This commit is contained in:
欢乐马
2023-02-13 10:57:55 +08:00
committed by GitHub
parent f086d4705b
commit 78ba95f82f
20 changed files with 444 additions and 79 deletions

View File

@@ -932,6 +932,7 @@ class SeafileConfigurator(AbstractConfigurator):
fp.write('[fileserver]\nport=%d\n' % self.fileserver_port)
self.generate_db_conf()
self.generate_notification_conf()
## use default seafile-data path: seafile_data_dir=${TOPDIR}/seafile-data
@@ -959,6 +960,32 @@ class SeafileConfigurator(AbstractConfigurator):
Utils.write_config(config, self.seafile_conf)
def generate_notification_conf(self):
config = Utils.read_config(self.seafile_conf)
# [notification]
# enabled=
# host=
# port=
# log_level=
# jwt_private_key=
script = os.path.join(env_mgr.install_path, 'seahub/tools/secret_key_generator.py')
cmd = [
Utils.get_python_executable(),
script,
]
jwt_private_key = Utils.get_command_output(cmd).strip()
db_section = 'notification'
if not config.has_section(db_section):
config.add_section(db_section)
config.set(db_section, 'enabled', 'false')
config.set(db_section, 'host', '127.0.0.0')
config.set(db_section, 'port', '8083')
config.set(db_section, 'log_level', 'info')
config.set(db_section, 'jwt_private_key', jwt_private_key)
Utils.write_config(config, self.seafile_conf)
def validate_seafile_dir(self, path):
if os.path.exists(path):
raise InvalidAnswer('%s already exists' % Utils.highlight(path))