mirror of
https://github.com/kiddin9/op-packages.git
synced 2026-10-30 03:25:13 +08:00
🍉 Sync 2026-09-06 13:36:06
This commit is contained in:
1 parent
da7d5957ad
commit
813df5818f
12 files changed
+2656
-46
No files matched your search
@@ -2,7 +2,7 @@ include $(TOPDIR)/rules.mk
|
|||||||
|
|
||||||
PKG_NAME:=filebrowser-q
|
PKG_NAME:=filebrowser-q
|
||||||
PKG_VERSION:=1.5.6-stable
|
PKG_VERSION:=1.5.6-stable
|
||||||
PKG_RELEASE:=5
|
PKG_RELEASE:=6
|
||||||
|
|
||||||
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
|
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
|
||||||
PKG_SOURCE_URL:=https://codeload.github.com/gtsteffaniak/filebrowser/tar.gz/v$(PKG_VERSION)?
|
PKG_SOURCE_URL:=https://codeload.github.com/gtsteffaniak/filebrowser/tar.gz/v$(PKG_VERSION)?
|
||||||
|
|||||||
@@ -1,25 +1,24 @@
|
|||||||
#!/bin/sh /etc/rc.common
|
#!/bin/sh /etc/rc.common
|
||||||
|
|
||||||
|
USE_PROCD=1
|
||||||
START=99
|
START=99
|
||||||
STOP=10
|
|
||||||
|
|
||||||
CONF="filebrowser-q"
|
CONF="filebrowser-q"
|
||||||
PROG="/usr/bin/filebrowser-q"
|
PROG="/usr/bin/filebrowser-q"
|
||||||
CONF_PATH="/etc/filebrowser-q/config.yaml"
|
CONF_PATH="/etc/filebrowser-q/config.yaml"
|
||||||
PID_FILE="/var/run/filebrowser-q.pid"
|
DB_PATH="/etc/filebrowser-q/database.db"
|
||||||
|
|
||||||
start() {
|
start_service() {
|
||||||
config_load "$CONF"
|
config_load "$CONF"
|
||||||
|
|
||||||
local enabled
|
local enabled
|
||||||
config_get_bool enabled "config" "enabled" "0"
|
config_get_bool enabled "config" "enabled" "0"
|
||||||
[ "$enabled" -eq "1" ] || return 1
|
[ "$enabled" -eq "1" ] || return 1
|
||||||
|
|
||||||
local listen_port root_path root_name
|
local listen_port root_path root_name
|
||||||
config_get listen_port "config" "listen_port" "8787"
|
config_get listen_port "config" "listen_port" "8787"
|
||||||
config_get root_path "config" "root_path" "/"
|
config_get root_path "config" "root_path" "/"
|
||||||
|
|
||||||
# 路径为 / 时 name 设为 root,否则留空
|
|
||||||
root_name=""
|
root_name=""
|
||||||
[ "$root_path" = "/" ] && root_name="root"
|
[ "$root_path" = "/" ] && root_name="root"
|
||||||
|
|
||||||
@@ -28,7 +27,7 @@ start() {
|
|||||||
cat <<EOF > "$CONF_PATH"
|
cat <<EOF > "$CONF_PATH"
|
||||||
server:
|
server:
|
||||||
port: $listen_port
|
port: $listen_port
|
||||||
database: "/etc/filebrowser-q/database.db"
|
database: "$DB_PATH"
|
||||||
sources:
|
sources:
|
||||||
- path: "$root_path"
|
- path: "$root_path"
|
||||||
name: "$root_name"
|
name: "$root_name"
|
||||||
@@ -49,12 +48,20 @@ EOF
|
|||||||
-i "$CONF_PATH"
|
-i "$CONF_PATH"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
echo "Starting filebrowser..."
|
procd_open_instance
|
||||||
start-stop-daemon -S -q -b -m -p "$PID_FILE" -x "$PROG" -- -c "$CONF_PATH"
|
procd_set_param command "$PROG"
|
||||||
|
procd_append_param command -c "$CONF_PATH"
|
||||||
|
|
||||||
|
procd_set_param limits core="unlimited"
|
||||||
|
procd_set_param limits nofile="1000000 1000000"
|
||||||
|
procd_set_param stdout 1
|
||||||
|
procd_set_param stderr 1
|
||||||
|
procd_set_param respawn
|
||||||
|
|
||||||
|
procd_close_instance
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
stop() {
|
service_triggers() {
|
||||||
kill -9 `pidof filebrowser-q | sed "s/$$//g"` 2>/dev/null
|
procd_add_reload_trigger "$CONF"
|
||||||
rm -f "$PID_FILE"
|
|
||||||
echo "filebrowser stopped"
|
|
||||||
}
|
}
|
||||||
@@ -6,9 +6,21 @@
|
|||||||
'require view';
|
'require view';
|
||||||
'require fs';
|
'require fs';
|
||||||
|
|
||||||
|
const callServiceList = rpc.declare({
|
||||||
|
object: 'service',
|
||||||
|
method: 'list',
|
||||||
|
params: ['name'],
|
||||||
|
expect: { '': {} }
|
||||||
|
});
|
||||||
|
|
||||||
function getServiceStatus() {
|
function getServiceStatus() {
|
||||||
|
return L.resolveDefault(callServiceList('filebrowser-q'), {}).then(function(res) {
|
||||||
let isRunning = false;
|
let isRunning = false;
|
||||||
|
try {
|
||||||
|
isRunning = res['filebrowser-q']['instances']['instance1']['running'];
|
||||||
|
} catch (e) { }
|
||||||
return isRunning;
|
return isRunning;
|
||||||
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
function renderStatus(isRunning, port) {
|
function renderStatus(isRunning, port) {
|
||||||
@@ -26,16 +38,8 @@ function renderStatus(isRunning, port) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
return view.extend({
|
return view.extend({
|
||||||
load: async function () {
|
load() {
|
||||||
const promises = await Promise.all([
|
return uci.load('filebrowser-q');
|
||||||
L.resolveDefault(fs.stat('/var/run/filebrowser-q.pid'), null),
|
|
||||||
uci.load('filebrowser-q')
|
|
||||||
]);
|
|
||||||
const data = {
|
|
||||||
isRunning: promises[0],
|
|
||||||
conf: promises[1]
|
|
||||||
};
|
|
||||||
return data;
|
|
||||||
},
|
},
|
||||||
|
|
||||||
render(data) {
|
render(data) {
|
||||||
@@ -49,24 +53,17 @@ return view.extend({
|
|||||||
s = m.section(form.TypedSection);
|
s = m.section(form.TypedSection);
|
||||||
s.anonymous = true;
|
s.anonymous = true;
|
||||||
s.render = function() {
|
s.render = function() {
|
||||||
poll.add(function() {
|
poll.add(function() {
|
||||||
return fs.stat('/var/run/filebrowser-q.pid').then(function(stat) {
|
return L.resolveDefault(getServiceStatus()).then(function(res) {
|
||||||
let view = document.getElementById('service_status');
|
let view = document.getElementById('service_status');
|
||||||
if (view) {
|
view.innerHTML = renderStatus(res, webport);
|
||||||
view.innerHTML = renderStatus(stat, webport);
|
});
|
||||||
}
|
});
|
||||||
}).catch(function() {
|
|
||||||
let view = document.getElementById('service_status');
|
|
||||||
if (view) {
|
|
||||||
view.innerHTML = renderStatus(null, webport);
|
|
||||||
}
|
|
||||||
});
|
|
||||||
});
|
|
||||||
|
|
||||||
return E('div', { class: 'cbi-section', id: 'status_bar' }, [
|
return E('div', { class: 'cbi-section', id: 'status_bar' }, [
|
||||||
E('p', { id: 'service_status' }, _('Collecting data...'))
|
E('p', { id: 'service_status' }, _('Collecting data...'))
|
||||||
]);
|
]);
|
||||||
};
|
}
|
||||||
|
|
||||||
s = m.section(form.NamedSection, 'config', 'filebrowser');
|
s = m.section(form.NamedSection, 'config', 'filebrowser');
|
||||||
|
|
||||||
|
|||||||
@@ -2,7 +2,7 @@ include $(TOPDIR)/rules.mk
|
|||||||
|
|
||||||
PKG_NAME:=luci-app-mosdns
|
PKG_NAME:=luci-app-mosdns
|
||||||
PKG_VERSION:=1.7.13
|
PKG_VERSION:=1.7.13
|
||||||
PKG_RELEASE:=21
|
PKG_RELEASE:=22
|
||||||
|
|
||||||
LUCI_TITLE:=LuCI Support for mosdns
|
LUCI_TITLE:=LuCI Support for mosdns
|
||||||
LUCI_PKGARCH:=all
|
LUCI_PKGARCH:=all
|
||||||
|
|||||||
@@ -1,2 +1,3 @@
|
|||||||
#!/bin/sh
|
#!/bin/sh
|
||||||
[[ "$ACTION" = ifup && "$(uci -q get mosdns.mosdns.enabled)" == 1 ]] && /etc/init.d/mosdns restart
|
[ "$ACTION" = "ifup" ] || exit 0
|
||||||
|
[ "$INTERFACE" = "wan" ] && /etc/init.d/mosdns reload
|
||||||
@@ -0,0 +1,33 @@
|
|||||||
|
# SPDX-License-Identifier: Apache-2.0
|
||||||
|
#
|
||||||
|
# Copyright (C) 2026 luci-app-sysctl contributors
|
||||||
|
#
|
||||||
|
# LuCI application: manage kernel sysctl parameters from the web UI.
|
||||||
|
#
|
||||||
|
# Build inside OpenWrt 24.10 buildroot/SDK:
|
||||||
|
# - copy this directory to package/luci-app-sysctl (needs luci feed installed), or
|
||||||
|
# - copy to feeds/luci/applications/luci-app-sysctl and re-run feeds update/install
|
||||||
|
# then: make menuconfig -> LuCI -> Applications -> luci-app-sysctl
|
||||||
|
# make package/luci-app-sysctl/compile V=s
|
||||||
|
|
||||||
|
include $(TOPDIR)/rules.mk
|
||||||
|
|
||||||
|
PKG_NAME:=luci-app-sysctl
|
||||||
|
PKG_VERSION:=1.5.9
|
||||||
|
PKG_RELEASE:=1
|
||||||
|
|
||||||
|
PKG_LICENSE:=Apache-2.0
|
||||||
|
PKG_MAINTAINER:=luci-app-sysctl contributors
|
||||||
|
|
||||||
|
LUCI_TITLE:=LuCI application to manage kernel sysctl parameters
|
||||||
|
LUCI_DESCRIPTION:=View live kernel parameters and manage custom sysctl entries \
|
||||||
|
stored in /etc/sysctl.d/99-luci-sysctl.conf from the LuCI web interface. \
|
||||||
|
Supports browsing /proc/sys, searching parameters, one-click apply and \
|
||||||
|
immediate runtime activation of single parameters.
|
||||||
|
LUCI_DEPENDS:=+luci-base +rpcd +rpcd-mod-ucode
|
||||||
|
LUCI_CONFFILES:=/etc/sysctl.d/99-luci-sysctl.conf
|
||||||
|
LUCI_PKGARCH:=all
|
||||||
|
|
||||||
|
include $(TOPDIR)/feeds/luci/luci.mk
|
||||||
|
|
||||||
|
# call BuildPackage - OpenWrt buildroot signature
|
||||||
@@ -0,0 +1,115 @@
|
|||||||
|
#!/usr/bin/env bash
|
||||||
|
# SPDX-License-Identifier: Apache-2.0
|
||||||
|
#
|
||||||
|
# build-ipk.sh - pack luci-app-sysctl into an opkg-installable .ipk
|
||||||
|
# without requiring the OpenWrt SDK/buildroot.
|
||||||
|
#
|
||||||
|
# Usage:
|
||||||
|
# ./build-ipk.sh [output-directory]
|
||||||
|
#
|
||||||
|
# The produced .ipk targets OpenWrt 24.10 (opkg, "all" architecture):
|
||||||
|
# opkg install luci-app-sysctl_<version>-<release>_all.ipk
|
||||||
|
|
||||||
|
set -euo pipefail
|
||||||
|
|
||||||
|
SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
|
||||||
|
PKG_DIR="$SCRIPT_DIR"
|
||||||
|
OUT_DIR="${1:-$PKG_DIR}"
|
||||||
|
|
||||||
|
# --- read package identity from the OpenWrt Makefile -----------------------
|
||||||
|
get_var() {
|
||||||
|
sed -n "s/^$1:=//p" "$PKG_DIR/Makefile" | head -1
|
||||||
|
}
|
||||||
|
|
||||||
|
PKG_NAME="$(get_var PKG_NAME)"
|
||||||
|
PKG_VERSION="$(get_var PKG_VERSION)"
|
||||||
|
PKG_RELEASE="$(get_var PKG_RELEASE)"
|
||||||
|
|
||||||
|
for v in PKG_NAME PKG_VERSION PKG_RELEASE; do
|
||||||
|
if [ -z "$(eval "echo \$$v")" ]; then
|
||||||
|
echo "ERROR: $v not found in $PKG_DIR/Makefile" >&2
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
done
|
||||||
|
|
||||||
|
IPK_NAME="${PKG_NAME}_${PKG_VERSION}-${PKG_RELEASE}_all.ipk"
|
||||||
|
|
||||||
|
# --- sanity checks ----------------------------------------------------------
|
||||||
|
for f in \
|
||||||
|
"$PKG_DIR/htdocs/luci-static/resources/view/sysctl.js" \
|
||||||
|
"$PKG_DIR/root/usr/share/rpcd/ucode/luci.sysctl" \
|
||||||
|
"$PKG_DIR/root/usr/share/luci/menu.d/$PKG_NAME.json" \
|
||||||
|
"$PKG_DIR/root/usr/share/rpcd/acl.d/$PKG_NAME.json" \
|
||||||
|
"$PKG_DIR/root/etc/sysctl.d/99-luci-sysctl.conf"
|
||||||
|
do
|
||||||
|
if [ ! -f "$f" ]; then
|
||||||
|
echo "ERROR: required file missing: $f" >&2
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
done
|
||||||
|
|
||||||
|
# --- staging ----------------------------------------------------------------
|
||||||
|
WORK="$(mktemp -d)"
|
||||||
|
trap 'rm -rf "$WORK"' EXIT
|
||||||
|
|
||||||
|
DATA="$WORK/data"
|
||||||
|
CTRL="$WORK/control"
|
||||||
|
|
||||||
|
mkdir -p "$DATA" "$CTRL"
|
||||||
|
|
||||||
|
# root/ maps to /
|
||||||
|
cp -a "$PKG_DIR/root/." "$DATA/"
|
||||||
|
|
||||||
|
# htdocs/ maps to /www
|
||||||
|
mkdir -p "$DATA/www"
|
||||||
|
cp -a "$PKG_DIR/htdocs/." "$DATA/www/"
|
||||||
|
|
||||||
|
# uniform ownership/permissions; rpcd refuses world-writable ucode plugins
|
||||||
|
find "$DATA" -type d -exec chmod 755 {} +
|
||||||
|
find "$DATA" -type f -exec chmod 644 {} +
|
||||||
|
|
||||||
|
# --- control metadata ---------------------------------------------------------
|
||||||
|
cat > "$CTRL/control" <<EOF
|
||||||
|
Package: $PKG_NAME
|
||||||
|
Version: $PKG_VERSION-$PKG_RELEASE
|
||||||
|
Architecture: all
|
||||||
|
Maintainer: luci-app-sysctl contributors
|
||||||
|
Section: luci
|
||||||
|
Priority: optional
|
||||||
|
Depends: libc, luci-base, rpcd, rpcd-mod-ucode
|
||||||
|
Description: LuCI application to manage kernel sysctl parameters
|
||||||
|
View live kernel parameters and manage custom sysctl entries
|
||||||
|
in /etc/sysctl.d/99-luci-sysctl.conf from the LuCI web interface.
|
||||||
|
EOF
|
||||||
|
|
||||||
|
cat > "$CTRL/conffiles" <<'EOF'
|
||||||
|
/etc/sysctl.d/99-luci-sysctl.conf
|
||||||
|
EOF
|
||||||
|
|
||||||
|
cat > "$CTRL/postinst" <<'EOF'
|
||||||
|
#!/bin/sh
|
||||||
|
# register the new ubus object and invalidate the LuCI menu cache
|
||||||
|
if [ -x /etc/init.d/rpcd ]; then
|
||||||
|
/etc/init.d/rpcd restart
|
||||||
|
fi
|
||||||
|
rm -f /tmp/luci-indexcache* 2>/dev/null
|
||||||
|
exit 0
|
||||||
|
EOF
|
||||||
|
|
||||||
|
chmod 755 "$CTRL/postinst"
|
||||||
|
chmod 644 "$CTRL/control" "$CTRL/conffiles"
|
||||||
|
|
||||||
|
# --- archive ----------------------------------------------------------------
|
||||||
|
TAR_FLAGS=(--owner=0 --group=0 --numeric-owner)
|
||||||
|
|
||||||
|
tar "${TAR_FLAGS[@]}" -czf "$WORK/data.tar.gz" -C "$DATA" ./etc ./usr ./www
|
||||||
|
tar "${TAR_FLAGS[@]}" -czf "$WORK/control.tar.gz" -C "$CTRL" ./control ./conffiles ./postinst
|
||||||
|
|
||||||
|
printf '2.0\n' > "$WORK/debian-binary"
|
||||||
|
|
||||||
|
IPK_PATH="$OUT_DIR/$IPK_NAME"
|
||||||
|
mkdir -p "$OUT_DIR"
|
||||||
|
rm -f "$IPK_PATH"
|
||||||
|
tar -czf "$IPK_PATH" -C "$WORK" debian-binary control.tar.gz data.tar.gz
|
||||||
|
|
||||||
|
echo "OK: $IPK_PATH"
|
||||||
File diff suppressed because it is too large.
Load diff
@@ -0,0 +1,10 @@
|
|||||||
|
# Custom kernel parameters managed by luci-app-sysctl.
|
||||||
|
#
|
||||||
|
# Entries added or modified through the LuCI web interface
|
||||||
|
# (System -> 内核参数 / Kernel Parameters) are stored in this file.
|
||||||
|
#
|
||||||
|
# A line prefixed with "#" means the entry is disabled, e.g.:
|
||||||
|
# # net.core.somaxconn = 4096
|
||||||
|
#
|
||||||
|
# This file is loaded at boot time by /etc/init.d/sysctl and can be
|
||||||
|
# re-applied at runtime from the LuCI page ("应用配置" button).
|
||||||
@@ -0,0 +1,13 @@
|
|||||||
|
{
|
||||||
|
"admin/system/sysctl": {
|
||||||
|
"title": "内核参数",
|
||||||
|
"order": 65,
|
||||||
|
"action": {
|
||||||
|
"type": "view",
|
||||||
|
"path": "sysctl"
|
||||||
|
},
|
||||||
|
"depends": {
|
||||||
|
"acl": [ "luci-app-sysctl" ]
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,33 @@
|
|||||||
|
{
|
||||||
|
"luci-app-sysctl": {
|
||||||
|
"description": "Grant access to kernel sysctl parameters",
|
||||||
|
"read": {
|
||||||
|
"ubus": {
|
||||||
|
"luci.sysctl": [
|
||||||
|
"status",
|
||||||
|
"list",
|
||||||
|
"browse",
|
||||||
|
"search",
|
||||||
|
"preset_status",
|
||||||
|
"preset_fetch",
|
||||||
|
"preset_check",
|
||||||
|
"file_view",
|
||||||
|
"preset_list"
|
||||||
|
]
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"write": {
|
||||||
|
"ubus": {
|
||||||
|
"luci.sysctl": [
|
||||||
|
"set",
|
||||||
|
"remove",
|
||||||
|
"apply",
|
||||||
|
"preset_import",
|
||||||
|
"preset_remove",
|
||||||
|
"file_set",
|
||||||
|
"file_delete"
|
||||||
|
]
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
File diff suppressed because it is too large.
Load diff
Reference in new issue
Block a user