mdserver-web/setting.py

34 lines
807 B
Python
Raw Normal View History

2018-12-20 08:45:09 -05:00
# coding:utf-8
2018-12-12 05:06:02 -05:00
import os
import time
import sys
2018-12-12 12:14:25 -05:00
chdir = os.getcwd()
sys.path.append(chdir + '/class/core')
2018-12-12 05:06:02 -05:00
import public
2018-12-12 12:09:38 -05:00
import system_api
cpu_info = system_api.system_api().getCpuInfo()
2018-12-12 05:45:33 -05:00
if not os.path.exists(os.getcwd() + '/logs'):
os.mkdir(os.getcwd() + '/logs')
2018-12-12 05:06:02 -05:00
bt_port = public.readFile('data/port.pl')
bind = ['0.0.0.0:%s' % bt_port]
2018-12-12 12:09:38 -05:00
workers = cpu_info[1] + 1
2018-12-12 05:06:02 -05:00
threads = 1
backlog = 512
2018-12-28 04:02:38 -05:00
reload = True
2018-12-12 12:14:25 -05:00
daemon = True
2018-12-12 05:06:02 -05:00
timeout = 7200
keepalive = 1
2018-12-12 05:45:33 -05:00
capture_output = True
access_log_format = '%(t)s %(p)s %(h)s "%(r)s" %(s)s %(L)s %(b)s %(f)s" "%(a)s"'
loglevel = 'info'
2018-12-12 12:14:25 -05:00
errorlog = chdir + '/logs/error.log'
accesslog = chdir + '/logs/access.log'
pidfile = chdir + '/logs/mw.pid'
2018-12-28 23:42:29 -05:00
if os.path.exists(os.getcwd() + '/data/ssl.pl'):
certfile = 'ssl/certificate.pem'
keyfile = 'ssl/privateKey.pem'