diff --git a/backend/example_scripts/README.md b/backend/example_scripts/README.md index 6aa1f10..bf91d9b 100644 --- a/backend/example_scripts/README.md +++ b/backend/example_scripts/README.md @@ -9,7 +9,7 @@ Files in this folder are treated as protected example scripts by the API: Protected behavior: - scripts are synced from this folder into `/srv/fw-scripts` on backend startup -- scripts in this folder cannot be overwritten, disabled, or deleted via the API +- scripts in this folder cannot be overwritten, edited, or deleted via the API - scripts with a deploy config containing `qnum` are auto-started as systemd services Example deploy file: diff --git a/backend/example_scripts/hello_nfqueue.deploy.json b/backend/example_scripts/hello_nfqueue.deploy.json deleted file mode 100644 index fcf15d9..0000000 --- a/backend/example_scripts/hello_nfqueue.deploy.json +++ /dev/null @@ -1,4 +0,0 @@ -{ - "qnum": 1, - "enable_at_boot": true -} diff --git a/backend/src/api/packet_scripting_api.py b/backend/src/api/packet_scripting_api.py index 0f1cf41..7f84648 100644 --- a/backend/src/api/packet_scripting_api.py +++ b/backend/src/api/packet_scripting_api.py @@ -926,8 +926,6 @@ def enable_script(name: str, req: EnableRequest) -> OperationResult: except ValueError as e: raise HTTPException(status_code=400, detail=str(e)) - assert_not_example_script(name, "manually enabled") - script_path = script_path_for(name) if not os.path.exists(script_path): raise HTTPException(status_code=404, detail="script not found") @@ -968,8 +966,6 @@ def disable_script(name: str, qnum: int) -> OperationResult: validate_name(name) except ValueError as e: raise HTTPException(status_code=400, detail=str(e)) - - assert_not_example_script(name, "disabled") service_name = make_service_name(name, qnum) # attempt stop + remove via systemctl-based remove_unit try: @@ -1102,4 +1098,4 @@ def register_lifecycle(app) -> None: remove_unit(svc) except Exception: logger.exception("Failed to remove unit %s on shutdown", svc) - logger.info("Shutdown cleanup complete") \ No newline at end of file + logger.info("Shutdown cleanup complete")