Skip to content

Commit fd732ac

Browse files
plugins
1 parent 92ddea5 commit fd732ac

File tree

6 files changed

+37
-20
lines changed

6 files changed

+37
-20
lines changed

asset-manifest.json

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"files": {
33
"main.css": "/static/css/main.a3dbeddd.css",
4-
"main.js": "/static/js/main.fab92c59.js",
4+
"main.js": "/static/js/main.09128b25.js",
55
"static/media/roboto-all-500-normal.woff": "/static/media/roboto-all-500-normal.0ab669b7a0d19b178f57.woff",
66
"static/media/roboto-all-700-normal.woff": "/static/media/roboto-all-700-normal.a457fde362a540fcadff.woff",
77
"static/media/roboto-all-400-normal.woff": "/static/media/roboto-all-400-normal.c5d001fa922fa66a147f.woff",
@@ -36,10 +36,10 @@
3636
"static/media/roboto-greek-ext-700-normal.woff2": "/static/media/roboto-greek-ext-700-normal.bd9854c751441ccc1a70.woff2",
3737
"index.html": "/index.html",
3838
"main.a3dbeddd.css.map": "/static/css/main.a3dbeddd.css.map",
39-
"main.fab92c59.js.map": "/static/js/main.fab92c59.js.map"
39+
"main.09128b25.js.map": "/static/js/main.09128b25.js.map"
4040
},
4141
"entrypoints": [
4242
"static/css/main.a3dbeddd.css",
43-
"static/js/main.fab92c59.js"
43+
"static/js/main.09128b25.js"
4444
]
45-
}
45+
}

index.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
<!doctype html><html lang="en"><head><meta charset="utf-8"/><link rel="icon" href="/favicon.ico"/><meta name="viewport" content="width=device-width,initial-scale=1"/><meta name="theme-color" content="#000000"/><meta name="description" content="Pioreactor"/><link rel="apple-touch-icon" href="/logo192.png"/><link rel="manifest" href="/manifest.json"/><script defer="defer" src="/static/js/main.fab92c59.js"></script><link href="/static/css/main.a3dbeddd.css" rel="stylesheet"></head><body><div id="root"></div></body></html>
1+
<!doctype html><html lang="en"><head><meta charset="utf-8"/><link rel="icon" href="/favicon.ico"/><meta name="viewport" content="width=device-width,initial-scale=1"/><meta name="theme-color" content="#000000"/><meta name="description" content="Pioreactor"/><link rel="apple-touch-icon" href="/logo192.png"/><link rel="manifest" href="/manifest.json"/><script defer="defer" src="/static/js/main.09128b25.js"></script><link href="/static/css/main.a3dbeddd.css" rel="stylesheet"></head><body><div id="root"></div></body></html>

pioreactorui/api.py

Lines changed: 27 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -785,22 +785,39 @@ def get_plugins_on_machine(pioreactor_unit: str) -> ResponseReturnValue:
785785
return create_task_response(task)
786786

787787

788-
@api.route("/plugins/install", methods=["POST", "PATCH"])
789-
def install_plugin_across_cluster() -> ResponseReturnValue:
788+
@api.route("/units/<pioreactor_unit>/plugins/install", methods=["POST", "PATCH"])
789+
def install_plugin_across_cluster(pioreactor_unit: str) -> ResponseReturnValue:
790790
# there is a security problem here. See https://github.com/Pioreactor/pioreactor/issues/421
791791
if os.path.isfile(Path(env["DOT_PIOREACTOR"]) / "DISALLOW_UI_INSTALLS"):
792792
return Response(status=403)
793793

794-
return create_task_response(
795-
broadcast_post_across_cluster("/unit_api/plugins/install", request.get_json())
796-
)
794+
if pioreactor_unit == UNIVERSAL_IDENTIFIER:
795+
return create_task_response(
796+
broadcast_post_across_cluster("/unit_api/plugins/install", request.get_json())
797+
)
798+
else:
799+
return create_task_response(
800+
tasks.multicast_post_across_cluster(
801+
"/unit_api/plugins/install", [pioreactor_unit], request.get_json()
802+
)
803+
)
797804

798805

799-
@api.route("/plugins/uninstall", methods=["POST", "PATCH"])
800-
def uninstall_plugin_across_cluster() -> ResponseReturnValue:
801-
return create_task_response(
802-
broadcast_post_across_cluster("/unit_api/plugins/uninstall", request.get_json())
803-
)
806+
@api.route("/units/<pioreactor_unit>/plugins/uninstall", methods=["POST", "PATCH"])
807+
def uninstall_plugin_across_cluster(pioreactor_unit: str) -> ResponseReturnValue:
808+
if os.path.isfile(Path(env["DOT_PIOREACTOR"]) / "DISALLOW_UI_INSTALLS"):
809+
return Response(status=403)
810+
811+
if pioreactor_unit == UNIVERSAL_IDENTIFIER:
812+
return create_task_response(
813+
broadcast_post_across_cluster("/unit_api/plugins/uninstall", request.get_json())
814+
)
815+
else:
816+
return create_task_response(
817+
tasks.multicast_post_across_cluster(
818+
"/unit_api/plugins/uninstall", [pioreactor_unit], request.get_json()
819+
)
820+
)
804821

805822

806823
@api.route("/jobs/running", methods=["GET"])
Lines changed: 4 additions & 4 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)