Merge pull request #8 from jjm2473/master

默认禁用防火墙开放规则;使用预编译的前端页面,避免费时的nodejs编译
This commit is contained in:
Bard 2022-06-15 17:55:42 +08:00 committed by GitHub
commit eb4ee0ccc0
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 11 additions and 20 deletions

View File

@ -9,7 +9,7 @@ include $(TOPDIR)/rules.mk
PKG_NAME:=alist PKG_NAME:=alist
PKG_VERSION:=2.6.1 PKG_VERSION:=2.6.1
PKG_WEB_VERSION:=2.6.0 PKG_WEB_VERSION:=2.6.0
PKG_RELEASE:=1 PKG_RELEASE:=2
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
PKG_SOURCE_URL:=https://codeload.github.com/alist-org/alist/tar.gz/v$(PKG_VERSION)? PKG_SOURCE_URL:=https://codeload.github.com/alist-org/alist/tar.gz/v$(PKG_VERSION)?
@ -21,14 +21,14 @@ PKG_MAINTAINER:=sbwml <admin@cooluc.com>
define Download/$(PKG_NAME)-web define Download/$(PKG_NAME)-web
FILE:=$(PKG_NAME)-web-$(PKG_WEB_VERSION).tar.gz FILE:=$(PKG_NAME)-web-$(PKG_WEB_VERSION).tar.gz
URL_FILE:=$(PKG_WEB_VERSION).tar.gz URL_FILE:=dist.tar.gz
URL:=https://github.com/alist-org/alist-web/archive/refs/tags/ URL:=https://github.com/alist-org/alist-web/releases/download/$(PKG_WEB_VERSION)/
HASH:=a0a18b3329596d149ac0598c8aa5328d0dd42fb41c2f6b1b0182ebde205b69f2 HASH:=d11099a302cf2c4be54f56c79aa77838c4d1ede487bc42f0c8a6cca9588971f2
endef endef
PKG_CONFIG_DEPENDS:=CONFIG_ALIST_COMPRESS_UPX PKG_CONFIG_DEPENDS:=CONFIG_ALIST_COMPRESS_UPX
PKG_BUILD_DEPENDS:=golang/host node/host node-yarn/host PKG_BUILD_DEPENDS:=golang/host
PKG_BUILD_PARALLEL:=1 PKG_BUILD_PARALLEL:=1
PKG_USE_MIPS16:=0 PKG_USE_MIPS16:=0
@ -77,19 +77,13 @@ endef
define Build/Prepare define Build/Prepare
$(call Build/Prepare/Default) $(call Build/Prepare/Default)
$(eval $(call Download,$(PKG_NAME)-web))
$(TAR) --strip-components=1 -C $(PKG_BUILD_DIR)/public -xzf $(DL_DIR)/$(PKG_NAME)-web-$(PKG_WEB_VERSION).tar.gz
$(CP) ./files/assets/. $(PKG_BUILD_DIR)/public/assets/
endef endef
define Build/Compile define Build/Compile
( \ $(call GoPackage/Build/Compile)
pushd $(PKG_BUILD_DIR) ; \
tar -zxvf $(DL_DIR)/$(PKG_NAME)-web-$(PKG_WEB_VERSION).tar.gz -C ./ ; \
cd alist-web-$(PKG_WEB_VERSION) ; \
yarn && yarn build ; \
cp -ax dist/* ../public/ ; \
cp -ax $(CURDIR)/files/assets/* ../public/assets/ ; \
popd ; \
$(call GoPackage/Build/Compile) ; \
)
ifneq ($(CONFIG_ALIST_COMPRESS_UPX),) ifneq ($(CONFIG_ALIST_COMPRESS_UPX),)
$(STAGING_DIR_HOST)/bin/upx --lzma --best $(GO_PKG_BUILD_BIN_DIR)/alist $(STAGING_DIR_HOST)/bin/upx --lzma --best $(GO_PKG_BUILD_BIN_DIR)/alist
endif endif
@ -104,6 +98,5 @@ define Package/$(PKG_NAME)/install
$(INSTALL_CONF) ./files/data.db $(1)/etc/alist/data.db $(INSTALL_CONF) ./files/data.db $(1)/etc/alist/data.db
endef endef
$(eval $(call Download,$(PKG_NAME)-web))
$(eval $(call GoBinPackage,$(PKG_NAME))) $(eval $(call GoBinPackage,$(PKG_NAME)))
$(eval $(call BuildPackage,$(PKG_NAME))) $(eval $(call BuildPackage,$(PKG_NAME)))

View File

@ -13,10 +13,8 @@ uci -q batch <<-EOF >/dev/null
set firewall.alist.src="wan" set firewall.alist.src="wan"
set firewall.alist.proto="tcp" set firewall.alist.proto="tcp"
set firewall.alist.dest_port="5244" set firewall.alist.dest_port="5244"
set firewall.alist.enabled="0"
commit firewall commit firewall
EOF EOF
/etc/init.d/alist enable
/etc/init.d/alist start
exit 0 exit 0