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

Method create_proxy

mod/project/java/server_proxy.py:455–475  ·  view source on GitHub ↗
(self, proxy_data: dict)

Source from the content-addressed store, hash-verified

453 return err_msg
454
455 def create_proxy(self, proxy_data: dict) -> Optional[str]:
456 for i in self.config:
457 if i["proxy_dir"] == proxy_data["proxy_dir"]:
458 proxy_data["proxy_id"] = i["proxy_id"]
459 return self.modify_proxy(proxy_data)
460
461 if self.ws_type == "nginx":
462 err_msg = self.check_location(proxy_data["proxy_dir"])
463 if err_msg:
464 return json_response(False, err_msg)
465
466 self._set_nginx_proxy_base()
467 error_msg = self.add_nginx_proxy(proxy_data)
468 if self.ws_type == "nginx" and error_msg:
469 return error_msg
470 error_msg = self.add_apache_proxy(proxy_data)
471 if self.ws_type == "apache" and error_msg:
472 return error_msg
473 self.config.append(proxy_data)
474 self.save_config()
475 service_reload()
476
477 def modify_proxy(self, proxy_data: dict) -> Optional[str]:
478 idx = None

Callers 1

add_server_proxyMethod · 0.95

Calls 9

modify_proxyMethod · 0.95
check_locationMethod · 0.95
_set_nginx_proxy_baseMethod · 0.95
add_nginx_proxyMethod · 0.95
add_apache_proxyMethod · 0.95
save_configMethod · 0.95
json_responseFunction · 0.90
service_reloadFunction · 0.90
appendMethod · 0.45

Tested by

no test coverage detected