MCPcopy Create free account
hub / github.com/aaPanel/BaoTa / exists_apache_ssl

Method exists_apache_ssl

class/projectModel/pythonModel.py:2245–2265  ·  view source on GitHub ↗

@name 判断项目是否配置Apache SSL配置 @author hwliang<2021-08-09> @param project_name: string<项目名称> @return bool

(self, project_name)

Source from the content-addressed store, hash-verified

2243 return is_ssl, is_force_ssl
2244
2245 def exists_apache_ssl(self, project_name):
2246 ''&#x27;
2247 @name 判断项目是否配置Apache SSL配置
2248 @author hwliang<2021-08-09>
2249 @param project_name: string<项目名称>
2250 @return bool
2251 ''&#x27;
2252 config_file = "{}/apache/python_{}.conf".format(public.get_vhost_path(), project_name)
2253 if not os.path.exists(config_file):
2254 return False, False
2255
2256 config_body = public.readFile(config_file)
2257 if not config_body:
2258 return False, False
2259
2260 is_ssl, is_force_ssl = False, False
2261 if config_body.find('SSLCertificateFile') != -1:
2262 is_ssl = True
2263 if config_body.find('HTTP_TO_HTTPS_START') != -1:
2264 is_force_ssl = True
2265 return is_ssl, is_force_ssl
2266
2267 def set_apache_config(self, project):
2268 ''&#x27;

Callers 1

set_apache_configMethod · 0.95

Calls 4

readFileMethod · 0.80
formatMethod · 0.45
existsMethod · 0.45
findMethod · 0.45

Tested by

no test coverage detected