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

Method exists_nginx_ssl

mod/project/java/java_web_conf.py:269–286  ·  view source on GitHub ↗

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

(self, project_name)

Source from the content-addressed store, hash-verified

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"]

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