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

Method exists_apache_ssl

mod/project/java/java_web_conf.py:503–520  ·  view source on GitHub ↗

判断项目是否配置Apache SSL配置

(self, project_name)

Source from the content-addressed store, hash-verified

501 service_reload()
502
503 def exists_apache_ssl(self, project_name) -> Tuple[bool, bool]:
504 """
505 判断项目是否配置Apache SSL配置
506 """
507 config_file = "{}/apache/java_{}.conf".format(self._vhost_path, project_name)
508 if not os.path.exists(config_file):
509 return False, False
510
511 config_body = public.readFile(config_file)
512 if not isinstance(config_body, str):
513 return False, False
514
515 is_ssl, is_force_ssl = False, False
516 if config_body.find('SSLCertificateFile') != -1:
517 is_ssl = True
518 if config_body.find('HTTP_TO_HTTPS_START') != -1:
519 is_force_ssl = True
520 return is_ssl, is_force_ssl
521
522
523class JavaWebConfig:

Callers 1

_get_ssl_statusMethod · 0.45

Calls 4

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

Tested by

no test coverage detected