@name 判断项目是否配置Apache SSL配置 @author hwliang<2021-08-09> @param project_name: string<项目名称> @return bool
(self, project_name)
| 1246 | return True |
| 1247 | |
| 1248 | def exists_apache_ssl(self, project_name): |
| 1249 | ''' |
| 1250 | @name 判断项目是否配置Apache SSL配置 |
| 1251 | @author hwliang<2021-08-09> |
| 1252 | @param project_name: string<项目名称> |
| 1253 | @return bool |
| 1254 | ''' |
| 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 | ''' |
no test coverage detected