first commit
commit
4c3d41e7c9
@ -0,0 +1,16 @@
|
|||||||
|
|
||||||
|
|
||||||
|
include $(TOPDIR)/rules.mk
|
||||||
|
|
||||||
|
|
||||||
|
LUCI_TITLE:=LuCI support for frigate
|
||||||
|
LUCI_PKGARCH:=all
|
||||||
|
LUCI_DEPENDS:=+lsblk +docker +luci-lib-taskd +yq
|
||||||
|
|
||||||
|
define Package/luci-app-frigate/conffiles
|
||||||
|
/etc/config/frigate
|
||||||
|
endef
|
||||||
|
|
||||||
|
include $(TOPDIR)/feeds/luci/luci.mk
|
||||||
|
|
||||||
|
# call BuildPackage - OpenWrt buildroot signature
|
@ -0,0 +1,15 @@
|
|||||||
|
|
||||||
|
module("luci.controller.frigate", package.seeall)
|
||||||
|
|
||||||
|
function index()
|
||||||
|
entry({"admin", "apps"}, firstchild(), _("Apps") , 45).dependent = false
|
||||||
|
if not nixio.fs.access("/etc/config/frigate") then
|
||||||
|
return
|
||||||
|
end
|
||||||
|
|
||||||
|
local page = entry({"admin", "apps", "frigate"}, cbi("frigate"), _("frigate"))
|
||||||
|
page.order = 10
|
||||||
|
page.dependent = true
|
||||||
|
page.acl_depends = { "luci-app-frigate" }
|
||||||
|
entry({"admin","apps","frigate","status"},call("act_status")).leaf=true
|
||||||
|
end
|
@ -0,0 +1,75 @@
|
|||||||
|
--[[
|
||||||
|
LuCI - Lua Configuration Interface
|
||||||
|
]]--
|
||||||
|
|
||||||
|
local taskd = require "luci.model.tasks"
|
||||||
|
local frigate_model = require "luci.model.frigate"
|
||||||
|
local m, s, o
|
||||||
|
|
||||||
|
m = taskd.docker_map("frigate", "Frigate NVR", "/usr/libexec/apps/frigate/frigate.sh",
|
||||||
|
translate("Frigate"),
|
||||||
|
translate("Frigate is an open-source NVR built around real-time AI object detection. All processing is performed locally on your own hardware.")
|
||||||
|
.. translate("Official website:") .. ' <a href=\"https://frigate.video/\" target=\"_blank\">https://frigate.video/</a>')
|
||||||
|
|
||||||
|
s = m:section(SimpleSection, translate("Service Status"), translate("frigate status:"))
|
||||||
|
s:append(Template("frigate/status"))
|
||||||
|
|
||||||
|
-- General Frigate Docker setup
|
||||||
|
s = m:section(TypedSection, "frigate_config", "Docker Configuration", "General settings for Docker")
|
||||||
|
s.addremove = false
|
||||||
|
s.anonymous = true
|
||||||
|
|
||||||
|
o = s:option(Value, "port", "Port")
|
||||||
|
o.default = "5000"
|
||||||
|
|
||||||
|
o = s:option(Value, "image", "Image")
|
||||||
|
o.default = "ghcr.io/blakeblackshear/frigate:stable"
|
||||||
|
|
||||||
|
o = s:option(Value, "usbcoral", "USB Coral")
|
||||||
|
o.default = "/dev/bus/usb"
|
||||||
|
|
||||||
|
o = s:option(Value, "hwaccel", "Hardware Acceleration")
|
||||||
|
o.default = "/dev/crypto"
|
||||||
|
|
||||||
|
o = s:option(Value, "storage", "Storage Path")
|
||||||
|
o.default = "./frigate/storage"
|
||||||
|
|
||||||
|
-- MQTT Configuration
|
||||||
|
s = m:section(TypedSection, "frigate_config", "MQTT Configuration", "Settings for MQTT")
|
||||||
|
s.addremove = false
|
||||||
|
s.anonymous = true
|
||||||
|
|
||||||
|
o = s:option(Flag, "mqtt", "Enable MQTT")
|
||||||
|
o.default = "0"
|
||||||
|
|
||||||
|
o = s:option(Value, "host", "MQTT Host")
|
||||||
|
o.default = "mqtt.server.com"
|
||||||
|
|
||||||
|
-- Detectors Configuration
|
||||||
|
s = m:section(TypedSection, "frigate_config", "Detectors Configuration", "Settings for Detectors")
|
||||||
|
s.addremove = false
|
||||||
|
s.anonymous = true
|
||||||
|
|
||||||
|
o = s:option(Flag, "coral", "Enable Coral")
|
||||||
|
o.default = "1"
|
||||||
|
|
||||||
|
o = s:option(Value, "type", "Type")
|
||||||
|
o.default = "edgetpu"
|
||||||
|
|
||||||
|
o = s:option(Value, "device", "Device")
|
||||||
|
o.default = "usb"
|
||||||
|
|
||||||
|
-- Camera Configuration
|
||||||
|
s = m:section(TypedSection, "camera_config", "Camera Configuration", "Settings for Cameras")
|
||||||
|
s.addremove = true
|
||||||
|
s.anonymous = true
|
||||||
|
s.novaluetext = "There are no cameras configured yet."
|
||||||
|
|
||||||
|
o = s:option(Value, "name", "Camera Name")
|
||||||
|
o = s:option(Value, "path", "RTSP Path")
|
||||||
|
o = s:option(Value, "roles", "Roles")
|
||||||
|
o = s:option(Flag, "record", "Enable Recording")
|
||||||
|
o = s:option(Flag, "snapshots", "Enable Snapshots")
|
||||||
|
o = s:option(Value, "mask", "Mask")
|
||||||
|
|
||||||
|
return m
|
@ -0,0 +1,55 @@
|
|||||||
|
local util = require "luci.util"
|
||||||
|
local jsonc = require "luci.jsonc"
|
||||||
|
|
||||||
|
local frigate = {}
|
||||||
|
|
||||||
|
frigate.blocks = function()
|
||||||
|
local f = io.popen("lsblk -s -f -b -o NAME,FSSIZE,MOUNTPOINT --json", "r")
|
||||||
|
local vals = {}
|
||||||
|
if f then
|
||||||
|
local ret = f:read("*all")
|
||||||
|
f:close()
|
||||||
|
local obj = jsonc.parse(ret)
|
||||||
|
for _, val in pairs(obj["blockdevices"]) do
|
||||||
|
local fsize = val["fssize"]
|
||||||
|
if fsize ~= nil and string.len(fsize) > 10 and val["mountpoint"] then
|
||||||
|
-- fsize > 1G
|
||||||
|
vals[#vals+1] = val["mountpoint"]
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
||||||
|
return vals
|
||||||
|
end
|
||||||
|
|
||||||
|
frigatered.home = function()
|
||||||
|
local uci = require "luci.model.uci".cursor()
|
||||||
|
local home_dirs = {}
|
||||||
|
home_dirs["main_dir"] = uci:get_first("quickstart", "main", "main_dir", "/opt/docker2/compose")
|
||||||
|
home_dirs["Configs"] = uci:get_first("quickstart", "main", "conf_dir", home_dirs["main_dir"].."/frigate/Configs")
|
||||||
|
home_dirs["Public"] = uci:get_first("quickstart", "main", "pub_dir", home_dirs["main_dir"].."/Public")
|
||||||
|
home_dirs["Downloads"] = uci:get_first("quickstart", "main", "dl_dir", home_dirs["Public"].."/Downloads")
|
||||||
|
home_dirs["Caches"] = uci:get_first("quickstart", "main", "tmp_dir", home_dirs["main_dir"].."/frigate/Caches")
|
||||||
|
return home_dirs
|
||||||
|
end
|
||||||
|
|
||||||
|
frigate.find_paths = function(blocks, home_dirs, path_name)
|
||||||
|
local default_path = ''
|
||||||
|
local configs = {}
|
||||||
|
|
||||||
|
default_path = home_dirs[path_name] .. "/frigate"
|
||||||
|
if #blocks == 0 then
|
||||||
|
table.insert(configs, default_path)
|
||||||
|
else
|
||||||
|
for _, val in pairs(blocks) do
|
||||||
|
table.insert(configs, val .. "/" .. path_name .. "/frigate")
|
||||||
|
end
|
||||||
|
local without_conf_dir = "/root/" .. path_name .. "/frigate"
|
||||||
|
if default_path == without_conf_dir then
|
||||||
|
default_path = configs[1]
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
return configs, default_path
|
||||||
|
end
|
||||||
|
|
||||||
|
return frigate
|
@ -0,0 +1,31 @@
|
|||||||
|
<%
|
||||||
|
local util = require "luci.util"
|
||||||
|
local container_status = util.trim(util.exec("/usr/libexec/apps/frigate/frigate.sh status"))
|
||||||
|
local container_running = string.find(string.lower(container_status), "up") and string.find(string.lower(container_status), "(healthy)")
|
||||||
|
-%>
|
||||||
|
|
||||||
|
<div class="cbi-value">
|
||||||
|
<label class="cbi-value-title">Status</label>
|
||||||
|
<div class="cbi-value-field">
|
||||||
|
<% if container_running then %>
|
||||||
|
<button class="cbi-button cbi-button-success" disabled="true"><%= container_status %></button>
|
||||||
|
<% else %>
|
||||||
|
<button class="cbi-button cbi-button-negative" disabled="true"><%= container_status %></button>
|
||||||
|
<% end %>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<%
|
||||||
|
if container_running then
|
||||||
|
local port=util.trim(util.exec("/usr/libexec/apps/frigate/frigate.sh port"))
|
||||||
|
if port == "" then
|
||||||
|
port="1880"
|
||||||
|
end
|
||||||
|
-%>
|
||||||
|
<div class="cbi-value cbi-value-last">
|
||||||
|
<label class="cbi-value-title"> </label>
|
||||||
|
<div class="cbi-value-field">
|
||||||
|
<input type="button" class="btn cbi-button cbi-button-apply" name="start" value="<%:Open frigate%>" onclick="window.open('http://'+location.hostname+':<%=port%>/', '_blank')">
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<% end %>
|
@ -0,0 +1,40 @@
|
|||||||
|
config frigate_config 'docker'
|
||||||
|
option port '5000'
|
||||||
|
option image 'ghcr.io/blakeblackshear/frigate:stable'
|
||||||
|
option usbcoral '/dev/bus/usb'
|
||||||
|
option hwaccel '/dev/crypto'
|
||||||
|
option storage './frigate/storage'
|
||||||
|
|
||||||
|
config frigate_config 'mqtt'
|
||||||
|
option mqtt 'False'
|
||||||
|
option host 'mqtt.server.com
|
||||||
|
|
||||||
|
config frigate_config 'detectors'
|
||||||
|
option coral 'True'
|
||||||
|
option type 'edgetpu'
|
||||||
|
option device 'usb'
|
||||||
|
|
||||||
|
config camera_config 'cam1'
|
||||||
|
option name 'living_room'
|
||||||
|
option path 'rtsp://admin:password@192.168.70.173:554/cam/realmonitor?channel=1&subtype=0&authbasic=64'
|
||||||
|
option roles 'detect'
|
||||||
|
option record 'true'
|
||||||
|
option snapshots 'true'
|
||||||
|
option mask '0,461,3,0,1919,0,1919,843,1699,492,1344,458,1346,336,973,317,869,375,866,432'
|
||||||
|
|
||||||
|
config camera_config 'cam2'
|
||||||
|
option name 'upstairs_bedroom'
|
||||||
|
option path 'rtsp://admin:password@192.168.70.173:554/cam/realmonitor?channel=1&subtype=0&authbasic=64'
|
||||||
|
option roles 'detect'
|
||||||
|
option record 'true'
|
||||||
|
option snapshots 'true'
|
||||||
|
option mask '0,461,3,0,1919,0,1919,843,1699,492,1344,458,1346,336,973,317,869,375,866,432'
|
||||||
|
|
||||||
|
config camera_config 'cam3'
|
||||||
|
option name 'kitchen'
|
||||||
|
option path 'rtsp://admin:password@192.168.70.173:554/cam/realmonitor?channel=1&subtype=0&authbasic=64'
|
||||||
|
option roles 'detect'
|
||||||
|
option record 'true'
|
||||||
|
option snapshots 'true'
|
||||||
|
option mask '0,461,3,0,1919,0,1919,843,1699,492,1344,458,1346,336,973,317,869,375,866,432'
|
||||||
|
|
@ -0,0 +1,14 @@
|
|||||||
|
#!/bin/sh
|
||||||
|
|
||||||
|
config_dir=`uci -q get frigate.@frigate[0].config_path`
|
||||||
|
|
||||||
|
data_dir=`docker inspect --format '{{.Mounts}}' frigate | grep -Eom1 '[^ ]+/_data /var/www/html local true ' | cut -d' ' -f1`
|
||||||
|
|
||||||
|
if [ -n "$data_dir" -a "$data_dir" != "$config_dir" ]; then
|
||||||
|
uci -q batch <<-EOF >/dev/null
|
||||||
|
set frigate.@frigate[0].config_path="$data_dir"
|
||||||
|
commit frigate
|
||||||
|
EOF
|
||||||
|
fi
|
||||||
|
|
||||||
|
exit 0
|
@ -0,0 +1,192 @@
|
|||||||
|
#!/bin/sh
|
||||||
|
|
||||||
|
APP_NAME="frigate"
|
||||||
|
|
||||||
|
ACTION="${1}"
|
||||||
|
shift 1
|
||||||
|
|
||||||
|
get_image() {
|
||||||
|
do_install_detail
|
||||||
|
}
|
||||||
|
|
||||||
|
do_install_detail() {
|
||||||
|
local config port IMAGE_NAME username password LAN_IP
|
||||||
|
local usbcoral hwaccel storage mqtt host coral type device
|
||||||
|
|
||||||
|
config=$(uci get frigate.@frigate_config[0].config_path 2>/dev/null)
|
||||||
|
port=$(uci get frigate.@frigate_config[0].port 2>/dev/null)
|
||||||
|
IMAGE_NAME=$(uci get frigate.@frigate_config[0].image 2>/dev/null)
|
||||||
|
usbcoral=$(uci get frigate.@frigate_config[0].usbcoral 2>/dev/null)
|
||||||
|
hwaccel=$(uci get frigate.@frigate_config[0].hwaccel 2>/dev/null)
|
||||||
|
storage=$(uci get frigate.@frigate_config[0].storage 2>/dev/null)
|
||||||
|
|
||||||
|
mqtt=$(uci get frigate.@frigate_config[0].mqtt 2>/dev/null)
|
||||||
|
host=$(uci get frigate.@frigate_config[0].host 2>/dev/null)
|
||||||
|
|
||||||
|
coral=$(uci get frigate.@frigate_config[0].coral 2>/dev/null)
|
||||||
|
type=$(uci get frigate.@frigate_config[0].type 2>/dev/null)
|
||||||
|
device=$(uci get frigate.@frigate_config[0].device 2>/dev/null)
|
||||||
|
|
||||||
|
username=$(uci get frigate.@frigate_config[0].username 2>/dev/null)
|
||||||
|
password=$(uci get frigate.@frigate_config[0].password 2>/dev/null)
|
||||||
|
APP_NAME="frigate"
|
||||||
|
|
||||||
|
GEN_PASS=$(< /dev/urandom tr -dc A-Za-z0-9 2>/dev/null | head -c 14; echo)
|
||||||
|
GEN_PASS2=$(< /dev/urandom tr -dc A-Za-z0-9 2>/dev/null | head -c 14; echo)
|
||||||
|
|
||||||
|
LAN_IP=$(uci get network.lan.ipaddr)
|
||||||
|
LAN_IP="${LAN_IP%/*}"
|
||||||
|
|
||||||
|
if [ -z "$config" ]; then
|
||||||
|
echo "config path is empty!"
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
|
||||||
|
[ -z "$port" ] && port=1880
|
||||||
|
[ -z "$IMAGE_NAME" ] && IMAGE_NAME="ghcr.io/blakeblackshear/frigate:stable"
|
||||||
|
|
||||||
|
# Initialize counter
|
||||||
|
local i=0
|
||||||
|
mkdir -p /opt/docker2/compose/frigate
|
||||||
|
touch /opt/docker2/compose/frigate/config.yml
|
||||||
|
|
||||||
|
# Write global settings to config.yml using yq
|
||||||
|
# Replace these uci get commands with actual commands to get these variables
|
||||||
|
local usbcoral=$(uci get frigate.@frigate_config[0].usbcoral)
|
||||||
|
local hwaccel=$(uci get frigate.@frigate_config[0].hwaccel)
|
||||||
|
local storage=$(uci get frigate.@frigate_config[0].storage)
|
||||||
|
local mqtt=$(uci get frigate.@frigate_config[0].mqtt)
|
||||||
|
local host=$(uci get frigate.@frigate_config[0].host)
|
||||||
|
local coral=$(uci get frigate.@frigate_config[0].coral)
|
||||||
|
local type=$(uci get frigate.@frigate_config[0].type)
|
||||||
|
|
||||||
|
yq eval ".usbcoral = \"$usbcoral\"" -i /opt/docker2/compose/frigate/config.yml
|
||||||
|
yq eval ".hwaccel = \"$hwaccel\"" -i /opt/docker2/compose/frigate/config.yml
|
||||||
|
yq eval ".storage = \"$storage\"" -i /opt/docker2/compose/frigate/config.yml
|
||||||
|
yq eval ".mqtt.enabled = $mqtt" -i /opt/docker2/compose/frigate/config.yml
|
||||||
|
yq eval ".mqtt.host = \"$host\"" -i /opt/docker2/compose/frigate/config.yml
|
||||||
|
yq eval ".detectors.coral.type = \"$type\"" -i /opt/docker2/compose/frigate/config.yml
|
||||||
|
yq eval ".detectors.coral.device = \"$coral\"" -i /opt/docker2/compose/frigate/config.yml
|
||||||
|
|
||||||
|
# Write each camera's configuration to config.yml
|
||||||
|
local camera_index=0
|
||||||
|
while : ; do
|
||||||
|
# Try to fetch camera configuration
|
||||||
|
local name=$(uci get frigate.@camera_config[$camera_index].name 2>/dev/null)
|
||||||
|
# Exit loop if no more cameras are found
|
||||||
|
[[ -z "$name" ]] && break
|
||||||
|
|
||||||
|
# Retrieve the rest of the camera settings here...
|
||||||
|
local path=$(uci get frigate.@camera_config[$camera_index].path)
|
||||||
|
local roles=$(uci get frigate.@camera_config[$camera_index].roles)
|
||||||
|
local record=$(uci get frigate.@camera_config[$camera_index].record)
|
||||||
|
local snapshots=$(uci get frigate.@camera_config[$camera_index].snapshots)
|
||||||
|
local mask=$(uci get frigate.@camera_config[$camera_index].mask)
|
||||||
|
|
||||||
|
# Write to config.yml using yq
|
||||||
|
yq eval ".cameras.$name.ffmpeg.inputs[0].path = \"$path\"" -i /opt/docker2/compose/frigate/config.yml
|
||||||
|
yq eval ".cameras.$name.ffmpeg.inputs[0].roles[0] = \"detect\"" -i /opt/docker2/compose/frigate/config.yml
|
||||||
|
yq eval ".cameras.$name.detect.width = 1280" -i /opt/docker2/compose/frigate/config.yml
|
||||||
|
yq eval ".cameras.$name.detect.height = 720" -i /opt/docker2/compose/frigate/config.yml
|
||||||
|
yq eval ".cameras.$name.record.enabled = $record" -i /opt/docker2/compose/frigate/config.yml
|
||||||
|
yq eval ".cameras.$name.snapshots.enabled = $snapshots" -i /opt/docker2/compose/frigate/config.yml
|
||||||
|
yq eval ".cameras.$name.motion.mask[0] = \"$mask\"" -i /opt/docker2/compose/frigate/config.yml
|
||||||
|
|
||||||
|
camera_index=$((camera_index+1))
|
||||||
|
done
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
#rm -r /opt/docker2/compose/frigate 2>/dev/null
|
||||||
|
#mkdir -p /opt/docker2/compose/frigate
|
||||||
|
|
||||||
|
#touch /opt/docker2/compose/frigate/config.yml
|
||||||
|
|
||||||
|
#touch /opt/docker2/compose/frigate/docker-compose.yml
|
||||||
|
cat > /opt/docker2/compose/frigate/docker-compose.yml <<EOF
|
||||||
|
version: "3.9"
|
||||||
|
services:
|
||||||
|
frigate:
|
||||||
|
container_name: $APP_NAME
|
||||||
|
privileged: true # this may not be necessary for all setups
|
||||||
|
restart: unless-stopped
|
||||||
|
image: $IMAGE_NAME
|
||||||
|
shm_size: "64mb" # update for your cameras based on calculation above
|
||||||
|
devices:
|
||||||
|
- $usbcoral:/dev/bus/usb # passes the USB Coral, needs to be modified for other versions
|
||||||
|
#- /dev/apex_0:/dev/apex_0 # passes a PCIe Coral, follow driver instructions here https://coral.ai/docs/m2/get-started/#2a-on-linux
|
||||||
|
- $hwaccel # for intel hwaccel, needs to be updated for your hardware
|
||||||
|
volumes:
|
||||||
|
#- ./frigate/etc/localtime:/etc/localtime:ro
|
||||||
|
- ./config.yml:/config/config.yml
|
||||||
|
- $storage:/media/frigate
|
||||||
|
#- type: tmpfs # Optional: 1GB of memory, reduces SSD/SD Card wear
|
||||||
|
# target: /tmp/cache
|
||||||
|
# tmpfs:
|
||||||
|
# size: 1000000000
|
||||||
|
ports:
|
||||||
|
- "$port:5000"
|
||||||
|
- "8554:8554" # RTSP feeds
|
||||||
|
- "8555:8555/tcp" # WebRTC over tcp
|
||||||
|
- "8555:8555/udp" # WebRTC over udp
|
||||||
|
environment:
|
||||||
|
FRIGATE_RTSP_PASSWORD: "password"
|
||||||
|
EOF
|
||||||
|
|
||||||
|
docker-compose -f /opt/docker2/compose/frigate/docker-compose.yml up -d
|
||||||
|
|
||||||
|
uci add shortcutmenu lists
|
||||||
|
uci set shortcutmenu.@lists[-1].webname="$APP_NAME"
|
||||||
|
uci set shortcutmenu.@lists[-1].weburl="$LAN_IP:$port"
|
||||||
|
uci set shortcutmenu.@lists[-1].webpath="/"
|
||||||
|
uci commit shortcutmenu
|
||||||
|
}
|
||||||
|
|
||||||
|
usage() {
|
||||||
|
echo "usage: $0 sub-command"
|
||||||
|
echo "where sub-command is one of:"
|
||||||
|
echo " install Install frigate"
|
||||||
|
echo " upgrade Upgrade frigate"
|
||||||
|
echo " rm/start/stop/restart Remove/Start/Stop/Restart frigate"
|
||||||
|
echo " status frigate status"
|
||||||
|
echo " port frigate port"
|
||||||
|
}
|
||||||
|
|
||||||
|
case "${ACTION}" in
|
||||||
|
"install" | "upgrade")
|
||||||
|
do_install_detail
|
||||||
|
;;
|
||||||
|
"rm")
|
||||||
|
IMAGE_NAME=$(uci get frigate.@frigate[0].image_name 2>/dev/null)
|
||||||
|
[ -z "$IMAGE_NAME" ] && IMAGE_NAME="ghcr.io/blakeblackshear/frigate:stable"
|
||||||
|
CONTAINER_IDS=$(docker ps -a --filter "ancestor=${IMAGE_NAME}" --format '{{.ID}}')
|
||||||
|
echo "Stopping and removing containers..."
|
||||||
|
for ID in $CONTAINER_IDS; do
|
||||||
|
docker stop "$ID"
|
||||||
|
docker rm "$ID"
|
||||||
|
done
|
||||||
|
docker rmi -f "$IMAGE_NAME"
|
||||||
|
rm -r /opt/docker2/compose/frigate 2>/dev/null
|
||||||
|
;;
|
||||||
|
"start" | "stop" | "restart")
|
||||||
|
APP_NAME="frigate"
|
||||||
|
CONTAINER_IDS=$(docker ps -a --filter "ancestor=${APP_NAME}" --format '{{.ID}}')
|
||||||
|
for ID in $CONTAINER_IDS; do
|
||||||
|
docker "${ACTION}" "${ID}"
|
||||||
|
done
|
||||||
|
;;
|
||||||
|
"status")
|
||||||
|
APP_NAME="frigate"
|
||||||
|
CONTAINER_NAMES=$(docker ps -a --filter "name=${APP_NAME}" --format '{{.Names}}')
|
||||||
|
docker ps --all -f "name=${CONTAINER_NAMES}" --format '{{.Status}}'
|
||||||
|
;;
|
||||||
|
"port")
|
||||||
|
APP_NAME="frigate"
|
||||||
|
CONTAINER_NAMES=$(docker ps -a --filter "ancestor=${APP_NAME}" --format '{{.Names}}')
|
||||||
|
docker ps --all -f "name=${CONTAINER_NAMES}" --format '{{.Ports}}' | grep -o -m1 '0.0.0.0:[0-9]*' | sed 's/0.0.0.0://'
|
||||||
|
;;
|
||||||
|
*)
|
||||||
|
usage
|
||||||
|
exit 1
|
||||||
|
;;
|
||||||
|
esac
|
@ -0,0 +1,11 @@
|
|||||||
|
{
|
||||||
|
"luci-app-frigate": {
|
||||||
|
"description": "Grant UCI access for luci-app-frigate",
|
||||||
|
"read": {
|
||||||
|
"uci": [ "frigate" ]
|
||||||
|
},
|
||||||
|
"write": {
|
||||||
|
"uci": [ "frigate" ]
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
Loading…
Reference in New Issue