mirror of
https://github.com/kiddin9/op-packages.git
synced 2026-11-02 01:53:56 +08:00
🎨 Sync 2026-08-05 00:15:00
This commit is contained in:
1 parent
9b522ebf42
commit
e40fd6d46b
72 files changed
+1246
-78
No files matched your search
@@ -0,0 +1,74 @@
|
||||
#
|
||||
# Copyright (C) 2026 iStoreOS
|
||||
#
|
||||
# This is free software, licensed under the GNU General Public License v3.
|
||||
#
|
||||
|
||||
include $(TOPDIR)/rules.mk
|
||||
|
||||
PKG_NAME:=linkeasefull
|
||||
PKG_SOURCE_DATE:=3.0.4
|
||||
PKG_RELEASE:=3
|
||||
|
||||
ifeq ($(ARCH),x86_64)
|
||||
LINKEASE_RUNTIME_ARCH:=amd64
|
||||
PKG_HASH:=skip
|
||||
else ifeq ($(ARCH),aarch64)
|
||||
LINKEASE_RUNTIME_ARCH:=arm64
|
||||
PKG_HASH:=skip
|
||||
endif
|
||||
|
||||
PKG_SOURCE:=linkease-runtime-$(PKG_SOURCE_DATE)-linux-$(LINKEASE_RUNTIME_ARCH).tar.gz
|
||||
PKG_SOURCE_URL:=https://github.com/istoreos/istoreos-app-hub/releases/download/linkeasefull-runtime-v$(PKG_SOURCE_DATE)/
|
||||
PKG_BUILD_DIR:=$(BUILD_DIR)/linkease-runtime-$(PKG_SOURCE_DATE)-linux-$(LINKEASE_RUNTIME_ARCH)
|
||||
|
||||
PKG_BUILD_PARALLEL:=1
|
||||
PKG_USE_MIPS16:=0
|
||||
|
||||
include $(INCLUDE_DIR)/package.mk
|
||||
|
||||
define Package/$(PKG_NAME)
|
||||
SECTION:=net
|
||||
CATEGORY:=Network
|
||||
SUBMENU:=Web Servers/Proxies
|
||||
TITLE:=LinkEase Full - the local web desktop
|
||||
DEPENDS:=@(x86_64||aarch64) +linkease-common-bin +ca-bundle
|
||||
URL:=https://www.linkease.com/
|
||||
endef
|
||||
|
||||
define Package/$(PKG_NAME)/description
|
||||
LinkEase Full provides the local web desktop entry for LinkEase and reuses the shared LinkEase file entry.
|
||||
endef
|
||||
|
||||
define Package/$(PKG_NAME)/conffiles
|
||||
/etc/config/linkeasefull
|
||||
endef
|
||||
|
||||
define Package/$(PKG_NAME)/postinst
|
||||
#!/bin/sh
|
||||
if [ -z "$${IPKG_INSTROOT}" ]; then
|
||||
[ -f /etc/uci-defaults/linkeasefull ] && /etc/uci-defaults/linkeasefull && rm -f /etc/uci-defaults/linkeasefull
|
||||
exit 0
|
||||
fi
|
||||
endef
|
||||
|
||||
define Build/Configure
|
||||
endef
|
||||
|
||||
define Build/Compile
|
||||
endef
|
||||
|
||||
define Package/$(PKG_NAME)/install
|
||||
$(INSTALL_DIR) $(1)/usr/bin $(1)/usr/libexec/linkeasefull/linkmount_bin $(1)/etc/config $(1)/etc/init.d $(1)/etc/uci-defaults
|
||||
$(INSTALL_BIN) $(PKG_BUILD_DIR)/bin/linkease-full $(1)/usr/bin/linkease-full
|
||||
$(INSTALL_BIN) $(PKG_BUILD_DIR)/bin/linkremote-agent $(1)/usr/bin/linkremote-agent
|
||||
$(INSTALL_BIN) $(PKG_BUILD_DIR)/bin/hostlink $(1)/usr/bin/hostlink
|
||||
$(INSTALL_BIN) $(PKG_BUILD_DIR)/linkmount_bin/linkmount_bin $(1)/usr/libexec/linkeasefull/linkmount_bin/linkmount_bin
|
||||
$(CP) $(PKG_BUILD_DIR)/linkmount_bin/lib $(1)/usr/libexec/linkeasefull/linkmount_bin/lib
|
||||
$(CP) $(PKG_BUILD_DIR)/linkmount_bin/ver.json $(1)/usr/libexec/linkeasefull/linkmount_bin/ver.json
|
||||
$(INSTALL_CONF) ./files/linkeasefull.config $(1)/etc/config/linkeasefull
|
||||
$(INSTALL_BIN) ./files/linkeasefull.init $(1)/etc/init.d/linkeasefull
|
||||
$(INSTALL_BIN) ./files/linkeasefull.uci-default $(1)/etc/uci-defaults/linkeasefull
|
||||
endef
|
||||
|
||||
$(eval $(call BuildPackage,$(PKG_NAME)))
|
||||
@@ -0,0 +1,3 @@
|
||||
config linkeasefull
|
||||
option enabled '1'
|
||||
option data_root_parent ''
|
||||
@@ -0,0 +1,149 @@
|
||||
#!/bin/sh /etc/rc.common
|
||||
|
||||
START=100
|
||||
STOP=10
|
||||
USE_PROCD=1
|
||||
|
||||
PROG=/usr/bin/linkease-full
|
||||
LINKEASE_LIBEXEC=/usr/libexec/linkeasefull
|
||||
LINKEASE_FULL_PORT=19290
|
||||
LINKEASE_BASE_PATH=/apps/
|
||||
LINKEASE_LEGACY_ADDR=0.0.0.0:8897
|
||||
LOCAL_API=/var/run/linkease.sock
|
||||
|
||||
is_persistent_data_root_parent() {
|
||||
[ -n "$1" ] || return 1
|
||||
case "$1" in
|
||||
/tmp|/tmp/*|/var|/var/*|/run|/run/*|/dev|/dev/*|/proc|/proc/*|/sys|/sys/*|/rom|/rom/*|/overlay|/overlay/*) return 1 ;;
|
||||
esac
|
||||
[ -d "$1" ] || return 1
|
||||
return 0
|
||||
}
|
||||
|
||||
resolve_data_root_parent() {
|
||||
if [ -n "$data_root_parent" ]; then
|
||||
is_persistent_data_root_parent "$data_root_parent"
|
||||
return $?
|
||||
fi
|
||||
|
||||
local_home="$(uci -q get linkease.@linkease[0].local_home || true)"
|
||||
if is_persistent_data_root_parent "$local_home"; then
|
||||
data_root_parent="$local_home"
|
||||
return 0
|
||||
fi
|
||||
|
||||
if [ -f /etc/config/quickstart ]; then
|
||||
quickstart_main_dir="$(uci -q get quickstart.main.main_dir || true)"
|
||||
if [ -n "$quickstart_main_dir" ]; then
|
||||
if is_persistent_data_root_parent "$quickstart_main_dir"; then
|
||||
data_root_parent="$quickstart_main_dir"
|
||||
return 0
|
||||
fi
|
||||
fi
|
||||
fi
|
||||
|
||||
return 1
|
||||
}
|
||||
|
||||
sync_shared_local_home() {
|
||||
[ -x /usr/sbin/linkease-config.sh ] || return 0
|
||||
/usr/sbin/linkease-config.sh local_save "$data_root_parent" >/dev/null 2>&1 || true
|
||||
}
|
||||
|
||||
linkease_enabled() {
|
||||
[ "$(uci -q get linkease.@linkease[0].enabled 2>/dev/null)" = "1" ]
|
||||
}
|
||||
|
||||
read_config() {
|
||||
section="$1"
|
||||
config_get_bool enabled "$section" enabled 1
|
||||
config_get data_root_parent "$section" data_root_parent ""
|
||||
|
||||
if ! resolve_data_root_parent; then
|
||||
data_root_parent=""
|
||||
return 1
|
||||
fi
|
||||
data_root="$data_root_parent/.linkease_data"
|
||||
recycle_root="$data_root_parent/.linkease_recycle"
|
||||
apptunnel_config_dir="/tmp/linkeasefull/apptunnel-config"
|
||||
}
|
||||
|
||||
start_service() {
|
||||
config_load linkeasefull
|
||||
config_foreach read_config linkeasefull
|
||||
[ "$enabled" = "1" ] || return 1
|
||||
[ -x "$PROG" ] || return 1
|
||||
if linkease_enabled; then
|
||||
echo "linkeasefull: linkease is enabled; please disable linkease before starting linkeasefull" >&2
|
||||
return 1
|
||||
fi
|
||||
if [ -z "$data_root_parent" ]; then
|
||||
echo "linkeasefull: please choose a persistent disk storage path in LuCI" >&2
|
||||
return 1
|
||||
fi
|
||||
sync_shared_local_home
|
||||
|
||||
rm -f "$LOCAL_API"
|
||||
mkdir -p "$data_root/users/admin" "$data_root/system" "$data_root/tmp" "$recycle_root"
|
||||
mkdir -p "$data_root/apptunnel" "$data_root/mountremote" "$data_root/logs"
|
||||
mkdir -p "$apptunnel_config_dir"
|
||||
|
||||
# Do not set LINKEASE_CONFIG on OpenWrt. That variable belongs to
|
||||
# Docker/file-backend deployments where users explicitly mount
|
||||
# LINKEASE_CONFIG/preconfig.data. OpenWrt binding state is authoritative in
|
||||
# UCI and must be accessed through /usr/sbin/linkease-config.sh. This is
|
||||
# intentional: the user's data disk may be replaced, and the device must
|
||||
# still be able to recover its binding from flash-backed OpenWrt config.
|
||||
#
|
||||
# Do not export LINKEASE_APPTUNNEL_PRECONFIG_SCRIPT or
|
||||
# LINKEASE_APPTUNNEL_DEFAULT_ROOT_DIR here. Different devices have different
|
||||
# storage roots, and hard-coded env wiring can pin apptunnel to a removed
|
||||
# disk. The embedded clientruntime must discover linkease-config.sh and call
|
||||
# local_load/local_save-compatible business APIs for the current root.
|
||||
|
||||
procd_open_instance linkeasefull
|
||||
procd_set_param limits nofile="65535 65535"
|
||||
procd_set_param command "$PROG"
|
||||
procd_set_param env \
|
||||
"SERVER_HOST=0.0.0.0" \
|
||||
"SERVER_PORT=$LINKEASE_FULL_PORT" \
|
||||
"SERVER_MODE=release" \
|
||||
"SERVER_BASE_PATH=$LINKEASE_BASE_PATH" \
|
||||
"LINKEASE_AUTH_PROVIDER=openwrt_luci" \
|
||||
"LINKEASE_EDITION=nas-full" \
|
||||
"KAIPLUS_ENABLED=0" \
|
||||
"LINKEASE_DATA_ROOT=$data_root" \
|
||||
"LINKEASE_RECYCLE_ROOT=$recycle_root" \
|
||||
"LINKEASE_APPTUNNEL_INTERNAL_ADDR=127.0.0.1:19810" \
|
||||
"LINKEASE_APPTUNNEL_LEGACY_ADDR=$LINKEASE_LEGACY_ADDR" \
|
||||
"LINKEASE_APPTUNNEL_LOCAL_API=$LOCAL_API" \
|
||||
"LINKEASE_APPTUNNEL_CONFIG_DIR=$apptunnel_config_dir" \
|
||||
"LINKEASE_APPTUNNEL_DATA_DIR=$data_root/apptunnel" \
|
||||
"LINKEASE_APPTUNNEL_CACHE_DIR=$data_root/apptunnel/cache" \
|
||||
"LINKEASE_APPTUNNEL_RUNTIME_DIR=$data_root/apptunnel/runtime" \
|
||||
"LINKEASE_APPTUNNEL_LOG_DIR=$data_root/logs" \
|
||||
"APPTUNNEL_MOUNTREMOTE_MODE=real" \
|
||||
"APPTUNNEL_MOUNTREMOTE_LINKREMOTE_AGENT_BINARY=/usr/bin/linkremote-agent" \
|
||||
"APPTUNNEL_MOUNTREMOTE_SMBD_BINARY=$LINKEASE_LIBEXEC/linkmount_bin/linkmount_bin" \
|
||||
"APPTUNNEL_MOUNTREMOTE_WORK_DIR=$data_root/mountremote" \
|
||||
"APPTUNNEL_MOUNTREMOTE_SOCKET_DIR=$data_root/mountremote" \
|
||||
"APPTUNNEL_MOUNTREMOTE_SAMBA_DIR=$data_root/mountremote/samba" \
|
||||
"APPTUNNEL_MOUNTREMOTE_STORE_PATH=$data_root/mountremote/mounts.json" \
|
||||
"APPTUNNEL_MOUNTREMOTE_STARTUP_RECONCILE=true" \
|
||||
"APPTUNNEL_MOUNTREMOTE_ROOT_WATCH_DIR=$data_root/mountremote/root-watch" \
|
||||
"APPTUNNEL_MOUNTREMOTE_ALLOWED_MOUNT_PREFIX=$data_root_parent" \
|
||||
"MOUNTREMOTE_ALLOWED_MOUNT_PREFIX=$data_root_parent" \
|
||||
"LINKEASE_LINKMOUNT_BIN=$LINKEASE_LIBEXEC/linkmount_bin/linkmount_bin" \
|
||||
"LINKEASE_LINKMOUNT_LIB_DIR=$LINKEASE_LIBEXEC/linkmount_bin/lib" \
|
||||
"USER_DATA_PATH=$data_root/users/admin" \
|
||||
"SYSTEM_DATA_PATH=$data_root/system" \
|
||||
"TEMP_PATH=$data_root/tmp"
|
||||
procd_set_param respawn
|
||||
procd_set_param stdout 1
|
||||
procd_set_param stderr 1
|
||||
procd_close_instance
|
||||
}
|
||||
|
||||
service_triggers() {
|
||||
procd_add_reload_trigger "linkeasefull"
|
||||
}
|
||||
@@ -0,0 +1,36 @@
|
||||
#!/bin/sh
|
||||
[ ! -f "/usr/share/ucitrack/luci-app-linkeasefull.json" ] && {
|
||||
cat > /usr/share/ucitrack/luci-app-linkeasefull.json << EEOF
|
||||
{
|
||||
"config": "linkeasefull",
|
||||
"init": "linkeasefull"
|
||||
}
|
||||
EEOF
|
||||
}
|
||||
|
||||
if ! uci -q get linkeasefull.@linkeasefull[0] >/dev/null; then
|
||||
uci -q add linkeasefull linkeasefull >/dev/null
|
||||
fi
|
||||
|
||||
set_default() {
|
||||
key="$1"
|
||||
value="$2"
|
||||
current="$(uci -q get "linkeasefull.@linkeasefull[0].$key" 2>/dev/null || true)"
|
||||
[ -n "$current" ] && return 0
|
||||
uci -q set "linkeasefull.@linkeasefull[0].$key=$value"
|
||||
}
|
||||
|
||||
set_default enabled 1
|
||||
uci -q commit linkeasefull
|
||||
|
||||
uci -q batch <<-EOF >/dev/null
|
||||
delete ucitrack.@linkeasefull[-1]
|
||||
add ucitrack linkeasefull
|
||||
set ucitrack.@linkeasefull[-1].init=linkeasefull
|
||||
commit ucitrack
|
||||
EOF
|
||||
|
||||
/etc/init.d/linkeasefull enable
|
||||
/etc/init.d/linkeasefull restart
|
||||
|
||||
exit 0
|
||||
Reference in new issue
Block a user