mirror of
https://github.com/kenzok8/small-package
synced 2025-11-18 01:01:34 +08:00
update 03-18 19:39
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
#
|
||||
# Copyright (C) 2020 Project OpenWrt
|
||||
# Copyright (C) 2021 ImmortalWrt
|
||||
# This is free software, licensed under the GNU General Public License v3.
|
||||
# See /LICENSE.txt for more information.
|
||||
#
|
||||
@@ -7,17 +7,17 @@
|
||||
include $(TOPDIR)/rules.mk
|
||||
|
||||
PKG_NAME:=filebrowser
|
||||
PKG_VERSION:=2.6.2
|
||||
PKG_VERSION:=2.21.1
|
||||
PKG_RELEASE:=1
|
||||
|
||||
PKG_SOURCE_PROTO:=git
|
||||
PKG_SOURCE_VERSION:=be8683f
|
||||
PKG_SOURCE_VERSION:=b73d278
|
||||
PKG_SOURCE_URL:=https://github.com/filebrowser/filebrowser
|
||||
PKG_MIRROR_HASH:=skip
|
||||
|
||||
PKG_LICENSE:=Apache-2.0
|
||||
PKG_LICENSE_FILES:=LICENSE.txt
|
||||
PKG_MAINTAINER:=CN_SZTL <cnsztl@project-openwrt.eu.org>
|
||||
PKG_LICENSE_FILES:=LICENSE
|
||||
PKG_MAINTAINER:=CN_SZTL <cnsztl@immortalwrt.org>
|
||||
|
||||
PKG_BUILD_DEPENDS:=golang/host node/host
|
||||
PKG_BUILD_PARALLEL:=1
|
||||
@@ -30,8 +30,8 @@ PKG_CONFIG_DEPENDS:= \
|
||||
GO_PKG:=github.com/filebrowser/filebrowser
|
||||
GO_PKG_LDFLAGS:=-s -w
|
||||
GO_PKG_LDFLAGS_X:= \
|
||||
github.com/filebrowser/filebrowser/v2/version.CommitSHA=$(PKG_SOURCE_VERSION) \
|
||||
github.com/filebrowser/filebrowser/v2/version.Version=$(PKG_VERSION)
|
||||
$(GO_PKG)/v2/version.CommitSHA=$(PKG_SOURCE_VERSION) \
|
||||
$(GO_PKG)/v2/version.Version=v$(PKG_VERSION)
|
||||
|
||||
include $(INCLUDE_DIR)/package.mk
|
||||
include $(TOPDIR)/feeds/packages/lang/golang/golang-package.mk
|
||||
@@ -39,7 +39,7 @@ include $(TOPDIR)/feeds/packages/lang/golang/golang-package.mk
|
||||
define Package/filebrowser
|
||||
SECTION:=utils
|
||||
CATEGORY:=Utilities
|
||||
TITLE:=Web File Browser which can be used as a middleware or standalone app.
|
||||
TITLE:=Web File Browser
|
||||
URL:=https://github.com/filebrowser/filebrowser
|
||||
DEPENDS:=$(GO_ARCH_DEPENDS)
|
||||
endef
|
||||
@@ -58,28 +58,23 @@ config FILEBROWSER_COMPRESS_GOPROXY
|
||||
|
||||
config FILEBROWSER_COMPRESS_UPX
|
||||
bool "Compress executable files with UPX"
|
||||
default y
|
||||
depends on !mips64
|
||||
default n
|
||||
endef
|
||||
|
||||
ifeq ($(CONFIG_FILEBROWSER_COMPRESS_GOPROXY),y)
|
||||
export GO111MODULE=on
|
||||
export GOPROXY=https://goproxy.cn
|
||||
export GOPROXY=https://goproxy.bj.bcebos.com
|
||||
endif
|
||||
|
||||
define Build/Compile
|
||||
( \
|
||||
cd $(PKG_BUILD_DIR) ; \
|
||||
rm -rf frontend/dist ; \
|
||||
rm -f http/rice-box.go ; \
|
||||
cd $(PKG_BUILD_DIR)/frontend ; \
|
||||
npm ci; \
|
||||
npm run lint ; \
|
||||
npm run build ; \
|
||||
GOOS=$$$$(go env GOOS) GOARCH=$$$$(go env GOARCH) GO111MODULE=off go get -v github.com/GeertJohan/go.rice/rice/... ; \
|
||||
cd $(PKG_BUILD_DIR)/http ; \
|
||||
"$$$$(go env GOPATH)/bin/rice" embed-go ; \
|
||||
$(call GoPackage/Build/Compile) ; \
|
||||
)
|
||||
$(call GoPackage/Build/Compile)
|
||||
ifeq ($(CONFIG_FILEBROWSER_COMPRESS_UPX),y)
|
||||
$(STAGING_DIR_HOST)/bin/upx --lzma --best $(GO_PKG_BUILD_BIN_DIR)/filebrowser
|
||||
endif
|
||||
|
||||
@@ -1,61 +1,34 @@
|
||||
#!/bin/sh /etc/rc.common
|
||||
# Copyright (C) 2019 [CTCGFW] Project OpenWRT
|
||||
# Copyright (C) 2021 ImmortalWrt
|
||||
|
||||
. /lib/functions.sh
|
||||
. /lib/functions/procd.sh
|
||||
|
||||
USE_PROCD=1
|
||||
|
||||
START=99
|
||||
START=90
|
||||
STOP=10
|
||||
|
||||
init_conf() {
|
||||
config_load "filebrowser"
|
||||
config_get "addr_type" "config" "addr_type" "lan"
|
||||
config_get "db_dir" "config" "db_dir" "/etc"
|
||||
[ "${db_dir}" == "/" ] || db_dir="${db_dir%*/}"
|
||||
config_get "db_name" "config" "db_name" "filebrowser.db"
|
||||
db_name="$(uci get filebrowser.config.db_name| sed 's#/##g')"
|
||||
config_get "enabled" "config" "enabled" "0"
|
||||
config_get "port" "config" "port" "8989"
|
||||
config_get "root_dir" "config" "root_dir" "/"
|
||||
}
|
||||
addr_type="$(uci get filebrowser.config.addr_type)"
|
||||
db_dir="$(uci get filebrowser.config.db_dir)"
|
||||
[ "${db_dir}" == "/" ] || db_dir="${db_dir%*/}"
|
||||
db_name="$(uci get filebrowser.config.db_name| sed 's#/##g')"
|
||||
enabled="$(uci get filebrowser.config.enabled)"
|
||||
port="$(uci get filebrowser.config.port)"
|
||||
root_dir="$(uci get filebrowser.config.root_dir)"
|
||||
|
||||
start_service() {
|
||||
init_conf
|
||||
[ "${enabled}" == "1" ] || exit 0
|
||||
procd_open_instance filebrowser
|
||||
if [ "${addr_type}" == "local" ];then
|
||||
addr="127.0.0.1"
|
||||
elif [ "${addr_type}" == "lan" ];then
|
||||
addr="$(uci get network.lan.ipaddr)"
|
||||
elif [ "${addr_type}" == "wan" ];then
|
||||
addr="0.0.0.0"
|
||||
fi
|
||||
|
||||
start() {
|
||||
stop
|
||||
[ "$enabled" == "1" ] || exit 0
|
||||
mkdir -p "${root_dir}"
|
||||
mkdir -p "${db_dir}"
|
||||
|
||||
if [ "${addr_type}" == "local" ];then
|
||||
addr="127.0.0.1"
|
||||
elif [ "${addr_type}" == "lan" ];then
|
||||
addr="$(uci get network.lan.ipaddr)"
|
||||
elif [ "${addr_type}" == "wan" ];then
|
||||
addr="0.0.0.0"
|
||||
fi
|
||||
|
||||
procd_set_param command filebrowser
|
||||
procd_append_param command -a "${addr}"
|
||||
procd_append_param command -d "${db_dir}/${db_name}"
|
||||
procd_append_param command -p "${port}"
|
||||
procd_append_param command -r "${root_dir}"
|
||||
procd_set_param respawn ${respawn_threshold:-3600} ${respawn_timeout:-5} ${respawn_retry:-5}
|
||||
procd_close_instance
|
||||
filebrowser -a "${addr}" -d "${db_dir}/${db_name}" -p "${port}" -r "${root_dir}" >/dev/null 2>&1 &
|
||||
}
|
||||
|
||||
stop_service(){
|
||||
init_conf
|
||||
stop() {
|
||||
echo "${db_dir}/${db_name}" > "/lib/upgrade/keep.d/filebrowser"
|
||||
}
|
||||
|
||||
reload_service()
|
||||
{
|
||||
stop
|
||||
start
|
||||
}
|
||||
|
||||
service_triggers() {
|
||||
procd_add_reload_trigger "filebrowser"
|
||||
killall -9 filebrowser >/dev/null 2>&1
|
||||
}
|
||||
|
||||
@@ -9,8 +9,9 @@ LUCI_TITLE:=LuCI support for quickstart
|
||||
LUCI_DEPENDS:=+quickstart +shadow-utils +shadow-useradd +luci-app-store
|
||||
LUCI_PKGARCH:=all
|
||||
|
||||
PKG_VERSION:=0.3.1
|
||||
PKG_RELEASE:=1
|
||||
PKG_VERSION:=0.3.1-2
|
||||
# PKG_RELEASE MUST be empty for luci.mk
|
||||
PKG_RELEASE:=
|
||||
|
||||
include $(TOPDIR)/feeds/luci/luci.mk
|
||||
|
||||
|
||||
@@ -7,7 +7,7 @@
|
||||
</script>
|
||||
<div id="app">
|
||||
</div>
|
||||
<script type="module" crossorigin src="/luci-static/quickstart/index.js"></script>
|
||||
<link rel="modulepreload" href="/luci-static/quickstart/vendor.js">
|
||||
<link rel="stylesheet" href="/luci-static/quickstart/style.css">
|
||||
<script type="module" crossorigin src="/luci-static/quickstart/index.js<%# ?v=PKG_VERSION %>"></script>
|
||||
<link rel="modulepreload" href="/luci-static/quickstart/vendor.js<%# ?v=PKG_VERSION %>">
|
||||
<link rel="stylesheet" href="/luci-static/quickstart/style.css<%# ?v=PKG_VERSION %>">
|
||||
<%+footer%>
|
||||
|
||||
@@ -10,8 +10,9 @@ LUCI_DESCRIPTION:=luci-app-store is a ipk store developed by LinkEase team
|
||||
LUCI_DEPENDS:=+curl +opkg +luci-base +tar +coreutils +coreutils-stat +libuci-lua +mount-utils
|
||||
LUCI_PKGARCH:=all
|
||||
|
||||
PKG_VERSION:=0.1.8
|
||||
PKG_RELEASE:=6
|
||||
PKG_VERSION:=0.1.8-6
|
||||
# PKG_RELEASE MUST be empty for luci.mk
|
||||
PKG_RELEASE:=
|
||||
|
||||
ISTORE_UI_VERSION:=1.0
|
||||
ISTORE_UI_RELEASE:=11
|
||||
@@ -23,7 +24,7 @@ PKG_SOURCE_URL:=https://github.com/linkease/istore-ui/archive/refs/tags
|
||||
|
||||
PKG_MAINTAINER:=jjm2473 <jjm2473@gmail.com>
|
||||
|
||||
TARGET_CONFIGURE_OPTS= FRONTEND_DIST="$(BUILD_DIR)/istore-ui-$(ISTORE_UI_VERSION)-$(ISTORE_UI_RELEASE)/app-store-ui/src/dist" APP_STORE_VERSION="$(PKG_VERSION)-$(PKG_RELEASE)"
|
||||
TARGET_CONFIGURE_OPTS= FRONTEND_DIST="$(BUILD_DIR)/istore-ui-$(ISTORE_UI_VERSION)-$(ISTORE_UI_RELEASE)/app-store-ui/src/dist" APP_STORE_VERSION="$(PKG_VERSION)"
|
||||
TARGET_CONFIGURE_OPTS+= SED="$(SED)"
|
||||
|
||||
define Package/luci-app-store/conffiles
|
||||
|
||||
Reference in New Issue
Block a user