@name 判断项目是否配置Apache SSL配置 @author hwliang<2021-08-09> @param project_name: string<项目名称> @return bool
(self, project_name)
| 2243 | return is_ssl, is_force_ssl |
| 2244 | |
| 2245 | def exists_apache_ssl(self, project_name): |
| 2246 | ''' |
| 2247 | @name 判断项目是否配置Apache SSL配置 |
| 2248 | @author hwliang<2021-08-09> |
| 2249 | @param project_name: string<项目名称> |
| 2250 | @return bool |
| 2251 | ''' |
| 2252 | config_file = "{}/apache/python_{}.conf".format(public.get_vhost_path(), project_name) |
| 2253 | if not os.path.exists(config_file): |
| 2254 | return False, False |
| 2255 | |
| 2256 | config_body = public.readFile(config_file) |
| 2257 | if not config_body: |
| 2258 | return False, False |
| 2259 | |
| 2260 | is_ssl, is_force_ssl = False, False |
| 2261 | if config_body.find('SSLCertificateFile') != -1: |
| 2262 | is_ssl = True |
| 2263 | if config_body.find('HTTP_TO_HTTPS_START') != -1: |
| 2264 | is_force_ssl = True |
| 2265 | return is_ssl, is_force_ssl |
| 2266 | |
| 2267 | def set_apache_config(self, project): |
| 2268 | ''' |
no test coverage detected