diff --git a/luci-app-bypass/luasrc/view/bypass/status_bottom.htm b/luci-app-bypass/luasrc/view/bypass/status_bottom.htm
index 207b6b069..deb2a6c86 100644
--- a/luci-app-bypass/luasrc/view/bypass/status_bottom.htm
+++ b/luci-app-bypass/luasrc/view/bypass/status_bottom.htm
@@ -76,7 +76,7 @@ let wW = window.innerWidth;
function resize() {
wW = window.innerWidth;
- let lw = document.querySelector(".main-left").offsetWidth;
+ let lw = document.querySelector(".main-left")?.offsetWidth ?? 5;
let statusBar = document.querySelector(".status-bar");
statusBar.style.width = (wW - lw) + 'px';
let flagElement = statusBar.querySelector(".flag");
diff --git a/luci-app-dnsmasq-ipset/Makefile b/luci-app-dnsmasq-ipset/Makefile
index 20183bb8d..22ea558b5 100644
--- a/luci-app-dnsmasq-ipset/Makefile
+++ b/luci-app-dnsmasq-ipset/Makefile
@@ -1,7 +1,7 @@
include $(TOPDIR)/rules.mk
PKG_NAME:=luci-app-dnsmasq-ipset
-PKG_VERSION:=0.2.0
+PKG_VERSION:=0.2.1
PKG_RELEASE:=1
PKG_LICENSE:=GPLv3
diff --git a/luci-app-dnsmasq-ipset/files/root/etc/init.d/dnsmasq-ipset b/luci-app-dnsmasq-ipset/files/root/etc/init.d/dnsmasq-ipset
index 7d78f1503..08348a15b 100755
--- a/luci-app-dnsmasq-ipset/files/root/etc/init.d/dnsmasq-ipset
+++ b/luci-app-dnsmasq-ipset/files/root/etc/init.d/dnsmasq-ipset
@@ -41,10 +41,16 @@ gen_config_file() {
else
config_list_foreach "${section}" "managed_domain" handle_domain_ipt
fi
+ link_config() {
+ local cfg="${1}"
+ [ -d "/tmp/dnsmasq.${cfg}.d" ] && cp -f "${config_file_name}" "/tmp/dnsmasq.${cfg}.d/ipset-${ipset_name}.conf"
+ }
+ config_load dhcp
+ config_foreach link_config dnsmasq
}
gen_config_files() {
- rm -rf /tmp/dnsmasq.d/ipset-*.conf
+ rm -f /tmp/dnsmasq*.d/ipset-*.conf
config_load dnsmasq-ipset
config_foreach gen_config_file ipsets
}
diff --git a/luci-app-immich/.vscode/settings.json b/luci-app-immich/.vscode/settings.json
new file mode 100644
index 000000000..b0d06989d
--- /dev/null
+++ b/luci-app-immich/.vscode/settings.json
@@ -0,0 +1,3 @@
+{
+ "makefile.configureOnOpen": true
+}
\ No newline at end of file
diff --git a/luci-app-immich/Makefile b/luci-app-immich/Makefile
new file mode 100644
index 000000000..e7d46f5a4
--- /dev/null
+++ b/luci-app-immich/Makefile
@@ -0,0 +1,24 @@
+
+
+include $(TOPDIR)/rules.mk
+
+PKG_VERSION:=1.0.0-20250207
+PKG_RELEASE:=
+
+LUCI_TITLE:=LuCI support for Immich
+LUCI_PKGARCH:=all
+LUCI_DEPENDS:=+lsblk +docker +dockerd +luci-lib-taskd +luci-lib-docker +docker-compose
+
+define Package/luci-app-immich/conffiles
+/etc/config/immich
+endef
+
+define Package/luci-app-immich/prerm
+#!/bin/sh
+/usr/libexec/istorec/immich.sh stop
+exit 0
+endef
+
+include $(TOPDIR)/feeds/luci/luci.mk
+
+# call BuildPackage - OpenWrt buildroot signature
diff --git a/luci-app-immich/luasrc/controller/immich.lua b/luci-app-immich/luasrc/controller/immich.lua
new file mode 100755
index 000000000..0d483f738
--- /dev/null
+++ b/luci-app-immich/luasrc/controller/immich.lua
@@ -0,0 +1,7 @@
+
+module("luci.controller.immich", package.seeall)
+
+function index()
+ entry({"admin", "services", "immich"}, alias("admin", "services", "immich", "config"), _("Immich"), 30).dependent = true
+ entry({"admin", "services", "immich", "config"}, cbi("immich"))
+end
diff --git a/luci-app-immich/luasrc/model/cbi/immich.lua b/luci-app-immich/luasrc/model/cbi/immich.lua
new file mode 100644
index 000000000..a0c3db60e
--- /dev/null
+++ b/luci-app-immich/luasrc/model/cbi/immich.lua
@@ -0,0 +1,63 @@
+--[[
+LuCI - Lua Configuration Interface
+]]--
+
+local taskd = require "luci.model.tasks"
+local docker = require "luci.docker"
+local immich_model = require "luci.model.immich"
+local m, s, o
+
+m = taskd.docker_map("immich", "immich", "/usr/libexec/istorec/immich.sh",
+ translate("Immich"),
+ translate("Immich is a self-host photo and video management solution.")
+ .. translate("Official website:") .. ' https://immich.app/')
+
+local dk = docker.new({socket_path="/var/run/docker.sock"})
+local dockerd_running = dk:_ping().code == 200
+local docker_info = dockerd_running and dk:info().body or {}
+local docker_aspace = 0
+if docker_info.DockerRootDir then
+ local statvfs = nixio.fs.statvfs(docker_info.DockerRootDir)
+ docker_aspace = statvfs and (statvfs.bavail * statvfs.bsize) or 0
+end
+
+s = m:section(SimpleSection, translate("Service Status"), translate("Immich status:"))
+s:append(Template("immich/status"))
+
+s = m:section(TypedSection, "main", translate("Setup"),
+ (docker_aspace < 2147483648 and
+ (translate("The free space of Docker is less than 2GB, which may cause the installation to fail.")
+ .. "
") or "") .. translate("The following parameters will only take effect during installation or upgrade:"))
+s.addremove=false
+s.anonymous=true
+
+o = s:option(Value, "port", translate("Port").."*")
+o.default = "2283"
+o.datatype = "port"
+
+o = s:option(Value, "image_ver", translate("Image").."*")
+o.rmempty = false
+o.datatype = "string"
+o.default = "release"
+o:value("release", "release")
+
+local blocks = immich_model.blocks()
+local home = immich_model.home()
+
+o = s:option(Value, "config_path", translate("Config path").."*")
+o.rmempty = false
+o.datatype = "string"
+
+local paths, default_path = immich_model.find_paths(blocks, home, "Configs")
+for _, val in pairs(paths) do
+ o:value(val, val)
+end
+o.default = default_path
+
+o = s:option(Value, "db_password", "DB_PASSWORD".."*")
+o.rmempty = false
+o.default = "postgres"
+o.datatype = "string"
+o.password = true
+
+return m
diff --git a/luci-app-immich/luasrc/model/immich.lua b/luci-app-immich/luasrc/model/immich.lua
new file mode 100644
index 000000000..69d75cebd
--- /dev/null
+++ b/luci-app-immich/luasrc/model/immich.lua
@@ -0,0 +1,55 @@
+local util = require "luci.util"
+local jsonc = require "luci.jsonc"
+
+local immich = {}
+
+immich.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
+
+immich.home = function()
+ local uci = require "luci.model.uci".cursor()
+ local home_dirs = {}
+ home_dirs["main_dir"] = uci:get_first("quickstart", "main", "main_dir", "/root")
+ home_dirs["Configs"] = uci:get_first("quickstart", "main", "conf_dir", home_dirs["main_dir"].."/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"].."/Caches")
+ return home_dirs
+end
+
+immich.find_paths = function(blocks, home_dirs, path_name)
+ local default_path = ''
+ local configs = {}
+
+ default_path = home_dirs[path_name] .. "/Immich"
+ if #blocks == 0 then
+ table.insert(configs, default_path)
+ else
+ for _, val in pairs(blocks) do
+ table.insert(configs, val .. "/" .. path_name .. "/Immich")
+ end
+ local without_conf_dir = "/root/" .. path_name .. "/Immich"
+ if default_path == without_conf_dir then
+ default_path = configs[1]
+ end
+ end
+
+ return configs, default_path
+end
+
+return immich
diff --git a/luci-app-immich/luasrc/view/immich/status.htm b/luci-app-immich/luasrc/view/immich/status.htm
new file mode 100644
index 000000000..770cc0255
--- /dev/null
+++ b/luci-app-immich/luasrc/view/immich/status.htm
@@ -0,0 +1,31 @@
+<%
+local util = require "luci.util"
+local container_status = util.trim(util.exec("/usr/libexec/istorec/immich.sh status"))
+local container_install = (string.len(container_status) > 0)
+local container_running = container_status == "running"
+-%>
+
设置成功