mirror of
https://github.com/kiddin9/op-packages.git
synced 2026-11-01 05:13:56 +08:00
✨ Sync 2026-08-20 17:28:50
This commit is contained in:
1 parent
2a2f7e4252
commit
6b1fd2d7c3
22 files changed
+268
-226
No files matched your search
@@ -10,8 +10,8 @@ PKG_ARCH_LINKEASE:=$(ARCH)
|
||||
|
||||
PKG_NAME:=linkeasefull
|
||||
# use PKG_SOURCE_DATE instead of PKG_VERSION for compitable
|
||||
PKG_SOURCE_DATE:=3.0.5
|
||||
PKG_RELEASE:=10
|
||||
PKG_SOURCE_DATE:=3.0.11
|
||||
PKG_RELEASE:=11
|
||||
|
||||
ARCH_HEXCODE:=
|
||||
ifeq ($(ARCH),x86_64)
|
||||
@@ -24,7 +24,7 @@ LINKEASE_RUNTIME_ARCH:=arm64
|
||||
PKG_HASH:=skip
|
||||
endif
|
||||
|
||||
PKG_SOURCE_VERSION:=e0457eac600cd37b128eddf251ff9344702b1d03
|
||||
PKG_SOURCE_VERSION:=1d2184f103526f9427259c2aba880486cbd930fd
|
||||
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)
|
||||
@@ -39,7 +39,7 @@ define Package/$(PKG_NAME)
|
||||
CATEGORY:=Network
|
||||
SUBMENU:=Web Servers/Proxies
|
||||
TITLE:=LinkEase Full - the local web desktop
|
||||
DEPENDS:=@(x86_64||aarch64) +linkease-common-bin +ca-bundle
|
||||
DEPENDS:=@(x86_64||aarch64) +linkease-common-bin +ca-bundle +cifsmount +kmod-fs-cifs
|
||||
PKGARCH:=all
|
||||
URL:=https://www.linkease.com/
|
||||
endef
|
||||
|
||||
@@ -1,3 +1,2 @@
|
||||
config linkeasefull
|
||||
option enabled '1'
|
||||
option data_root_parent ''
|
||||
@@ -5,49 +5,51 @@ 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
|
||||
DATA_ROOT_WAIT_SECONDS=${LINKEASEFULL_DATA_ROOT_WAIT_SECONDS:-60}
|
||||
|
||||
is_persistent_data_root_parent() {
|
||||
ensure_linkease_config() {
|
||||
if [ ! -f /etc/config/linkease ]; then
|
||||
touch /etc/config/linkease || return 1
|
||||
fi
|
||||
if ! uci -q get linkease.@linkease[0] >/dev/null; then
|
||||
uci -q add linkease linkease >/dev/null || return 1
|
||||
uci -q set linkease.@linkease[0].enabled='0' || return 1
|
||||
uci -q set linkease.@linkease[0].port='8897' || return 1
|
||||
uci -q set linkease.@linkease[0].allowPublic='0' || return 1
|
||||
uci -q commit linkease || return 1
|
||||
fi
|
||||
}
|
||||
|
||||
is_allowed_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
|
||||
wait_for_data_root_parent() {
|
||||
is_allowed_data_root_parent "$1" || return 1
|
||||
wait_left="$DATA_ROOT_WAIT_SECONDS"
|
||||
case "$wait_left" in
|
||||
""|*[!0-9]*) wait_left=60 ;;
|
||||
esac
|
||||
while [ "$wait_left" -gt 0 ]; do
|
||||
[ -d "$1" ] && return 0
|
||||
sleep 1
|
||||
wait_left=$((wait_left - 1))
|
||||
done
|
||||
[ -d "$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
|
||||
is_persistent_data_root_parent() {
|
||||
is_allowed_data_root_parent "$1" || return 1
|
||||
[ -d "$1" ] || return 1
|
||||
return 0
|
||||
}
|
||||
|
||||
linkease_enabled() {
|
||||
@@ -57,15 +59,20 @@ linkease_enabled() {
|
||||
read_config() {
|
||||
section="$1"
|
||||
config_get_bool enabled "$section" enabled 1
|
||||
config_get data_root_parent "$section" data_root_parent ""
|
||||
ensure_linkease_config || true
|
||||
data_root_parent="$(uci -q get linkease.@linkease[0].local_home 2>/dev/null || true)"
|
||||
|
||||
if ! resolve_data_root_parent; then
|
||||
if [ -n "$data_root_parent" ] && ! wait_for_data_root_parent "$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"
|
||||
if [ -n "$data_root_parent" ] && ! is_persistent_data_root_parent "$data_root_parent"; then
|
||||
data_root_parent=""
|
||||
fi
|
||||
if [ -n "$data_root_parent" ]; then
|
||||
data_root="$data_root_parent/.linkease_data"
|
||||
recycle_root="$data_root_parent/.linkease_recycle"
|
||||
fi
|
||||
log_root="/tmp/linkeasefull/logs"
|
||||
}
|
||||
|
||||
start_service() {
|
||||
@@ -77,16 +84,15 @@ start_service() {
|
||||
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"
|
||||
if [ -n "$data_root_parent" ]; then
|
||||
mkdir -p "$data_root/users/admin" "$data_root/system" "$data_root/tmp" "$recycle_root"
|
||||
mkdir -p "$data_root/config" "$data_root/apptunnel" "$data_root/mountremote"
|
||||
else
|
||||
echo "linkeasefull: data root is not initialized; starting for first-run setup" >&2
|
||||
fi
|
||||
mkdir -p "$log_root"
|
||||
|
||||
# Do not set LINKEASE_CONFIG on OpenWrt. That variable belongs to
|
||||
# Docker/file-backend deployments where users explicitly mount
|
||||
@@ -103,41 +109,16 @@ start_service() {
|
||||
|
||||
procd_open_instance linkeasefull
|
||||
procd_set_param limits nofile="65535 65535"
|
||||
procd_set_param command "$PROG"
|
||||
procd_set_param command "$PROG" \
|
||||
--host "0.0.0.0" \
|
||||
--port "$LINKEASE_FULL_PORT" \
|
||||
--mode "release" \
|
||||
--basePath "$LINKEASE_BASE_PATH" \
|
||||
--deviceAddr "$LINKEASE_LEGACY_ADDR" \
|
||||
--localApi "$LOCAL_API" \
|
||||
--supplierCode "linkease"
|
||||
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"
|
||||
"KAIPLUS_ENABLED=0"
|
||||
procd_set_param respawn
|
||||
procd_set_param stdout 1
|
||||
procd_set_param stderr 1
|
||||
|
||||
@@ -31,6 +31,5 @@ uci -q batch <<-EOF >/dev/null
|
||||
EOF
|
||||
|
||||
/etc/init.d/linkeasefull enable
|
||||
/etc/init.d/linkeasefull restart
|
||||
|
||||
exit 0
|
||||
Reference in new issue
Block a user