This commit is contained in:
midoks
2021-11-12 19:29:01 +08:00
parent 85516c737e
commit ee26d79b0e
2 changed files with 9 additions and 6 deletions
+6 -3
View File
@@ -616,9 +616,12 @@ class system_api:
def getServerInfo(self):
upAddr = 'https://raw.githubusercontent.com/midoks/mdserver-web/master/version/info.json'
try:
requests.adapters.DEFAULT_RETRIES = 2
r = requests.get(upAddr, verify=False)
version = json.loads(r.content)
# requests.adapters.DEFAULT_RETRIES = 2
# r = requests.get(upAddr, verify=False)
req = urllib.request.urlopen(upAddr, timeout=timeout)
result = req.read().decode('utf-8')
version = json.loads(result)
return version[0]
except Exception as e:
print('getServerInfo', e)
+3 -3
View File
@@ -48,6 +48,6 @@ loglevel = 'info'
errorlog = chdir + '/logs/error.log'
accesslog = chdir + '/logs/access.log'
pidfile = chdir + '/logs/mw.pid'
# if os.path.exists(os.getcwd() + '/data/ssl.pl'):
# certfile = 'ssl/certificate.pem'
# keyfile = 'ssl/privateKey.pem'
if os.path.exists(os.getcwd() + '/data/ssl.pl'):
certfile = 'ssl/certificate.pem'
keyfile = 'ssl/privateKey.pem'