feat(service): add GEOBLOCK negative geofence

Regions in GEOBLOCK refuse the service and everything else is allowed. A hit stops the run with a region error instead of auto-proxying; the check also covers proxy exits and the remote-dl client region.
This commit is contained in:
imSp4rky
2026-09-16 15:06:43 -06:00
parent 1a993f4cb9
commit aec45e30cc
17 changed files with 154 additions and 20 deletions
+1 -1
View File
@@ -182,7 +182,7 @@ GET /api/dashboard/services
[{"tag": "EXAMPLE", "state": "staged", "error": null,
"commit": "9cc230c98f13b83f6c6fe831595b9702d3ba2786", "staged_commit": "5f0aa17...",
"staged_since": 1756908900.0, "sessions": 1, "jobs": 1,
"aliases": ["EXMPL"], "geofence": ["US"]}]
"aliases": ["EXMPL"], "geofence": ["US"], "geoblock": []}]
```
`state` is `loaded`, `staged` or `failed`. A service that failed to import keeps its error
+2
View File
@@ -79,6 +79,7 @@ Show the streaming services available on this server, filtered by your allowlist
"tag": "EXAMPLE",
"aliases": ["EX"],
"geofence": ["US"],
"geoblock": [],
"title_regex": "^https?://example\\.com/.+",
"url": "https://example.com",
"help": "EXAMPLE\nAuthorization: Cookies\nSecurity: FHD@L3",
@@ -112,6 +113,7 @@ Field notes:
| `tag` | Canonical service tag; use this as the `service` value on other endpoints. |
| `aliases` | Alternate tags the service also answers to. |
| `geofence` | Region codes the service is geofenced to (may be empty). |
| `geoblock` | Region codes where the service refuses to work (may be empty). |
| `title_regex` | URL/ID pattern the service matches, as a string or list of strings (or `null`). |
| `url` | Service URL, taken from the service's CLI short help. |
| `help` | The service module's docstring. |
+1 -1
View File
@@ -152,7 +152,7 @@ The classification is keyword-based, checked in order:
|---|---|---|
| `auth`, `login`, `credential`, `unauthorized`, `forbidden`, `token` | `AUTH_FAILED` (401) | no |
| `connection`, `timeout`, `network`, `unreachable`, `socket`, `dns`, `resolve` (or `ConnectionError`, `TimeoutError`, `URLError`, `SSLError`) | `NETWORK_ERROR` (503) | yes |
| `geofence`, `region`, `not available in`, `territory` | `GEOFENCE` (403) | no |
| `geofence`, `geoblock`, `region`, `not available in`, `territory` | `GEOFENCE` (403) | no |
| `not found`, `404`, `does not exist`, `invalid id` | `NOT_FOUND` (404) | no |
| `rate limit`, `too many requests`, `429`, `throttle` | `RATE_LIMITED` (429) | yes |
| `drm`, `license`, `widevine`, `playready`, `decrypt` | `DRM_ERROR` (502) | no |
+1
View File
@@ -141,6 +141,7 @@ curl "$BASE/api/services" \
"tag": "EXAMPLE",
"aliases": ["EX"],
"geofence": [],
"geoblock": [],
"title_regex": null,
"url": "https://example.com",
"help": "EXAMPLE service documentation...",