Code refactoring for #1980
This commit is contained in:
+139
-214
@@ -29,6 +29,22 @@
|
|||||||
"panic",
|
"panic",
|
||||||
"disabled"
|
"disabled"
|
||||||
]
|
]
|
||||||
|
},
|
||||||
|
"source": {
|
||||||
|
"type": "string",
|
||||||
|
"examples": [
|
||||||
|
"rtsp://username:password@192.168.1.123/cam/realmonitor?channel=1&subtype=0&unicast=true&proto=Onvif",
|
||||||
|
"rtsp://username:password@192.168.1.123/stream1",
|
||||||
|
"rtsp://username:password@192.168.1.123/h264Preview_01_main",
|
||||||
|
"rtmp://192.168.1.123/bcs/channel0_main.bcs?channel=0&stream=0&user=username&password=password",
|
||||||
|
"http://192.168.1.123/flv?port=1935&app=bcs&stream=channel0_main.bcs&user=username&password=password",
|
||||||
|
"http://username:password@192.168.1.123/cgi-bin/snapshot.cgi?channel=1",
|
||||||
|
"ffmpeg:media.mp4#video=h264#hardware#width=1920#height=1080#rotate=180#audio=copy",
|
||||||
|
"ffmpeg:virtual?video=testsrc&size=4K#video=h264#hardware#bitrate=50M",
|
||||||
|
"exec:ffmpeg -re -i media.mp4 -c copy -rtsp_transport tcp -f rtsp {output}",
|
||||||
|
"onvif://username:password@192.168.1.123:80?subtype=0",
|
||||||
|
"tapo://password@192.168.1.123:8800?channel=0&subtype=0"
|
||||||
|
]
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"properties": {
|
"properties": {
|
||||||
@@ -36,13 +52,14 @@
|
|||||||
"type": "object",
|
"type": "object",
|
||||||
"properties": {
|
"properties": {
|
||||||
"listen": {
|
"listen": {
|
||||||
|
"type": "string",
|
||||||
"default": ":1984",
|
"default": ":1984",
|
||||||
"examples": [
|
"examples": [
|
||||||
"127.0.0.1:8080"
|
"127.0.0.1:1984"
|
||||||
],
|
]
|
||||||
"$ref": "#/definitions/listen"
|
|
||||||
},
|
},
|
||||||
"username": {
|
"username": {
|
||||||
|
"description": "Basic auth for WebUI",
|
||||||
"type": "string",
|
"type": "string",
|
||||||
"examples": [
|
"examples": [
|
||||||
"admin"
|
"admin"
|
||||||
@@ -52,38 +69,34 @@
|
|||||||
"type": "string"
|
"type": "string"
|
||||||
},
|
},
|
||||||
"local_auth": {
|
"local_auth": {
|
||||||
"description": "Allow auth from local network without credentials (uses existing Auth header)",
|
"description": "Enable auth check for localhost requests",
|
||||||
"type": "boolean",
|
"type": "boolean",
|
||||||
"default": false
|
"default": false
|
||||||
},
|
},
|
||||||
"base_path": {
|
"base_path": {
|
||||||
|
"description": "API prefix for serving on suburl (/api => /rtc/api)",
|
||||||
"type": "string",
|
"type": "string",
|
||||||
"examples": [
|
"examples": [
|
||||||
"/go2rtc"
|
"/rtc"
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
"static_dir": {
|
"static_dir": {
|
||||||
|
"description": "Folder for static files (custom web interface)",
|
||||||
"type": "string",
|
"type": "string",
|
||||||
"examples": [
|
"examples": [
|
||||||
"/var/www"
|
"www"
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
"origin": {
|
"origin": {
|
||||||
"description": "Set to \"*\" to enable CORS and allow any Origin",
|
"description": "Allow CORS requests (only * supported)",
|
||||||
"type": "string",
|
"type": "string",
|
||||||
"anyOf": [
|
"enum": [
|
||||||
{
|
"*",
|
||||||
"type": "string",
|
""
|
||||||
"const": "*"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"type": "string",
|
|
||||||
"const": ""
|
|
||||||
}
|
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
"tls_listen": {
|
"tls_listen": {
|
||||||
"$ref": "#/definitions/listen"
|
"type": "string"
|
||||||
},
|
},
|
||||||
"tls_cert": {
|
"tls_cert": {
|
||||||
"type": "string",
|
"type": "string",
|
||||||
@@ -106,16 +119,16 @@
|
|||||||
]
|
]
|
||||||
},
|
},
|
||||||
"allow_paths": {
|
"allow_paths": {
|
||||||
"description": "Allow only these HTTP paths (full paths, including base_path); when set, all other endpoints are not registered",
|
"description": "Allow only these HTTP paths (full paths, including base_path)",
|
||||||
"type": "array",
|
"type": "array",
|
||||||
"items": {
|
"items": {
|
||||||
"type": "string"
|
"type": "string"
|
||||||
},
|
},
|
||||||
"examples": [
|
"examples": [
|
||||||
[
|
[
|
||||||
"/api/ws",
|
"/api",
|
||||||
"/api/config",
|
"/api/streams",
|
||||||
"/api/streams"
|
"/api/webrtc"
|
||||||
]
|
]
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
@@ -164,6 +177,7 @@
|
|||||||
"roborock",
|
"roborock",
|
||||||
"tapo",
|
"tapo",
|
||||||
"tuya",
|
"tuya",
|
||||||
|
"xiaomi",
|
||||||
"yandex",
|
"yandex",
|
||||||
"debug",
|
"debug",
|
||||||
"ngrok",
|
"ngrok",
|
||||||
@@ -189,13 +203,7 @@
|
|||||||
"type": "array",
|
"type": "array",
|
||||||
"items": {
|
"items": {
|
||||||
"type": "string"
|
"type": "string"
|
||||||
},
|
}
|
||||||
"examples": [
|
|
||||||
[
|
|
||||||
"ffmpeg",
|
|
||||||
"/usr/bin/ffmpeg"
|
|
||||||
]
|
|
||||||
]
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
@@ -223,6 +231,26 @@
|
|||||||
"bin": {
|
"bin": {
|
||||||
"type": "string",
|
"type": "string",
|
||||||
"default": "ffmpeg"
|
"default": "ffmpeg"
|
||||||
|
},
|
||||||
|
"global": {
|
||||||
|
"type": "string",
|
||||||
|
"default": "-hide_banner"
|
||||||
|
},
|
||||||
|
"file": {
|
||||||
|
"type": "string",
|
||||||
|
"default": "-re -i {input}"
|
||||||
|
},
|
||||||
|
"http": {
|
||||||
|
"type": "string",
|
||||||
|
"default": "-fflags nobuffer -flags low_delay -i {input}"
|
||||||
|
},
|
||||||
|
"rtsp": {
|
||||||
|
"type": "string",
|
||||||
|
"default": "-fflags nobuffer -flags low_delay -timeout 5000000 -user_agent go2rtc/ffmpeg -rtsp_flags prefer_tcp -i {input}"
|
||||||
|
},
|
||||||
|
"rtsp/udp": {
|
||||||
|
"type": "string",
|
||||||
|
"default": "-fflags nobuffer -flags low_delay -timeout 5000000 -user_agent go2rtc/ffmpeg -i {input}"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"additionalProperties": {
|
"additionalProperties": {
|
||||||
@@ -245,57 +273,62 @@
|
|||||||
"homekit": {
|
"homekit": {
|
||||||
"type": "object",
|
"type": "object",
|
||||||
"additionalProperties": {
|
"additionalProperties": {
|
||||||
"type": "object",
|
"type": [
|
||||||
"properties": {
|
"object",
|
||||||
"pin": {
|
"null"
|
||||||
"description": "HomeKit pairing PIN (will be normalized to XXX-XX-XXX); insecure PINs are rejected",
|
],
|
||||||
"type": "string",
|
"properties": {
|
||||||
"default": "19550224",
|
"pin": {
|
||||||
"anyOf": [
|
"description": "HomeKit pairing PIN",
|
||||||
{
|
"type": "string",
|
||||||
"type": "string",
|
"default": "19550224",
|
||||||
"pattern": "^[0-9]{8}$"
|
"anyOf": [
|
||||||
},
|
{
|
||||||
{
|
"type": "string",
|
||||||
"type": "string",
|
"pattern": "^[0-9]{8}$"
|
||||||
"pattern": "^[0-9]{3}-[0-9]{2}-[0-9]{3}$"
|
},
|
||||||
}
|
{
|
||||||
]
|
"type": "string",
|
||||||
},
|
"pattern": "^[0-9]{3}-[0-9]{2}-[0-9]{3}$"
|
||||||
"name": {
|
}
|
||||||
"type": "string"
|
]
|
||||||
},
|
},
|
||||||
|
"name": {
|
||||||
|
"type": "string"
|
||||||
|
},
|
||||||
"device_id": {
|
"device_id": {
|
||||||
"type": "string"
|
"type": "string"
|
||||||
},
|
},
|
||||||
"device_private": {
|
"device_private": {
|
||||||
"type": "string"
|
|
||||||
},
|
|
||||||
"category_id": {
|
|
||||||
"description": "Accessory category: \"bridge\", \"doorbell\" or numeric ID (default: camera)",
|
|
||||||
"type": "string",
|
|
||||||
"anyOf": [
|
|
||||||
{
|
|
||||||
"type": "string",
|
|
||||||
"enum": [
|
|
||||||
"bridge",
|
|
||||||
"doorbell"
|
|
||||||
]
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"type": "string",
|
|
||||||
"pattern": "^[0-9]+$"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"type": "string",
|
|
||||||
"const": ""
|
|
||||||
}
|
|
||||||
]
|
|
||||||
},
|
|
||||||
"pairings": {
|
|
||||||
"type": "array",
|
|
||||||
"items": {
|
|
||||||
"type": "string"
|
"type": "string"
|
||||||
|
},
|
||||||
|
"category_id": {
|
||||||
|
"description": "Accessory category: `bridge`, `doorbell` or numeric ID",
|
||||||
|
"type": "string",
|
||||||
|
"default": "camera",
|
||||||
|
"anyOf": [
|
||||||
|
{
|
||||||
|
"type": "string",
|
||||||
|
"enum": [
|
||||||
|
"bridge",
|
||||||
|
"camera",
|
||||||
|
"doorbell"
|
||||||
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"type": "string",
|
||||||
|
"pattern": "^[0-9]+$"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"type": "string",
|
||||||
|
"const": ""
|
||||||
|
}
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"pairings": {
|
||||||
|
"type": "array",
|
||||||
|
"items": {
|
||||||
|
"type": "string"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -366,24 +399,6 @@
|
|||||||
"api": {
|
"api": {
|
||||||
"$ref": "#/definitions/log_level"
|
"$ref": "#/definitions/log_level"
|
||||||
},
|
},
|
||||||
"alsa": {
|
|
||||||
"$ref": "#/definitions/log_level"
|
|
||||||
},
|
|
||||||
"bubble": {
|
|
||||||
"$ref": "#/definitions/log_level"
|
|
||||||
},
|
|
||||||
"debug": {
|
|
||||||
"$ref": "#/definitions/log_level"
|
|
||||||
},
|
|
||||||
"doorbird": {
|
|
||||||
"$ref": "#/definitions/log_level"
|
|
||||||
},
|
|
||||||
"dvrip": {
|
|
||||||
"$ref": "#/definitions/log_level"
|
|
||||||
},
|
|
||||||
"eseecloud": {
|
|
||||||
"$ref": "#/definitions/log_level"
|
|
||||||
},
|
|
||||||
"echo": {
|
"echo": {
|
||||||
"$ref": "#/definitions/log_level"
|
"$ref": "#/definitions/log_level"
|
||||||
},
|
},
|
||||||
@@ -399,12 +414,6 @@
|
|||||||
"default": "error",
|
"default": "error",
|
||||||
"$ref": "#/definitions/log_level"
|
"$ref": "#/definitions/log_level"
|
||||||
},
|
},
|
||||||
"flussonic": {
|
|
||||||
"$ref": "#/definitions/log_level"
|
|
||||||
},
|
|
||||||
"gopro": {
|
|
||||||
"$ref": "#/definitions/log_level"
|
|
||||||
},
|
|
||||||
"hass": {
|
"hass": {
|
||||||
"$ref": "#/definitions/log_level"
|
"$ref": "#/definitions/log_level"
|
||||||
},
|
},
|
||||||
@@ -414,63 +423,27 @@
|
|||||||
"homekit": {
|
"homekit": {
|
||||||
"$ref": "#/definitions/log_level"
|
"$ref": "#/definitions/log_level"
|
||||||
},
|
},
|
||||||
"http": {
|
|
||||||
"$ref": "#/definitions/log_level"
|
|
||||||
},
|
|
||||||
"isapi": {
|
|
||||||
"$ref": "#/definitions/log_level"
|
|
||||||
},
|
|
||||||
"ivideon": {
|
|
||||||
"$ref": "#/definitions/log_level"
|
|
||||||
},
|
|
||||||
"mjpeg": {
|
"mjpeg": {
|
||||||
"$ref": "#/definitions/log_level"
|
"$ref": "#/definitions/log_level"
|
||||||
},
|
},
|
||||||
"mpegts": {
|
|
||||||
"$ref": "#/definitions/log_level"
|
|
||||||
},
|
|
||||||
"mp4": {
|
"mp4": {
|
||||||
"$ref": "#/definitions/log_level"
|
"$ref": "#/definitions/log_level"
|
||||||
},
|
},
|
||||||
"nest": {
|
|
||||||
"$ref": "#/definitions/log_level"
|
|
||||||
},
|
|
||||||
"ngrok": {
|
"ngrok": {
|
||||||
"$ref": "#/definitions/log_level"
|
"$ref": "#/definitions/log_level"
|
||||||
},
|
},
|
||||||
"onvif": {
|
"onvif": {
|
||||||
"$ref": "#/definitions/log_level"
|
"$ref": "#/definitions/log_level"
|
||||||
},
|
},
|
||||||
"pinggy": {
|
|
||||||
"$ref": "#/definitions/log_level"
|
|
||||||
},
|
|
||||||
"ring": {
|
|
||||||
"$ref": "#/definitions/log_level"
|
|
||||||
},
|
|
||||||
"roborock": {
|
|
||||||
"$ref": "#/definitions/log_level"
|
|
||||||
},
|
|
||||||
"rtmp": {
|
"rtmp": {
|
||||||
"$ref": "#/definitions/log_level"
|
"$ref": "#/definitions/log_level"
|
||||||
},
|
},
|
||||||
"rtsp": {
|
"rtsp": {
|
||||||
"$ref": "#/definitions/log_level"
|
"$ref": "#/definitions/log_level"
|
||||||
},
|
},
|
||||||
"srtp": {
|
|
||||||
"$ref": "#/definitions/log_level"
|
|
||||||
},
|
|
||||||
"streams": {
|
"streams": {
|
||||||
"$ref": "#/definitions/log_level"
|
"$ref": "#/definitions/log_level"
|
||||||
},
|
},
|
||||||
"tapo": {
|
|
||||||
"$ref": "#/definitions/log_level"
|
|
||||||
},
|
|
||||||
"tuya": {
|
|
||||||
"$ref": "#/definitions/log_level"
|
|
||||||
},
|
|
||||||
"v4l2": {
|
|
||||||
"$ref": "#/definitions/log_level"
|
|
||||||
},
|
|
||||||
"webrtc": {
|
"webrtc": {
|
||||||
"$ref": "#/definitions/log_level"
|
"$ref": "#/definitions/log_level"
|
||||||
},
|
},
|
||||||
@@ -479,13 +452,7 @@
|
|||||||
},
|
},
|
||||||
"wyoming": {
|
"wyoming": {
|
||||||
"$ref": "#/definitions/log_level"
|
"$ref": "#/definitions/log_level"
|
||||||
},
|
|
||||||
"yandex": {
|
|
||||||
"$ref": "#/definitions/log_level"
|
|
||||||
}
|
}
|
||||||
},
|
|
||||||
"additionalProperties": {
|
|
||||||
"$ref": "#/definitions/log_level"
|
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"ngrok": {
|
"ngrok": {
|
||||||
@@ -504,17 +471,17 @@
|
|||||||
"type": "object",
|
"type": "object",
|
||||||
"properties": {
|
"properties": {
|
||||||
"tunnel": {
|
"tunnel": {
|
||||||
"description": "Expose local address via Pinggy (scheme: http/tcp/tls/tlstcp, host:port is your local address)",
|
"description": "Expose local address via Pinggy",
|
||||||
"type": "string",
|
"type": "string",
|
||||||
"examples": [
|
"examples": [
|
||||||
"http://127.0.0.1:1984",
|
"http://127.0.0.1:1984",
|
||||||
"tcp://127.0.0.1:8554"
|
"tcp://192.168.1.123:554"
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"preload": {
|
"preload": {
|
||||||
"description": "Preload streams on startup (map stream name => probe query, default \"video&audio\")",
|
"description": "Preload streams on startup (map stream name => probe query, default `video&audio`)",
|
||||||
"type": "object",
|
"type": "object",
|
||||||
"additionalProperties": {
|
"additionalProperties": {
|
||||||
"type": "string",
|
"type": "string",
|
||||||
@@ -548,10 +515,10 @@
|
|||||||
"type": "object",
|
"type": "object",
|
||||||
"properties": {
|
"properties": {
|
||||||
"listen": {
|
"listen": {
|
||||||
|
"type": "string",
|
||||||
"examples": [
|
"examples": [
|
||||||
":1935"
|
":1935"
|
||||||
],
|
]
|
||||||
"$ref": "#/definitions/listen"
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
@@ -559,8 +526,8 @@
|
|||||||
"type": "object",
|
"type": "object",
|
||||||
"properties": {
|
"properties": {
|
||||||
"listen": {
|
"listen": {
|
||||||
"default": ":8554",
|
"type": "string",
|
||||||
"$ref": "#/definitions/listen"
|
"default": ":8554"
|
||||||
},
|
},
|
||||||
"username": {
|
"username": {
|
||||||
"type": "string",
|
"type": "string",
|
||||||
@@ -585,98 +552,56 @@
|
|||||||
"type": "object",
|
"type": "object",
|
||||||
"properties": {
|
"properties": {
|
||||||
"listen": {
|
"listen": {
|
||||||
"default": ":8443",
|
"type": "string",
|
||||||
"$ref": "#/definitions/listen"
|
"default": ":8443"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"streams": {
|
"streams": {
|
||||||
"type": "object",
|
"type": "object",
|
||||||
"additionalProperties": {
|
"additionalProperties": {
|
||||||
"title": "Stream",
|
|
||||||
"anyOf": [
|
"anyOf": [
|
||||||
{
|
{
|
||||||
"description": "Source",
|
"$ref": "#/definitions/source"
|
||||||
"type": "string",
|
|
||||||
"examples": [
|
|
||||||
"rtsp://username:password@192.168.1.123/cam/realmonitor?channel=1&subtype=0&unicast=true&proto=Onvif",
|
|
||||||
"rtsp://username:password@192.168.1.123/stream1",
|
|
||||||
"rtsp://username:password@192.168.1.123/h264Preview_01_main",
|
|
||||||
"rtmp://192.168.1.123/bcs/channel0_main.bcs?channel=0&stream=0&user=username&password=password",
|
|
||||||
"http://192.168.1.123/flv?port=1935&app=bcs&stream=channel0_main.bcs&user=username&password=password",
|
|
||||||
"http://username:password@192.168.1.123/cgi-bin/snapshot.cgi?channel=1",
|
|
||||||
"ffmpeg:media.mp4#video=h264#hardware#width=1920#height=1080#rotate=180#audio=copy",
|
|
||||||
"ffmpeg:virtual?video=testsrc&size=4K#video=h264#hardware#bitrate=50M",
|
|
||||||
"bubble://username:password@192.168.1.123:34567/bubble/live?ch=0&stream=0",
|
|
||||||
"dvrip://username:password@192.168.1.123:34567?channel=0&subtype=0",
|
|
||||||
"exec:ffmpeg -re -i media.mp4 -c copy -rtsp_transport tcp -f rtsp {output}",
|
|
||||||
"isapi://username:password@192.168.1.123:80/",
|
|
||||||
"kasa://username:password@192.168.1.123:19443/https/stream/mixed",
|
|
||||||
"onvif://username:password@192.168.1.123:80?subtype=0",
|
|
||||||
"tapo://password@192.168.1.123:8800?channel=0&subtype=0",
|
|
||||||
"webtorrent:?share=xxx&pwd=xxx"
|
|
||||||
]
|
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"type": "array",
|
"type": "array",
|
||||||
"items": {
|
"items": {
|
||||||
"description": "Source",
|
"$ref": "#/definitions/source"
|
||||||
"type": "string"
|
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"type": "object",
|
"type": "null"
|
||||||
"properties": {
|
|
||||||
"url": {
|
|
||||||
"description": "Source URL or list of URLs",
|
|
||||||
"anyOf": [
|
|
||||||
{
|
|
||||||
"type": "string",
|
|
||||||
"examples": [
|
|
||||||
"rtsp://username:password@192.168.1.123/stream1",
|
|
||||||
"ffmpeg:media.mp4#video=h264#audio=copy"
|
|
||||||
]
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"type": "array",
|
|
||||||
"items": {
|
|
||||||
"type": "string"
|
|
||||||
}
|
|
||||||
}
|
|
||||||
]
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
"xiaomi": {
|
||||||
|
"type": "object",
|
||||||
|
"additionalProperties": {
|
||||||
|
"type": "string"
|
||||||
|
}
|
||||||
|
},
|
||||||
"webrtc": {
|
"webrtc": {
|
||||||
"type": "object",
|
"type": "object",
|
||||||
"properties": {
|
"properties": {
|
||||||
"listen": {
|
"listen": {
|
||||||
"default": ":8555/tcp",
|
|
||||||
"type": "string",
|
"type": "string",
|
||||||
"anyOf": [
|
"default": ":8555",
|
||||||
{
|
"examples": [
|
||||||
"type": "string",
|
":8555/udp"
|
||||||
"pattern": ":[0-9]{1,5}(/tcp|/udp)?$"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"type": "string",
|
|
||||||
"const": ""
|
|
||||||
}
|
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
"candidates": {
|
"candidates": {
|
||||||
"type": "array",
|
"type": "array",
|
||||||
"items": {
|
"items": {
|
||||||
"$ref": "#/definitions/listen/anyOf/0"
|
"type": "string",
|
||||||
},
|
"examples": [
|
||||||
"examples": [
|
"216.58.210.174:8555",
|
||||||
"216.58.210.174:8555",
|
"stun:8555",
|
||||||
"stun:8555",
|
"home.duckdns.org:8555"
|
||||||
"home.duckdns.org:8555"
|
]
|
||||||
]
|
}
|
||||||
},
|
},
|
||||||
"ice_servers": {
|
"ice_servers": {
|
||||||
"type": "array",
|
"type": "array",
|
||||||
@@ -730,13 +655,13 @@
|
|||||||
"description": "Use only these network types",
|
"description": "Use only these network types",
|
||||||
"type": "array",
|
"type": "array",
|
||||||
"items": {
|
"items": {
|
||||||
|
"type": "string",
|
||||||
"enum": [
|
"enum": [
|
||||||
"tcp4",
|
"tcp4",
|
||||||
"tcp6",
|
"tcp6",
|
||||||
"udp4",
|
"udp4",
|
||||||
"udp6"
|
"udp6"
|
||||||
],
|
]
|
||||||
"type": "string"
|
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"udp_ports": {
|
"udp_ports": {
|
||||||
@@ -784,7 +709,7 @@
|
|||||||
"properties": {
|
"properties": {
|
||||||
"listen": {
|
"listen": {
|
||||||
"description": "Listen address for Wyoming server",
|
"description": "Listen address for Wyoming server",
|
||||||
"$ref": "#/definitions/listen"
|
"type": "string"
|
||||||
},
|
},
|
||||||
"name": {
|
"name": {
|
||||||
"description": "Optional satellite name (default: stream name)",
|
"description": "Optional satellite name (default: stream name)",
|
||||||
|
|||||||
+30
-20
@@ -31,20 +31,18 @@
|
|||||||
<script src="https://cdn.jsdelivr.net/npm/js-yaml@4.1.0/dist/js-yaml.min.js"></script>
|
<script src="https://cdn.jsdelivr.net/npm/js-yaml@4.1.0/dist/js-yaml.min.js"></script>
|
||||||
<script>
|
<script>
|
||||||
/* global require, monaco */
|
/* global require, monaco */
|
||||||
const monacoVersion = '0.55.1';
|
const monacoRoot = 'https://cdn.jsdelivr.net/npm/monaco-editor@0.55.1/min';
|
||||||
const monacoRoot = `https://cdn.jsdelivr.net/npm/monaco-editor@${monacoVersion}/min`;
|
|
||||||
const monacoBase = `${monacoRoot}/vs`;
|
|
||||||
|
|
||||||
window.MonacoEnvironment = {
|
window.MonacoEnvironment = {
|
||||||
getWorkerUrl: function () {
|
getWorkerUrl: function () {
|
||||||
return `data:text/javascript;charset=utf-8,${encodeURIComponent(`
|
return `data:text/javascript;charset=utf-8,${encodeURIComponent(`
|
||||||
self.MonacoEnvironment = { baseUrl: '${monacoRoot}/' };
|
self.MonacoEnvironment = { baseUrl: '${monacoRoot}/' };
|
||||||
importScripts('${monacoBase}/base/worker/workerMain.js');
|
importScripts('${monacoRoot}/vs/base/worker/workerMain.js');
|
||||||
`)}`;
|
`)}`;
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
require.config({ paths: { vs: monacoBase } });
|
require.config({paths: {vs: `${monacoRoot}/vs`}});
|
||||||
|
|
||||||
require(['vs/editor/editor.main'], () => {
|
require(['vs/editor/editor.main'], () => {
|
||||||
const container = document.getElementById('config');
|
const container = document.getElementById('config');
|
||||||
@@ -122,25 +120,17 @@
|
|||||||
|
|
||||||
const editor = monaco.editor.create(container, {
|
const editor = monaco.editor.create(container, {
|
||||||
language: 'yaml',
|
language: 'yaml',
|
||||||
minimap: { enabled: false },
|
minimap: {enabled: false},
|
||||||
automaticLayout: true,
|
automaticLayout: true,
|
||||||
tabSize: 2,
|
tabSize: 2,
|
||||||
insertSpaces: true,
|
insertSpaces: true,
|
||||||
quickSuggestions: { other: true, comments: false, strings: true },
|
quickSuggestions: {other: true, comments: false, strings: true},
|
||||||
suggestOnTriggerCharacters: true,
|
suggestOnTriggerCharacters: true,
|
||||||
wordBasedSuggestions: false,
|
wordBasedSuggestions: false,
|
||||||
suggest: { showWords: false },
|
suggest: {showWords: false},
|
||||||
scrollBeyondLastLine: false,
|
scrollBeyondLastLine: false,
|
||||||
});
|
});
|
||||||
|
|
||||||
const layout = () => {
|
|
||||||
const top = container.getBoundingClientRect().top;
|
|
||||||
container.style.height = `${Math.max(200, window.innerHeight - top)}px`;
|
|
||||||
editor.layout();
|
|
||||||
};
|
|
||||||
window.addEventListener('resize', layout);
|
|
||||||
layout();
|
|
||||||
|
|
||||||
const stripInlineComment = (line) => {
|
const stripInlineComment = (line) => {
|
||||||
let inSingle = false;
|
let inSingle = false;
|
||||||
let inDouble = false;
|
let inDouble = false;
|
||||||
@@ -279,7 +269,18 @@
|
|||||||
const isContainer = after.trim() === '' || after.trim().startsWith('#');
|
const isContainer = after.trim() === '' || after.trim().startsWith('#');
|
||||||
const valueStartIndex = colonIndex + 1;
|
const valueStartIndex = colonIndex + 1;
|
||||||
|
|
||||||
return {indent, key, rawKey, isQuoted, isContainer, after, keyStartIndex, keyEndIndex, colonIndex, valueStartIndex};
|
return {
|
||||||
|
indent,
|
||||||
|
key,
|
||||||
|
rawKey,
|
||||||
|
isQuoted,
|
||||||
|
isContainer,
|
||||||
|
after,
|
||||||
|
keyStartIndex,
|
||||||
|
keyEndIndex,
|
||||||
|
colonIndex,
|
||||||
|
valueStartIndex
|
||||||
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
const unique = (arr) => [...new Set(arr)];
|
const unique = (arr) => [...new Set(arr)];
|
||||||
@@ -754,8 +755,9 @@
|
|||||||
blockScalarParentIndent = null;
|
blockScalarParentIndent = null;
|
||||||
} else {
|
} else {
|
||||||
continue; // treat as block scalar content
|
continue; // treat as block scalar content
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (indent === 0 && (hasTopLevelKey || hasTopLevelList)) {
|
if (indent === 0 && (hasTopLevelKey || hasTopLevelList)) {
|
||||||
const trimmed = line.trim();
|
const trimmed = line.trim();
|
||||||
if (trimmed !== '---' && trimmed !== '...' && !trimmed.startsWith('#')) {
|
if (trimmed !== '---' && trimmed !== '...' && !trimmed.startsWith('#')) {
|
||||||
@@ -1169,6 +1171,14 @@
|
|||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
|
||||||
|
const layout = () => {
|
||||||
|
const top = container.getBoundingClientRect().top;
|
||||||
|
container.style.height = `${Math.max(200, window.innerHeight - top)}px`;
|
||||||
|
editor.layout();
|
||||||
|
};
|
||||||
|
window.addEventListener('resize', layout);
|
||||||
|
layout();
|
||||||
|
|
||||||
let dump;
|
let dump;
|
||||||
|
|
||||||
document.getElementById('save').addEventListener('click', async () => {
|
document.getElementById('save').addEventListener('click', async () => {
|
||||||
@@ -1190,8 +1200,8 @@
|
|||||||
|
|
||||||
(async () => {
|
(async () => {
|
||||||
try {
|
try {
|
||||||
const schemaRes = await fetch('schema.json', {cache: 'no-cache'});
|
const r = await fetch('https://go2rtc.org/schema.json', {cache: 'no-cache'});
|
||||||
if (schemaRes.ok) setupYamlHints(await schemaRes.json());
|
if (r.ok) setupYamlHints(await r.json());
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
// ignore schema load errors
|
// ignore schema load errors
|
||||||
}
|
}
|
||||||
|
|||||||
-824
@@ -1,824 +0,0 @@
|
|||||||
{
|
|
||||||
"$schema": "http://json-schema.org/draft-07/schema#",
|
|
||||||
"title": "go2rtc",
|
|
||||||
"type": "object",
|
|
||||||
"additionalProperties": false,
|
|
||||||
"definitions": {
|
|
||||||
"listen": {
|
|
||||||
"type": "string",
|
|
||||||
"anyOf": [
|
|
||||||
{
|
|
||||||
"type": "string",
|
|
||||||
"pattern": ":[0-9]{1,5}$"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"type": "string",
|
|
||||||
"const": ""
|
|
||||||
}
|
|
||||||
]
|
|
||||||
},
|
|
||||||
"log_level": {
|
|
||||||
"type": "string",
|
|
||||||
"enum": [
|
|
||||||
"trace",
|
|
||||||
"debug",
|
|
||||||
"info",
|
|
||||||
"warn",
|
|
||||||
"error",
|
|
||||||
"fatal",
|
|
||||||
"panic",
|
|
||||||
"disabled"
|
|
||||||
]
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"properties": {
|
|
||||||
"api": {
|
|
||||||
"type": "object",
|
|
||||||
"properties": {
|
|
||||||
"listen": {
|
|
||||||
"default": ":1984",
|
|
||||||
"examples": [
|
|
||||||
"127.0.0.1:8080"
|
|
||||||
],
|
|
||||||
"$ref": "#/definitions/listen"
|
|
||||||
},
|
|
||||||
"username": {
|
|
||||||
"type": "string",
|
|
||||||
"examples": [
|
|
||||||
"admin"
|
|
||||||
]
|
|
||||||
},
|
|
||||||
"password": {
|
|
||||||
"type": "string"
|
|
||||||
},
|
|
||||||
"local_auth": {
|
|
||||||
"description": "Allow auth from local network without credentials (uses existing Auth header)",
|
|
||||||
"type": "boolean",
|
|
||||||
"default": false
|
|
||||||
},
|
|
||||||
"base_path": {
|
|
||||||
"type": "string",
|
|
||||||
"examples": [
|
|
||||||
"/go2rtc"
|
|
||||||
]
|
|
||||||
},
|
|
||||||
"static_dir": {
|
|
||||||
"type": "string",
|
|
||||||
"examples": [
|
|
||||||
"/var/www"
|
|
||||||
]
|
|
||||||
},
|
|
||||||
"origin": {
|
|
||||||
"description": "Set to \"*\" to enable CORS and allow any Origin",
|
|
||||||
"type": "string",
|
|
||||||
"anyOf": [
|
|
||||||
{
|
|
||||||
"type": "string",
|
|
||||||
"const": "*"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"type": "string",
|
|
||||||
"const": ""
|
|
||||||
}
|
|
||||||
]
|
|
||||||
},
|
|
||||||
"tls_listen": {
|
|
||||||
"$ref": "#/definitions/listen"
|
|
||||||
},
|
|
||||||
"tls_cert": {
|
|
||||||
"type": "string",
|
|
||||||
"examples": [
|
|
||||||
"-----BEGIN CERTIFICATE-----",
|
|
||||||
"/ssl/fullchain.pem"
|
|
||||||
]
|
|
||||||
},
|
|
||||||
"tls_key": {
|
|
||||||
"type": "string",
|
|
||||||
"examples": [
|
|
||||||
"-----BEGIN PRIVATE KEY-----",
|
|
||||||
"/ssl/privkey.pem"
|
|
||||||
]
|
|
||||||
},
|
|
||||||
"unix_listen": {
|
|
||||||
"type": "string",
|
|
||||||
"examples": [
|
|
||||||
"/tmp/go2rtc.sock"
|
|
||||||
]
|
|
||||||
},
|
|
||||||
"allow_paths": {
|
|
||||||
"description": "Allow only these HTTP paths (full paths, including base_path); when set, all other endpoints are not registered",
|
|
||||||
"type": "array",
|
|
||||||
"items": {
|
|
||||||
"type": "string"
|
|
||||||
},
|
|
||||||
"examples": [
|
|
||||||
[
|
|
||||||
"/api/ws",
|
|
||||||
"/api/config",
|
|
||||||
"/api/streams"
|
|
||||||
]
|
|
||||||
]
|
|
||||||
}
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"app": {
|
|
||||||
"type": "object",
|
|
||||||
"properties": {
|
|
||||||
"modules": {
|
|
||||||
"description": "Enable only these modules (empty / omitted means all)",
|
|
||||||
"type": "array",
|
|
||||||
"items": {
|
|
||||||
"type": "string",
|
|
||||||
"enum": [
|
|
||||||
"api",
|
|
||||||
"ws",
|
|
||||||
"http",
|
|
||||||
"rtsp",
|
|
||||||
"webrtc",
|
|
||||||
"mp4",
|
|
||||||
"hls",
|
|
||||||
"mjpeg",
|
|
||||||
"hass",
|
|
||||||
"homekit",
|
|
||||||
"onvif",
|
|
||||||
"rtmp",
|
|
||||||
"webtorrent",
|
|
||||||
"wyoming",
|
|
||||||
"echo",
|
|
||||||
"exec",
|
|
||||||
"expr",
|
|
||||||
"ffmpeg",
|
|
||||||
"alsa",
|
|
||||||
"v4l2",
|
|
||||||
"bubble",
|
|
||||||
"doorbird",
|
|
||||||
"dvrip",
|
|
||||||
"eseecloud",
|
|
||||||
"flussonic",
|
|
||||||
"gopro",
|
|
||||||
"isapi",
|
|
||||||
"ivideon",
|
|
||||||
"mpegts",
|
|
||||||
"nest",
|
|
||||||
"ring",
|
|
||||||
"roborock",
|
|
||||||
"tapo",
|
|
||||||
"tuya",
|
|
||||||
"yandex",
|
|
||||||
"debug",
|
|
||||||
"ngrok",
|
|
||||||
"pinggy",
|
|
||||||
"srtp"
|
|
||||||
]
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"env": {
|
|
||||||
"description": "Config variables that can be referenced as ${NAME} / ${NAME:default}",
|
|
||||||
"type": "object",
|
|
||||||
"additionalProperties": {
|
|
||||||
"type": "string"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"echo": {
|
|
||||||
"type": "object",
|
|
||||||
"properties": {
|
|
||||||
"allow_paths": {
|
|
||||||
"description": "Allow only these binaries for echo: URLs (exact cmd name/path)",
|
|
||||||
"type": "array",
|
|
||||||
"items": {
|
|
||||||
"type": "string"
|
|
||||||
},
|
|
||||||
"examples": [
|
|
||||||
[
|
|
||||||
"ffmpeg",
|
|
||||||
"/usr/bin/ffmpeg"
|
|
||||||
]
|
|
||||||
]
|
|
||||||
}
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"exec": {
|
|
||||||
"type": "object",
|
|
||||||
"properties": {
|
|
||||||
"allow_paths": {
|
|
||||||
"description": "Allow only these binaries for exec: URLs (exact cmd name/path)",
|
|
||||||
"type": "array",
|
|
||||||
"items": {
|
|
||||||
"type": "string"
|
|
||||||
},
|
|
||||||
"examples": [
|
|
||||||
[
|
|
||||||
"ffmpeg",
|
|
||||||
"/usr/bin/ffmpeg"
|
|
||||||
]
|
|
||||||
]
|
|
||||||
}
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"ffmpeg": {
|
|
||||||
"type": "object",
|
|
||||||
"properties": {
|
|
||||||
"bin": {
|
|
||||||
"type": "string",
|
|
||||||
"default": "ffmpeg"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"additionalProperties": {
|
|
||||||
"description": "FFmpeg template",
|
|
||||||
"type": "string"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"hass": {
|
|
||||||
"type": "object",
|
|
||||||
"properties": {
|
|
||||||
"config": {
|
|
||||||
"description": "Home Assistant config directory path",
|
|
||||||
"type": "string",
|
|
||||||
"examples": [
|
|
||||||
"/config"
|
|
||||||
]
|
|
||||||
}
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"homekit": {
|
|
||||||
"type": "object",
|
|
||||||
"additionalProperties": {
|
|
||||||
"type": "object",
|
|
||||||
"properties": {
|
|
||||||
"pin": {
|
|
||||||
"description": "HomeKit pairing PIN (will be normalized to XXX-XX-XXX); insecure PINs are rejected",
|
|
||||||
"type": "string",
|
|
||||||
"default": "19550224",
|
|
||||||
"anyOf": [
|
|
||||||
{
|
|
||||||
"type": "string",
|
|
||||||
"pattern": "^[0-9]{8}$"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"type": "string",
|
|
||||||
"pattern": "^[0-9]{3}-[0-9]{2}-[0-9]{3}$"
|
|
||||||
}
|
|
||||||
]
|
|
||||||
},
|
|
||||||
"name": {
|
|
||||||
"type": "string"
|
|
||||||
},
|
|
||||||
"device_id": {
|
|
||||||
"type": "string"
|
|
||||||
},
|
|
||||||
"device_private": {
|
|
||||||
"type": "string"
|
|
||||||
},
|
|
||||||
"category_id": {
|
|
||||||
"description": "Accessory category: \"bridge\", \"doorbell\" or numeric ID (default: camera)",
|
|
||||||
"type": "string",
|
|
||||||
"anyOf": [
|
|
||||||
{
|
|
||||||
"type": "string",
|
|
||||||
"enum": [
|
|
||||||
"bridge",
|
|
||||||
"doorbell"
|
|
||||||
]
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"type": "string",
|
|
||||||
"pattern": "^[0-9]+$"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"type": "string",
|
|
||||||
"const": ""
|
|
||||||
}
|
|
||||||
]
|
|
||||||
},
|
|
||||||
"pairings": {
|
|
||||||
"type": "array",
|
|
||||||
"items": {
|
|
||||||
"type": "string"
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"log": {
|
|
||||||
"type": "object",
|
|
||||||
"properties": {
|
|
||||||
"format": {
|
|
||||||
"description": "Log format: color/json/text or empty for autodetect",
|
|
||||||
"type": "string",
|
|
||||||
"default": "color",
|
|
||||||
"enum": [
|
|
||||||
"",
|
|
||||||
"color",
|
|
||||||
"json",
|
|
||||||
"text"
|
|
||||||
]
|
|
||||||
},
|
|
||||||
"level": {
|
|
||||||
"description": "Defaul log level",
|
|
||||||
"default": "info",
|
|
||||||
"$ref": "#/definitions/log_level"
|
|
||||||
},
|
|
||||||
"output": {
|
|
||||||
"description": "Log output: stdout/stderr/file[:path] or empty (memory only)",
|
|
||||||
"type": "string",
|
|
||||||
"default": "stdout",
|
|
||||||
"anyOf": [
|
|
||||||
{
|
|
||||||
"type": "string",
|
|
||||||
"enum": [
|
|
||||||
"",
|
|
||||||
"stdout",
|
|
||||||
"stderr"
|
|
||||||
]
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"type": "string",
|
|
||||||
"pattern": "^file(:.+)?$",
|
|
||||||
"examples": [
|
|
||||||
"file",
|
|
||||||
"file:go2rtc.log"
|
|
||||||
]
|
|
||||||
}
|
|
||||||
]
|
|
||||||
},
|
|
||||||
"time": {
|
|
||||||
"type": "string",
|
|
||||||
"default": "UNIXMS",
|
|
||||||
"anyOf": [
|
|
||||||
{
|
|
||||||
"type": "string",
|
|
||||||
"enum": [
|
|
||||||
"",
|
|
||||||
"UNIXMS",
|
|
||||||
"UNIXMICRO",
|
|
||||||
"UNIXNANO",
|
|
||||||
"2006-01-02T15:04:05Z07:00",
|
|
||||||
"2006-01-02T15:04:05.999999999Z07:00"
|
|
||||||
]
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"type": "string"
|
|
||||||
}
|
|
||||||
]
|
|
||||||
},
|
|
||||||
"api": {
|
|
||||||
"$ref": "#/definitions/log_level"
|
|
||||||
},
|
|
||||||
"alsa": {
|
|
||||||
"$ref": "#/definitions/log_level"
|
|
||||||
},
|
|
||||||
"bubble": {
|
|
||||||
"$ref": "#/definitions/log_level"
|
|
||||||
},
|
|
||||||
"debug": {
|
|
||||||
"$ref": "#/definitions/log_level"
|
|
||||||
},
|
|
||||||
"doorbird": {
|
|
||||||
"$ref": "#/definitions/log_level"
|
|
||||||
},
|
|
||||||
"dvrip": {
|
|
||||||
"$ref": "#/definitions/log_level"
|
|
||||||
},
|
|
||||||
"eseecloud": {
|
|
||||||
"$ref": "#/definitions/log_level"
|
|
||||||
},
|
|
||||||
"echo": {
|
|
||||||
"$ref": "#/definitions/log_level"
|
|
||||||
},
|
|
||||||
"exec": {
|
|
||||||
"description": "Value `exec: debug` will print stderr",
|
|
||||||
"$ref": "#/definitions/log_level"
|
|
||||||
},
|
|
||||||
"expr": {
|
|
||||||
"$ref": "#/definitions/log_level"
|
|
||||||
},
|
|
||||||
"ffmpeg": {
|
|
||||||
"description": "Will only be displayed with `exec: debug` setting",
|
|
||||||
"default": "error",
|
|
||||||
"$ref": "#/definitions/log_level"
|
|
||||||
},
|
|
||||||
"flussonic": {
|
|
||||||
"$ref": "#/definitions/log_level"
|
|
||||||
},
|
|
||||||
"gopro": {
|
|
||||||
"$ref": "#/definitions/log_level"
|
|
||||||
},
|
|
||||||
"hass": {
|
|
||||||
"$ref": "#/definitions/log_level"
|
|
||||||
},
|
|
||||||
"hls": {
|
|
||||||
"$ref": "#/definitions/log_level"
|
|
||||||
},
|
|
||||||
"homekit": {
|
|
||||||
"$ref": "#/definitions/log_level"
|
|
||||||
},
|
|
||||||
"http": {
|
|
||||||
"$ref": "#/definitions/log_level"
|
|
||||||
},
|
|
||||||
"isapi": {
|
|
||||||
"$ref": "#/definitions/log_level"
|
|
||||||
},
|
|
||||||
"ivideon": {
|
|
||||||
"$ref": "#/definitions/log_level"
|
|
||||||
},
|
|
||||||
"mjpeg": {
|
|
||||||
"$ref": "#/definitions/log_level"
|
|
||||||
},
|
|
||||||
"mpegts": {
|
|
||||||
"$ref": "#/definitions/log_level"
|
|
||||||
},
|
|
||||||
"mp4": {
|
|
||||||
"$ref": "#/definitions/log_level"
|
|
||||||
},
|
|
||||||
"nest": {
|
|
||||||
"$ref": "#/definitions/log_level"
|
|
||||||
},
|
|
||||||
"ngrok": {
|
|
||||||
"$ref": "#/definitions/log_level"
|
|
||||||
},
|
|
||||||
"onvif": {
|
|
||||||
"$ref": "#/definitions/log_level"
|
|
||||||
},
|
|
||||||
"pinggy": {
|
|
||||||
"$ref": "#/definitions/log_level"
|
|
||||||
},
|
|
||||||
"ring": {
|
|
||||||
"$ref": "#/definitions/log_level"
|
|
||||||
},
|
|
||||||
"roborock": {
|
|
||||||
"$ref": "#/definitions/log_level"
|
|
||||||
},
|
|
||||||
"rtmp": {
|
|
||||||
"$ref": "#/definitions/log_level"
|
|
||||||
},
|
|
||||||
"rtsp": {
|
|
||||||
"$ref": "#/definitions/log_level"
|
|
||||||
},
|
|
||||||
"srtp": {
|
|
||||||
"$ref": "#/definitions/log_level"
|
|
||||||
},
|
|
||||||
"streams": {
|
|
||||||
"$ref": "#/definitions/log_level"
|
|
||||||
},
|
|
||||||
"tapo": {
|
|
||||||
"$ref": "#/definitions/log_level"
|
|
||||||
},
|
|
||||||
"tuya": {
|
|
||||||
"$ref": "#/definitions/log_level"
|
|
||||||
},
|
|
||||||
"v4l2": {
|
|
||||||
"$ref": "#/definitions/log_level"
|
|
||||||
},
|
|
||||||
"webrtc": {
|
|
||||||
"$ref": "#/definitions/log_level"
|
|
||||||
},
|
|
||||||
"webtorrent": {
|
|
||||||
"$ref": "#/definitions/log_level"
|
|
||||||
},
|
|
||||||
"wyoming": {
|
|
||||||
"$ref": "#/definitions/log_level"
|
|
||||||
},
|
|
||||||
"yandex": {
|
|
||||||
"$ref": "#/definitions/log_level"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"additionalProperties": {
|
|
||||||
"$ref": "#/definitions/log_level"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"ngrok": {
|
|
||||||
"type": "object",
|
|
||||||
"properties": {
|
|
||||||
"command": {
|
|
||||||
"type": "string",
|
|
||||||
"examples": [
|
|
||||||
"ngrok tcp 8555 --authtoken xxx",
|
|
||||||
"ngrok start --all --config ngrok.yaml"
|
|
||||||
]
|
|
||||||
}
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"pinggy": {
|
|
||||||
"type": "object",
|
|
||||||
"properties": {
|
|
||||||
"tunnel": {
|
|
||||||
"description": "Expose local address via Pinggy (scheme: http/tcp/tls/tlstcp, host:port is your local address)",
|
|
||||||
"type": "string",
|
|
||||||
"examples": [
|
|
||||||
"http://127.0.0.1:1984",
|
|
||||||
"tcp://127.0.0.1:8554"
|
|
||||||
]
|
|
||||||
}
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"preload": {
|
|
||||||
"description": "Preload streams on startup (map stream name => probe query, default \"video&audio\")",
|
|
||||||
"type": "object",
|
|
||||||
"additionalProperties": {
|
|
||||||
"type": "string",
|
|
||||||
"examples": [
|
|
||||||
"video&audio",
|
|
||||||
"video"
|
|
||||||
]
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"publish": {
|
|
||||||
"type": "object",
|
|
||||||
"additionalProperties": {
|
|
||||||
"anyOf": [
|
|
||||||
{
|
|
||||||
"type": "string",
|
|
||||||
"examples": [
|
|
||||||
"rtmp://xxx.rtmp.youtube.com/live2/xxxx-xxxx-xxxx-xxxx-xxxx",
|
|
||||||
"rtmps://xxx-x.rtmp.t.me/s/xxxxxxxxxx:xxxxxxxxxxxxxxxxxxxxxx"
|
|
||||||
]
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"type": "array",
|
|
||||||
"items": {
|
|
||||||
"type": "string"
|
|
||||||
}
|
|
||||||
}
|
|
||||||
]
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"rtmp": {
|
|
||||||
"type": "object",
|
|
||||||
"properties": {
|
|
||||||
"listen": {
|
|
||||||
"examples": [
|
|
||||||
":1935"
|
|
||||||
],
|
|
||||||
"$ref": "#/definitions/listen"
|
|
||||||
}
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"rtsp": {
|
|
||||||
"type": "object",
|
|
||||||
"properties": {
|
|
||||||
"listen": {
|
|
||||||
"default": ":8554",
|
|
||||||
"$ref": "#/definitions/listen"
|
|
||||||
},
|
|
||||||
"username": {
|
|
||||||
"type": "string",
|
|
||||||
"examples": [
|
|
||||||
"admin"
|
|
||||||
]
|
|
||||||
},
|
|
||||||
"password": {
|
|
||||||
"type": "string"
|
|
||||||
},
|
|
||||||
"default_query": {
|
|
||||||
"type": "string",
|
|
||||||
"default": "video&audio"
|
|
||||||
},
|
|
||||||
"pkt_size": {
|
|
||||||
"type": "integer"
|
|
||||||
}
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"srtp": {
|
|
||||||
"description": "SRTP server for HomeKit",
|
|
||||||
"type": "object",
|
|
||||||
"properties": {
|
|
||||||
"listen": {
|
|
||||||
"default": ":8443",
|
|
||||||
"$ref": "#/definitions/listen"
|
|
||||||
}
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"streams": {
|
|
||||||
"type": "object",
|
|
||||||
"additionalProperties": {
|
|
||||||
"title": "Stream",
|
|
||||||
"anyOf": [
|
|
||||||
{
|
|
||||||
"description": "Source",
|
|
||||||
"type": "string",
|
|
||||||
"examples": [
|
|
||||||
"rtsp://username:password@192.168.1.123/cam/realmonitor?channel=1&subtype=0&unicast=true&proto=Onvif",
|
|
||||||
"rtsp://username:password@192.168.1.123/stream1",
|
|
||||||
"rtsp://username:password@192.168.1.123/h264Preview_01_main",
|
|
||||||
"rtmp://192.168.1.123/bcs/channel0_main.bcs?channel=0&stream=0&user=username&password=password",
|
|
||||||
"http://192.168.1.123/flv?port=1935&app=bcs&stream=channel0_main.bcs&user=username&password=password",
|
|
||||||
"http://username:password@192.168.1.123/cgi-bin/snapshot.cgi?channel=1",
|
|
||||||
"ffmpeg:media.mp4#video=h264#hardware#width=1920#height=1080#rotate=180#audio=copy",
|
|
||||||
"ffmpeg:virtual?video=testsrc&size=4K#video=h264#hardware#bitrate=50M",
|
|
||||||
"bubble://username:password@192.168.1.123:34567/bubble/live?ch=0&stream=0",
|
|
||||||
"dvrip://username:password@192.168.1.123:34567?channel=0&subtype=0",
|
|
||||||
"exec:ffmpeg -re -i media.mp4 -c copy -rtsp_transport tcp -f rtsp {output}",
|
|
||||||
"isapi://username:password@192.168.1.123:80/",
|
|
||||||
"kasa://username:password@192.168.1.123:19443/https/stream/mixed",
|
|
||||||
"onvif://username:password@192.168.1.123:80?subtype=0",
|
|
||||||
"tapo://password@192.168.1.123:8800?channel=0&subtype=0",
|
|
||||||
"webtorrent:?share=xxx&pwd=xxx"
|
|
||||||
]
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"type": "array",
|
|
||||||
"items": {
|
|
||||||
"description": "Source",
|
|
||||||
"type": "string"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"type": "object",
|
|
||||||
"properties": {
|
|
||||||
"url": {
|
|
||||||
"description": "Source URL or list of URLs",
|
|
||||||
"anyOf": [
|
|
||||||
{
|
|
||||||
"type": "string",
|
|
||||||
"examples": [
|
|
||||||
"rtsp://username:password@192.168.1.123/stream1",
|
|
||||||
"ffmpeg:media.mp4#video=h264#audio=copy"
|
|
||||||
]
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"type": "array",
|
|
||||||
"items": {
|
|
||||||
"type": "string"
|
|
||||||
}
|
|
||||||
}
|
|
||||||
]
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
]
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"webrtc": {
|
|
||||||
"type": "object",
|
|
||||||
"properties": {
|
|
||||||
"listen": {
|
|
||||||
"default": ":8555/tcp",
|
|
||||||
"type": "string",
|
|
||||||
"anyOf": [
|
|
||||||
{
|
|
||||||
"type": "string",
|
|
||||||
"pattern": ":[0-9]{1,5}(/tcp|/udp)?$"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"type": "string",
|
|
||||||
"const": ""
|
|
||||||
}
|
|
||||||
]
|
|
||||||
},
|
|
||||||
"candidates": {
|
|
||||||
"type": "array",
|
|
||||||
"items": {
|
|
||||||
"$ref": "#/definitions/listen/anyOf/0"
|
|
||||||
},
|
|
||||||
"examples": [
|
|
||||||
"216.58.210.174:8555",
|
|
||||||
"stun:8555",
|
|
||||||
"home.duckdns.org:8555"
|
|
||||||
]
|
|
||||||
},
|
|
||||||
"ice_servers": {
|
|
||||||
"type": "array",
|
|
||||||
"items": {
|
|
||||||
"type": "object",
|
|
||||||
"properties": {
|
|
||||||
"urls": {
|
|
||||||
"type": "array",
|
|
||||||
"items": {
|
|
||||||
"type": "string",
|
|
||||||
"examples": [
|
|
||||||
"stun:stun.l.google.com:19302",
|
|
||||||
"turn:123.123.123.123:3478"
|
|
||||||
]
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"username": {
|
|
||||||
"type": "string"
|
|
||||||
},
|
|
||||||
"credential": {
|
|
||||||
"type": "string"
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"filters": {
|
|
||||||
"type": "object",
|
|
||||||
"properties": {
|
|
||||||
"candidates": {
|
|
||||||
"description": "Keep only these candidates",
|
|
||||||
"type": "array",
|
|
||||||
"items": {
|
|
||||||
"type": "string"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"interfaces": {
|
|
||||||
"description": "Keep only these interfaces",
|
|
||||||
"type": "array",
|
|
||||||
"items": {
|
|
||||||
"type": "string"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"ips": {
|
|
||||||
"description": "Keep only these IP-addresses",
|
|
||||||
"type": "array",
|
|
||||||
"items": {
|
|
||||||
"type": "string"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"networks": {
|
|
||||||
"description": "Use only these network types",
|
|
||||||
"type": "array",
|
|
||||||
"items": {
|
|
||||||
"enum": [
|
|
||||||
"tcp4",
|
|
||||||
"tcp6",
|
|
||||||
"udp4",
|
|
||||||
"udp6"
|
|
||||||
],
|
|
||||||
"type": "string"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"udp_ports": {
|
|
||||||
"description": "Use only these UDP ports range [min, max]",
|
|
||||||
"type": "array",
|
|
||||||
"items": {
|
|
||||||
"type": "integer"
|
|
||||||
},
|
|
||||||
"maxItems": 2,
|
|
||||||
"minItems": 2
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"webtorrent": {
|
|
||||||
"type": "object",
|
|
||||||
"properties": {
|
|
||||||
"trackers": {
|
|
||||||
"type": "array",
|
|
||||||
"items": {
|
|
||||||
"type": "string"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"shares": {
|
|
||||||
"additionalProperties": {
|
|
||||||
"type": "object",
|
|
||||||
"properties": {
|
|
||||||
"pwd": {
|
|
||||||
"type": "string",
|
|
||||||
"minLength": 4
|
|
||||||
},
|
|
||||||
"src": {
|
|
||||||
"type": "string"
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"wyoming": {
|
|
||||||
"type": "object",
|
|
||||||
"additionalProperties": {
|
|
||||||
"type": "object",
|
|
||||||
"properties": {
|
|
||||||
"listen": {
|
|
||||||
"description": "Listen address for Wyoming server",
|
|
||||||
"$ref": "#/definitions/listen"
|
|
||||||
},
|
|
||||||
"name": {
|
|
||||||
"description": "Optional satellite name (default: stream name)",
|
|
||||||
"type": "string"
|
|
||||||
},
|
|
||||||
"mode": {
|
|
||||||
"description": "Optional mode: mic / snd / default",
|
|
||||||
"type": "string",
|
|
||||||
"enum": [
|
|
||||||
"",
|
|
||||||
"mic",
|
|
||||||
"snd"
|
|
||||||
]
|
|
||||||
},
|
|
||||||
"event": {
|
|
||||||
"description": "Event handlers (map event type => expr script)",
|
|
||||||
"type": "object",
|
|
||||||
"additionalProperties": {
|
|
||||||
"type": "string"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"wake_uri": {
|
|
||||||
"description": "Optional WAKE service URI (ex. tcp://host:port?name=...)",
|
|
||||||
"type": "string",
|
|
||||||
"examples": [
|
|
||||||
"tcp://192.168.1.23:10400"
|
|
||||||
]
|
|
||||||
},
|
|
||||||
"vad_threshold": {
|
|
||||||
"description": "Optional VAD threshold (0.1..3.5 typical)",
|
|
||||||
"type": "number"
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -4,5 +4,4 @@ import "embed"
|
|||||||
|
|
||||||
//go:embed *.html
|
//go:embed *.html
|
||||||
//go:embed *.js
|
//go:embed *.js
|
||||||
//go:embed *.json
|
|
||||||
var Static embed.FS
|
var Static embed.FS
|
||||||
|
|||||||
Reference in New Issue
Block a user