判断项目是否配置Apache SSL配置
(self, project_name)
| 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 | |
| 523 | class JavaWebConfig: |
no test coverage detected