remove disable script protection

This commit is contained in:
2026-04-17 21:40:36 +02:00
parent d90c5e1650
commit ead2d5f217
3 changed files with 2 additions and 10 deletions

View File

@@ -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:

View File

@@ -1,4 +0,0 @@
{
"qnum": 1,
"enable_at_boot": true
}

View File

@@ -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: