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

Method exists_apache_ssl

class/projectModel/javaModel.py:1248–1268  ·  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

1246 return True
1247
1248 def exists_apache_ssl(self, project_name):
1249 ''&#x27;
1250 @name 判断项目是否配置Apache SSL配置
1251 @author hwliang<2021-08-09>
1252 @param project_name: string<项目名称>
1253 @return bool
1254 ''&#x27;
1255 config_file = "{}/apache/java_{}.conf".format(public.get_vhost_path(), project_name)
1256 if not os.path.exists(config_file):
1257 return False, False
1258
1259 config_body = public.readFile(config_file)
1260 if not config_body:
1261 return False, False
1262
1263 is_ssl, is_force_ssl = False, False
1264 if config_body.find('SSLCertificateFile') != -1:
1265 is_ssl = True
1266 if config_body.find('HTTP_TO_HTTPS_START') != -1:
1267 is_force_ssl = True
1268 return is_ssl, is_force_ssl
1269
1270 def set_apache_config(self, project_find):
1271 ''&#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