判断项目是否配置Nginx SSL配置
(self, project_name)
| 267 | service_reload() |
| 268 | |
| 269 | def exists_nginx_ssl(self, project_name): |
| 270 | """ |
| 271 | 判断项目是否配置Nginx SSL配置 |
| 272 | """ |
| 273 | config_file = "{}/nginx/java_{}.conf".format(self._vhost_path, project_name) |
| 274 | if not os.path.exists(config_file): |
| 275 | return False, False |
| 276 | |
| 277 | config_body = public.readFile(config_file) |
| 278 | if isinstance(config_body, str): |
| 279 | return False, False |
| 280 | |
| 281 | is_ssl, is_force_ssl = False, False |
| 282 | if config_body.find('ssl_certificate') != -1: |
| 283 | is_ssl = True |
| 284 | if config_body.find('HTTP_TO_HTTPS_START') != -1: |
| 285 | is_force_ssl = True |
| 286 | return is_ssl, is_force_ssl |
| 287 | |
| 288 | def set_static_path(self, project_data: dict) -> Optional[Union[bool, str]]: |
| 289 | project_path = project_data["project_config"]["jar_path"] |
no test coverage detected