-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathserverconfig.py
More file actions
26 lines (24 loc) · 1.24 KB
/
serverconfig.py
File metadata and controls
26 lines (24 loc) · 1.24 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
"""
Creates a configuration interface specific for the server.
"""
import configtony
def get_server_config(defaults_only=False):
server_config = configtony.Config(None if defaults_only else "./config.jsonc")
server_config.add_option("db_path", str, "./backupchan.db") # Unused
server_config.add_option("webui_enable", bool, True)
server_config.add_option("web_debug", bool, False)
server_config.add_option("temp_save_path", str, "/tmp/backupchan")
server_config.add_option("db", dict, {})
server_config.add_option("recycle_bin_path", str, "./Recycle-bin")
server_config.add_option("recycle_job_interval", int, 3600)
server_config.add_option("backup_filesize_job_interval", int, 7200)
server_config.add_option("deduplicate_job_interval", int, 18000)
server_config.add_option("stale_seq_upload_job_interval", int, 3600)
server_config.add_option("tmp_purge_job_interval", int, 43200)
server_config.add_option("integrity_check_job_interval", int, 57600)
server_config.add_option("webui_auth", bool, False)
server_config.add_option("page_size", int, 10)
server_config.add_option("webui_localhost_disable_auth", bool, False)
if not defaults_only:
server_config.parse()
return server_config