mirror of
https://github.com/caiwx86/small-packages.git
synced 2026-10-30 14:45:13 +08:00
update 2026-07-28 01:38:11
This commit is contained in:
1 parent
20b786ab77
commit
25d570431d
6243 files changed
+2850542
No files matched your search
@@ -0,0 +1,68 @@
|
||||
# SPDX-License-Identifier: GPL-3.0-only
|
||||
#
|
||||
# Copyright (C) 2024 op.dllkids.xyz
|
||||
|
||||
include $(TOPDIR)/rules.mk
|
||||
|
||||
PKG_NAME:=filebrowser
|
||||
PKG_VERSION:=2.63.21
|
||||
PKG_RELEASE:=1
|
||||
|
||||
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
|
||||
PKG_SOURCE_URL:=https://codeload.github.com/filebrowser/filebrowser/tar.gz/v${PKG_VERSION}?
|
||||
PKG_HASH:=d936b7da78f0aaf987ff195a2dd4159a1f4ffaf85df83876d5243336e1790081
|
||||
|
||||
PKG_LICENSE:=Apache-2.0
|
||||
PKG_LICENSE_FILES:=LICENSE
|
||||
PKG_MAINTAINER:=kenzo <kenzok8@gmail.com>
|
||||
|
||||
PKG_BUILD_DEPENDS:=golang/host node/host
|
||||
PKG_BUILD_PARALLEL:=1
|
||||
PKG_USE_MIPS16:=0
|
||||
PKG_BUILD_FLAGS:=no-mips16
|
||||
|
||||
GO_PKG:=github.com/filebrowser/filebrowser
|
||||
GO_PKG_LDFLAGS_X:= \
|
||||
$(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
|
||||
|
||||
define Package/filebrowser
|
||||
SECTION:=utils
|
||||
CATEGORY:=Utilities
|
||||
TITLE:=Web File Browser
|
||||
URL:=https://github.com/filebrowser/filebrowser
|
||||
DEPENDS:=$(GO_ARCH_DEPENDS)
|
||||
endef
|
||||
|
||||
define Package/filebrowser/description
|
||||
filebrowser provides a file managing interface within a specified directory
|
||||
and it can be used to upload, delete, preview, rename and edit your files.
|
||||
It allows the creation of multiple users and each user can have its own directory.
|
||||
It can be used as a standalone app or as a middleware.
|
||||
endef
|
||||
|
||||
define Build/Compile
|
||||
( \
|
||||
pushd "$(PKG_BUILD_DIR)/frontend" ; \
|
||||
npm install -g pnpm ; \
|
||||
pnpm install --frozen-lockfile ; \
|
||||
pnpm run build ; \
|
||||
popd ; \
|
||||
$(call GoPackage/Build/Compile) ; \
|
||||
)
|
||||
endef
|
||||
|
||||
define Package/filebrowser/install
|
||||
$(call GoPackage/Package/Install/Bin,$(1))
|
||||
|
||||
$(INSTALL_DIR) $(1)/etc/config
|
||||
$(INSTALL_CONF) $(CURDIR)/files/filebrowser.config $(1)/etc/config/filebrowser
|
||||
$(INSTALL_DIR) $(1)/etc/init.d
|
||||
$(INSTALL_BIN) $(CURDIR)/files/filebrowser.init $(1)/etc/init.d/filebrowser
|
||||
endef
|
||||
|
||||
$(eval $(call GoBinPackage,filebrowser))
|
||||
$(eval $(call BuildPackage,filebrowser))
|
||||
@@ -0,0 +1,9 @@
|
||||
|
||||
config filebrowser 'config'
|
||||
option addr_type 'lan'
|
||||
option db_dir '/etc'
|
||||
option db_name 'filebrowser.db'
|
||||
option enabled '0'
|
||||
option port '8989'
|
||||
option root_dir '/'
|
||||
|
||||
Executable
+34
@@ -0,0 +1,34 @@
|
||||
#!/bin/sh /etc/rc.common
|
||||
# Copyright (C) 2021 ImmortalWrt
|
||||
|
||||
START=90
|
||||
STOP=10
|
||||
|
||||
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)"
|
||||
|
||||
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}"
|
||||
filebrowser -a "${addr}" -d "${db_dir}/${db_name}" -p "${port}" -r "${root_dir}" >/dev/null 2>&1 &
|
||||
}
|
||||
|
||||
stop() {
|
||||
echo "${db_dir}/${db_name}" > "/lib/upgrade/keep.d/filebrowser"
|
||||
killall -3 filebrowser >/dev/null 2>&1
|
||||
}
|
||||
Reference in new issue
Block a user