mirror of
https://github.com/midoks/mdserver-web.git
synced 2026-10-10 04:59:25 +08:00
up
This commit is contained in:
@@ -143,6 +143,14 @@ def systemdCfgDir():
|
||||
return "/tmp"
|
||||
|
||||
|
||||
def getSslCrt():
|
||||
if os.path.exists('/etc/ssl/certs/ca-certificates.crt'):
|
||||
return '/etc/ssl/certs/ca-certificates.crt'
|
||||
if os.path.exists('/etc/pki/tls/certs/ca-bundle.crt'):
|
||||
return '/etc/pki/tls/certs/ca-bundle.crt'
|
||||
return ''
|
||||
|
||||
|
||||
def getOs():
|
||||
return sys.platform
|
||||
|
||||
|
||||
@@ -78,14 +78,6 @@ def status(version):
|
||||
return 'start'
|
||||
|
||||
|
||||
def getSslCrt():
|
||||
if os.path.exists('/etc/ssl/certs/ca-certificates.crt'):
|
||||
return '/etc/ssl/certs/ca-certificates.crt'
|
||||
if os.path.exists('/etc/pki/tls/certs/ca-bundle.crt'):
|
||||
return '/etc/pki/tls/certs/ca-bundle.crt'
|
||||
return ''
|
||||
|
||||
|
||||
def contentReplace(content, version):
|
||||
service_path = mw.getServerDir()
|
||||
content = content.replace('{$ROOT_PATH}', mw.getRootDir())
|
||||
@@ -184,7 +176,7 @@ def initReplace(version):
|
||||
install_ok = getServerDir() + "/" + version + "/install.ok"
|
||||
if not os.path.exists(install_ok):
|
||||
phpini = getConf(version)
|
||||
ssl_crt = getSslCrt()
|
||||
ssl_crt = mw.getSslCrt()
|
||||
|
||||
cmd_openssl = "sed -i \"s#;openssl.cafile=#openssl.cafile=${crtPath}#\" " + \
|
||||
ssl_crt + "/etc/php.ini"
|
||||
|
||||
@@ -109,21 +109,13 @@ def status(version):
|
||||
return 'start'
|
||||
|
||||
|
||||
def getSslCrt():
|
||||
if os.path.exists('/etc/ssl/certs/ca-certificates.crt'):
|
||||
return '/etc/ssl/certs/ca-certificates.crt'
|
||||
if os.path.exists('/etc/pki/tls/certs/ca-bundle.crt'):
|
||||
return '/etc/pki/tls/certs/ca-bundle.crt'
|
||||
return ''
|
||||
|
||||
|
||||
def contentReplace(content, version):
|
||||
service_path = mw.getServerDir()
|
||||
content = content.replace('{$ROOT_PATH}', mw.getRootDir())
|
||||
content = content.replace('{$SERVER_PATH}', service_path)
|
||||
content = content.replace('{$PHP_VERSION}', version)
|
||||
content = content.replace('{$LOCAL_IP}', mw.getLocalIp())
|
||||
content = content.replace('{$SSL_CRT}', getSslCrt())
|
||||
content = content.replace('{$SSL_CRT}', mw.getSslCrt())
|
||||
|
||||
if mw.isAppleSystem():
|
||||
# user = mw.execShell(
|
||||
|
||||
Reference in New Issue
Block a user