mirror of
https://github.com/kiddin9/op-packages.git
synced 2026-11-01 00:15:13 +08:00
🎁 Sync 2026-09-30 11:42:51
This commit is contained in:
1 parent
214a01499a
commit
6c95370452
167 files changed
+3579
-7579
No files matched your search
@@ -1,24 +0,0 @@
|
||||
#!/bin/sh
|
||||
# Small, allowlisted bridge from authenticated LuCI RPC to the local HTTP API.
|
||||
# Caller-controlled hosts, ports and arbitrary API paths are never accepted.
|
||||
set -eu
|
||||
case "$#:${1:-}:${2:-}" in
|
||||
2:GET:/version|2:GET:/configs|2:GET:/connections) body='' ;;
|
||||
3:PATCH:/configs)
|
||||
mode=$(jsonfilter -s "$3" -e '@.mode')
|
||||
case "$mode" in rule|global|direct) ;; *) echo 'Invalid mode' >&2; exit 1 ;; esac
|
||||
body="{\"mode\":\"$mode\"}"
|
||||
;;
|
||||
*) echo 'Unsupported API request' >&2; exit 1 ;;
|
||||
esac
|
||||
method=$1
|
||||
path=$2
|
||||
port=$(uci -q get meow.main.panel_port || echo 9090)
|
||||
case "$port" in ''|*[!0-9]*) echo 'Invalid API port' >&2; exit 1 ;; esac
|
||||
[ "$port" -ge 1 ] && [ "$port" -le 65535 ] || exit 1
|
||||
secret=$(uci -q get meow.main.secret || true)
|
||||
set -- --noproxy '*' --silent --show-error --fail --connect-timeout 2 --max-time 5 \
|
||||
--request "$method" "http://127.0.0.1:$port$path"
|
||||
[ -z "$secret" ] || set -- "$@" --header "Authorization: Bearer $secret"
|
||||
[ -z "$body" ] || set -- "$@" --header 'Content-Type: application/json' --data-binary "$body"
|
||||
exec curl "$@"
|
||||
@@ -1,14 +0,0 @@
|
||||
#!/bin/sh
|
||||
# No caller-supplied CLI flags or paths: only the generated scratch token.
|
||||
set -eu
|
||||
[ "$#" -eq 1 ] || exit 1
|
||||
case "$1" in
|
||||
check) scratch=/tmp/meow-luci-check.yaml ;;
|
||||
*)
|
||||
[ "${#1}" -eq 32 ] || exit 1
|
||||
case "$1" in *[!0-9a-f]*) exit 1 ;; esac
|
||||
scratch="/tmp/meow-luci-settings-$1.yaml"
|
||||
;;
|
||||
esac
|
||||
# Delegated LuCI configuration is deliberately confined to /etc/meow.
|
||||
exec /usr/bin/meow --no-external-plugins -d /etc/meow -f "$scratch" -t
|
||||
@@ -1,67 +0,0 @@
|
||||
{
|
||||
"admin/services/meow": {
|
||||
"title": "meow",
|
||||
"order": 60,
|
||||
"action": {
|
||||
"type": "firstchild"
|
||||
},
|
||||
"depends": {
|
||||
"acl": [ "luci-app-meow" ],
|
||||
"uci": { "meow": true }
|
||||
}
|
||||
},
|
||||
|
||||
"admin/services/meow/overview": {
|
||||
"title": "Overview",
|
||||
"order": 10,
|
||||
"action": {
|
||||
"type": "view",
|
||||
"path": "meow/overview"
|
||||
}
|
||||
},
|
||||
|
||||
"admin/services/meow/panel": {
|
||||
"title": "Panel",
|
||||
"order": 20,
|
||||
"action": {
|
||||
"type": "view",
|
||||
"path": "meow/panel"
|
||||
}
|
||||
},
|
||||
|
||||
"admin/services/meow/config": {
|
||||
"title": "Configuration",
|
||||
"order": 30,
|
||||
"action": {
|
||||
"type": "view",
|
||||
"path": "meow/config"
|
||||
}
|
||||
},
|
||||
|
||||
"admin/services/meow/clients": {
|
||||
"title": "Clients",
|
||||
"order": 35,
|
||||
"action": {
|
||||
"type": "view",
|
||||
"path": "meow/clients"
|
||||
}
|
||||
},
|
||||
|
||||
"admin/services/meow/settings": {
|
||||
"title": "Settings",
|
||||
"order": 40,
|
||||
"action": {
|
||||
"type": "view",
|
||||
"path": "meow/settings"
|
||||
}
|
||||
},
|
||||
|
||||
"admin/services/meow/log": {
|
||||
"title": "Log",
|
||||
"order": 50,
|
||||
"action": {
|
||||
"type": "view",
|
||||
"path": "meow/log"
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,43 +0,0 @@
|
||||
{
|
||||
"luci-app-meow": {
|
||||
"description": "Grant access to meow service configuration",
|
||||
"read": {
|
||||
"uci": [ "meow", "network", "dhcp" ],
|
||||
"ubus": {
|
||||
"luci-rpc": [ "getHostHints", "getDHCPLeases" ],
|
||||
"service": [ "list" ],
|
||||
"file": [ "exec" ],
|
||||
"uci": [ "get", "changes" ]
|
||||
},
|
||||
"file": {
|
||||
"/sbin/logread -e meow": [ "exec" ],
|
||||
"/usr/share/meow/gateway.sh status": [ "exec" ],
|
||||
"/usr/share/meow/arp-hijack.sh clients": [ "exec" ],
|
||||
"/usr/libexec/meow-api GET /version": [ "exec" ],
|
||||
"/usr/libexec/meow-api GET /configs": [ "exec" ],
|
||||
"/usr/libexec/meow-api GET /connections": [ "exec" ],
|
||||
"/etc/meow/config.yaml": [ "read" ]
|
||||
},
|
||||
"cgi-io": [ "download", "exec" ]
|
||||
},
|
||||
"write": {
|
||||
"uci": [ "meow" ],
|
||||
"file": {
|
||||
"/tmp/meow-luci-check.yaml": [ "write" ],
|
||||
"/tmp/meow-luci-settings-*.yaml": [ "write" ],
|
||||
"/etc/init.d/meow start": [ "exec" ],
|
||||
"/etc/init.d/meow stop": [ "exec" ],
|
||||
"/etc/init.d/meow restart": [ "exec" ],
|
||||
"/etc/init.d/meow-arp restart": [ "exec" ],
|
||||
"/usr/libexec/meow-api PATCH /configs *": [ "exec" ],
|
||||
"/etc/meow/config.yaml": [ "write" ],
|
||||
"/usr/libexec/meow-validate *": [ "exec" ]
|
||||
},
|
||||
"ubus": {
|
||||
"file": [ "exec", "remove" ],
|
||||
"uci": [ "add", "apply", "confirm", "delete", "order", "rename", "set" ]
|
||||
},
|
||||
"cgi-io": [ "upload" ]
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user