openlist: move from alist and update to 4.0.5
authorTianling Shen <[email protected]>
Sun, 29 Jun 2025 08:48:11 +0000 (16:48 +0800)
committerTianling Shen <[email protected]>
Mon, 30 Jun 2025 17:04:08 +0000 (01:04 +0800)
The alist was sold to a Chinese commercial company by the project owner
without any clarification. Though the company bought it nearly a half
year ago, they still cannot show a clear roadmap and privacy policy now.
They also tried to collect runtime information from the user, but the
code was not merged into the main tree "luckily".

Anyway, various behaviors from the company indicate they are untrustable,
so the other developers from the alist project have forked and made a new
project named OpenList, which will continue to be maintained by the community.

===== security note =====
The alist code up to 3.45.0 has been reviewed "clean", however the main
problem is from the author's private API that used to connect to cloud drives.
For security reasons, please reset your password and/or token if possible.

Signed-off-by: Tianling Shen <[email protected]>
net/alist/Makefile [deleted file]
net/alist/files/alist.config [deleted file]
net/alist/files/alist.init [deleted file]
net/alist/test.sh [deleted file]
net/openlist/Makefile [new file with mode: 0644]
net/openlist/files/openlist.config [new file with mode: 0644]
net/openlist/files/openlist.init [new file with mode: 0644]
net/openlist/files/openlist.uci [new file with mode: 0644]
net/openlist/test.sh [new file with mode: 0644]

diff --git a/net/alist/Makefile b/net/alist/Makefile
deleted file mode 100644 (file)
index b4b16aa..0000000
+++ /dev/null
@@ -1,88 +0,0 @@
-# SPDX-License-Identifier: GPL-2.0-only
-#
-# Copyright (C) 2023 ImmortalWrt.org
-
-include $(TOPDIR)/rules.mk
-
-PKG_NAME:=alist
-PKG_VERSION:=3.45.0
-PKG_RELEASE:=1
-
-PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
-PKG_SOURCE_URL:=https://codeload.github.com/AlistGo/alist/tar.gz/v$(PKG_VERSION)?
-PKG_HASH:=224119ea5a3b43694e5342c460ab471d6477db1bf7ade5180d542a32363cb097
-
-PKG_LICENSE:=AGPL-3.0-only
-PKG_LICENSE_FILES:=LICENSE
-PKG_MAINTAINER:=Tianling Shen <[email protected]>
-
-PKG_BUILD_DEPENDS:=golang/host
-PKG_BUILD_PARALLEL:=1
-PKG_BUILD_FLAGS:=no-mips16
-
-GO_PKG:=github.com/alist-org/alist/v3
-GO_PKG_LDFLAGS_X = \
-       $(GO_PKG)/internal/conf.Version=$(PKG_VERSION) \
-       $(GO_PKG)/internal/conf.WebVersion=$(WEB_VERSION)
-ifeq ($(filter aarch64 x86_64, $(ARCH)),)
-  GO_PKG_EXCLUDES:=drivers/lark
-endif
-
-include $(INCLUDE_DIR)/package.mk
-include ../../lang/golang/golang-package.mk
-
-define Package/alist
-  SECTION:=net
-  CATEGORY:=Network
-  TITLE:=A file list program that supports multiple storage
-  URL:=https://alist.nn.ci
-  DEPENDS:=$(GO_ARCH_DEPENDS) +ca-bundle +fuse-utils
-endef
-
-define Package/alist/description
-  A file list program that supports multiple storage, and supports
-  web browsing and webdav, powered by gin and Solidjs.
-endef
-
-define Package/alist/conffiles
-/etc/alist/
-/etc/config/alist
-endef
-
-WEB_VERSION:=3.45.0
-WEB_FILE:=$(PKG_NAME)-web-$(WEB_VERSION).tar.gz
-define Download/alist-web
-       URL:=https://github.com/AlistGo/alist-web/releases/download/$(WEB_VERSION)/
-       URL_FILE:=dist.tar.gz
-       FILE:=$(WEB_FILE)
-       HASH:=408b1822893ba6dd6bbeb4055d6c8b96c178d10f4fbb8e5696cf14dcc88dd2fb
-endef
-
-define Build/Prepare
-       $(call Build/Prepare/Default)
-
-       ( \
-               mkdir -p $(PKG_BUILD_DIR)/public ; \
-               gzip -dc $(DL_DIR)/$(WEB_FILE) | $(HOST_TAR) -C $(PKG_BUILD_DIR)/public $(TAR_OPTIONS) ; \
-       )
-endef
-
-ifneq ($(CONFIG_USE_MUSL),)
-  TARGET_CFLAGS += -D_LARGEFILE64_SOURCE
-endif
-
-define Package/alist/install
-       $(call GoPackage/Package/Install/Bin,$(PKG_INSTALL_DIR))
-
-       $(INSTALL_DIR) $(1)/usr/bin/
-       $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/alist $(1)/usr/bin/
-
-       $(INSTALL_DIR) $(1)/etc/config
-       $(INSTALL_CONF) $(CURDIR)/files/alist.config $(1)/etc/config/alist
-       $(INSTALL_DIR) $(1)/etc/init.d
-       $(INSTALL_BIN) $(CURDIR)/files/alist.init $(1)/etc/init.d/alist
-endef
-
-$(eval $(call Download,alist-web))
-$(eval $(call GoBinPackage,alist))
-$(eval $(call BuildPackage,alist))
diff --git a/net/alist/files/alist.config b/net/alist/files/alist.config
deleted file mode 100644 (file)
index 5190366..0000000
+++ /dev/null
@@ -1,38 +0,0 @@
-
-config alist 'config'
-       option enabled '0'
-       option debug '0'
-
-       # listen
-       option listen_addr '0.0.0.0'
-       option listen_http_port '5244'
-       option listen_https_port '-1'
-       option listen_force_https '0'
-       option listen_cert_file ''
-       option listen_key_file ''
-       option listen_unix_file ''
-       option listen_unix_file_perm ''
-
-       # site
-       option site_url ''
-       option site_cdn ''
-       option site_login_expire '48'
-       option site_max_connections '0'
-       option site_tls_insecure '0'
-
-       # database
-       option db_type 'sqlite3'
-       option db_host ''
-       option db_port '0'
-       option db_user ''
-       option db_pass ''
-       option db_name ''
-       option db_table_prefix 'x_'
-       option db_ssl_mode ''
-
-       # log
-       option log_enable '1'
-       option log_max_size '5'
-       option log_max_backups '1'
-       option log_max_age '15'
-
diff --git a/net/alist/files/alist.init b/net/alist/files/alist.init
deleted file mode 100644 (file)
index a06e4e1..0000000
+++ /dev/null
@@ -1,113 +0,0 @@
-#!/bin/sh /etc/rc.common
-
-USE_PROCD=1
-START=99
-
-CONF="alist"
-PROG="/usr/bin/alist"
-CONF_DIR="/etc/$CONF"
-RUN_DIR="/var/run/$CONF"
-
-uci_json_add_boolean() {
-       local enabled
-       config_get_bool enabled "${4:-config}" "$2" "${3:-0}"
-       json_add_boolean "$1" "$enabled"
-}
-
-uci_json_add_int() {
-       local value
-       config_get value "${4:-config}" "$2" "${3:-0}"
-       json_add_int "$1" "$value"
-}
-
-uci_json_add_string() {
-       local value
-       config_get value "${4:-config}" "$2" $3
-       json_add_string "$1" "$value"
-}
-
-start_service() {
-       config_load "$CONF"
-
-       local enabled
-       config_get_bool enabled "config" "enabled" "0"
-       [ "$enabled" -eq "1" ] || return 1
-
-       local jwt_secret
-       jwt_secret="$(jsonfilter -qi "$CONF_DIR/config.json" -e "@.jwt_secret")"
-       [ -n "$jwt_secret" ] || jwt_secret="$(tr -cd "a-zA-Z0-9" < "/dev/urandom" | head -c16)"
-
-       mkdir -p "$CONF_DIR"
-       mkdir -p "$RUN_DIR"
-
-       json_init
-       json_add_boolean "force" "1"
-       uci_json_add_string "site_url" "site_url"
-       uci_json_add_string "cdn" "site_cdn"
-       json_add_string "jwt_secret" "$jwt_secret"
-       uci_json_add_int "token_expires_in" "site_login_expire" "48"
-       json_add_object "database"
-               uci_json_add_string "type" "db_type" "sqlite3"
-               uci_json_add_string "host" "db_host"
-               uci_json_add_int "port" "db_port"
-               uci_json_add_string "user" "db_user"
-               uci_json_add_string "password" "db_pass"
-               uci_json_add_string "name" "db_name"
-               json_add_string "db_file" "$CONF_DIR/data.db"
-               uci_json_add_string "table_prefix" "db_table_prefix" "x_"
-               uci_json_add_string "ssl_mode" "db_ssl_mode"
-       json_close_object
-       json_add_object "scheme"
-               uci_json_add_string "address" "listen_addr" "0.0.0.0"
-               uci_json_add_int "http_port" "listen_http_port" "5244"
-               uci_json_add_int "https_port" "listen_https_port" "-1"
-               uci_json_add_boolean "force_https" "listen_force_https"
-               uci_json_add_string "cert_file" "listen_cert_file"
-               uci_json_add_string "key_file" "listen_key_file"
-               uci_json_add_string "unix_file" "listen_unix_file"
-               uci_json_add_string "unix_file_perm" "listen_unix_file_perm"
-       json_close_object
-       json_add_string "temp_dir" "$RUN_DIR/temp"
-       json_add_string "bleve_dir" "$CONF_DIR/bleve"
-       json_add_object "log"
-               uci_json_add_boolean "enable" "log_enable" "1"
-               json_add_string "name" "$RUN_DIR/log/alist.log"
-               uci_json_add_int "max_size" "log_max_size" "5"
-               uci_json_add_int "max_backups" "log_max_backups" "1"
-               uci_json_add_int "max_age" "log_max_age" "15"
-               json_add_boolean "compress" "0"
-       json_close_object
-       json_add_int "delayed_start" "0"
-       uci_json_add_int "max_connections" "site_max_connections"
-       uci_json_add_boolean "tls_insecure_skip_verify" "site_tls_insecure"
-       json_dump > "$CONF_DIR/config.json"
-
-       local db_type
-       config_get db_type "config" "db_type" "sqlite3"
-       [ "$db_type" != "sqlite3" -o -e "$CONF_DIR/data.db" ] || "$PROG" --data "$CONF_DIR" admin set "password" 2>"/dev/null"
-
-       procd_open_instance
-       procd_set_param command "$PROG"
-       procd_append_param command server
-       procd_append_param command --data "$CONF_DIR"
-       procd_append_param command --no-prefix
-
-       local debug
-       config_get_bool debug "config" "debug" "0"
-       [ "$debug" -eq "0" ] || procd_append_param command --debug
-
-       procd_set_param limits core="unlimited"
-       procd_set_param limits nofile="1000000 1000000"
-       procd_set_param respawn
-       [ "$debug" -eq "0" ] || procd_set_param stderr 1
-
-       procd_close_instance
-}
-
-stop_service() {
-       rm -rf "$RUN_DIR"
-}
-
-service_triggers() {
-       procd_add_reload_trigger "$CONF"
-}
diff --git a/net/alist/test.sh b/net/alist/test.sh
deleted file mode 100644 (file)
index efcb07e..0000000
+++ /dev/null
@@ -1,3 +0,0 @@
-#!/bin/sh
-
-alist version | grep "$PKG_VERSION"
diff --git a/net/openlist/Makefile b/net/openlist/Makefile
new file mode 100644 (file)
index 0000000..0d589e5
--- /dev/null
@@ -0,0 +1,92 @@
+# SPDX-License-Identifier: GPL-2.0-only
+#
+# Copyright (C) 2023-2025 ImmortalWrt.org
+
+include $(TOPDIR)/rules.mk
+
+PKG_NAME:=openlist
+PKG_VERSION:=4.0.5
+PKG_RELEASE:=1
+
+PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
+PKG_SOURCE_URL:=https://codeload.github.com/OpenListTeam/OpenList/tar.gz/v$(PKG_VERSION)?
+PKG_HASH:=c510e31d00868774b52429897c39789547756bbea76c501e2bcfbff1f4dc70b8
+PKG_BUILD_DIR:=$(BUILD_DIR)/OpenList-$(PKG_VERSION)
+
+PKG_LICENSE:=AGPL-3.0-only
+PKG_LICENSE_FILES:=LICENSE
+PKG_MAINTAINER:=Tianling Shen <[email protected]>
+
+PKG_BUILD_DEPENDS:=golang/host
+PKG_BUILD_PARALLEL:=1
+PKG_BUILD_FLAGS:=no-mips16
+
+GO_PKG:=github.com/OpenListTeam/OpenList
+GO_PKG_LDFLAGS_X = \
+       $(GO_PKG)/internal/conf.Version=$(PKG_VERSION) \
+       $(GO_PKG)/internal/conf.WebVersion=$(WEB_VERSION)
+ifeq ($(filter aarch64 x86_64, $(ARCH)),)
+  GO_PKG_EXCLUDES:=drivers/lark
+endif
+
+include $(INCLUDE_DIR)/package.mk
+include ../../lang/golang/golang-package.mk
+
+define Package/openlist
+  SECTION:=net
+  CATEGORY:=Network
+  TITLE:=A file list program that supports multiple storage
+  URL:=https://docs.oplist.org
+  DEPENDS:=$(GO_ARCH_DEPENDS) +ca-bundle +fuse-utils
+  PROVIDES:=alist
+endef
+
+define Package/openlist/description
+  A file list program that supports multiple storage, and supports
+  web browsing and webdav, powered by gin and Solidjs, fork of AList.
+endef
+
+define Package/openlist/conffiles
+/etc/openlist/
+/etc/config/openlist
+endef
+
+WEB_VERSION:=4.0.5
+WEB_FILE:=$(PKG_NAME)-frontend-dist-v$(WEB_VERSION).tar.gz
+define Download/openlist-web
+       URL:=https://github.com/OpenListTeam/OpenList-Frontend/releases/download/v$(WEB_VERSION)/
+       URL_FILE:=$(WEB_FILE)
+       FILE:=$(WEB_FILE)
+       HASH:=0b755542c660ac66c86689957cd0d5c783ad5dac64222f764988f1c26c51d55a
+endef
+
+define Build/Prepare
+       $(call Build/Prepare/Default)
+
+       ( \
+               mkdir -p $(PKG_BUILD_DIR)/public/dist ; \
+               libdeflate-gzip -dc $(DL_DIR)/$(WEB_FILE) | $(HOST_TAR) -C $(PKG_BUILD_DIR)/public/dist $(TAR_OPTIONS) ; \
+       )
+endef
+
+ifneq ($(CONFIG_USE_MUSL),)
+  TARGET_CFLAGS += -D_LARGEFILE64_SOURCE
+endif
+
+define Package/openlist/install
+       $(call GoPackage/Package/Install/Bin,$(PKG_INSTALL_DIR))
+
+       $(INSTALL_DIR) $(1)/usr/bin/
+       $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/OpenList $(1)/usr/bin/openlist
+
+       $(INSTALL_DIR) $(1)/etc/config
+       $(INSTALL_CONF) $(CURDIR)/files/openlist.config $(1)/etc/config/openlist
+       $(INSTALL_DIR) $(1)/etc/init.d
+       $(INSTALL_BIN) $(CURDIR)/files/openlist.init $(1)/etc/init.d/openlist
+       $(INSTALL_DIR) $(1)/etc/uci-defaults
+       $(INSTALL_BIN) $(CURDIR)/files/openlist.uci $(1)/etc/uci-defaults/99-migrate-openlist
+endef
+
+$(eval $(call Download,openlist-web))
+$(eval $(call GoBinPackage,openlist))
+$(eval $(call BuildPackage,openlist))
diff --git a/net/openlist/files/openlist.config b/net/openlist/files/openlist.config
new file mode 100644 (file)
index 0000000..8a76357
--- /dev/null
@@ -0,0 +1,38 @@
+
+config openlist 'config'
+       option enabled '0'
+       option debug '0'
+
+       # listen
+       option listen_addr '0.0.0.0'
+       option listen_http_port '5244'
+       option listen_https_port '-1'
+       option listen_force_https '0'
+       option listen_cert_file ''
+       option listen_key_file ''
+       option listen_unix_file ''
+       option listen_unix_file_perm ''
+
+       # site
+       option site_url ''
+       option site_cdn ''
+       option site_login_expire '48'
+       option site_max_connections '0'
+       option site_tls_insecure '0'
+
+       # database
+       option db_type 'sqlite3'
+       option db_host ''
+       option db_port '0'
+       option db_user ''
+       option db_pass ''
+       option db_name ''
+       option db_table_prefix 'x_'
+       option db_ssl_mode ''
+
+       # log
+       option log_enable '1'
+       option log_max_size '5'
+       option log_max_backups '1'
+       option log_max_age '15'
+
diff --git a/net/openlist/files/openlist.init b/net/openlist/files/openlist.init
new file mode 100644 (file)
index 0000000..5d1d13a
--- /dev/null
@@ -0,0 +1,113 @@
+#!/bin/sh /etc/rc.common
+
+USE_PROCD=1
+START=99
+
+CONF="openlist"
+PROG="/usr/bin/openlist"
+CONF_DIR="/etc/$CONF"
+RUN_DIR="/var/run/$CONF"
+
+uci_json_add_boolean() {
+       local enabled
+       config_get_bool enabled "${4:-config}" "$2" "${3:-0}"
+       json_add_boolean "$1" "$enabled"
+}
+
+uci_json_add_int() {
+       local value
+       config_get value "${4:-config}" "$2" "${3:-0}"
+       json_add_int "$1" "$value"
+}
+
+uci_json_add_string() {
+       local value
+       config_get value "${4:-config}" "$2" $3
+       json_add_string "$1" "$value"
+}
+
+start_service() {
+       config_load "$CONF"
+
+       local enabled
+       config_get_bool enabled "config" "enabled" "0"
+       [ "$enabled" -eq "1" ] || return 1
+
+       local jwt_secret
+       jwt_secret="$(jsonfilter -qi "$CONF_DIR/config.json" -e "@.jwt_secret")"
+       [ -n "$jwt_secret" ] || jwt_secret="$(tr -cd "a-zA-Z0-9" < "/dev/urandom" | head -c16)"
+
+       mkdir -p "$CONF_DIR"
+       mkdir -p "$RUN_DIR"
+
+       json_init
+       json_add_boolean "force" "1"
+       uci_json_add_string "site_url" "site_url"
+       uci_json_add_string "cdn" "site_cdn"
+       json_add_string "jwt_secret" "$jwt_secret"
+       uci_json_add_int "token_expires_in" "site_login_expire" "48"
+       json_add_object "database"
+               uci_json_add_string "type" "db_type" "sqlite3"
+               uci_json_add_string "host" "db_host"
+               uci_json_add_int "port" "db_port"
+               uci_json_add_string "user" "db_user"
+               uci_json_add_string "password" "db_pass"
+               uci_json_add_string "name" "db_name"
+               json_add_string "db_file" "$CONF_DIR/data.db"
+               uci_json_add_string "table_prefix" "db_table_prefix" "x_"
+               uci_json_add_string "ssl_mode" "db_ssl_mode"
+       json_close_object
+       json_add_object "scheme"
+               uci_json_add_string "address" "listen_addr" "0.0.0.0"
+               uci_json_add_int "http_port" "listen_http_port" "5244"
+               uci_json_add_int "https_port" "listen_https_port" "-1"
+               uci_json_add_boolean "force_https" "listen_force_https"
+               uci_json_add_string "cert_file" "listen_cert_file"
+               uci_json_add_string "key_file" "listen_key_file"
+               uci_json_add_string "unix_file" "listen_unix_file"
+               uci_json_add_string "unix_file_perm" "listen_unix_file_perm"
+       json_close_object
+       json_add_string "temp_dir" "$RUN_DIR/temp"
+       json_add_string "bleve_dir" "$CONF_DIR/bleve"
+       json_add_object "log"
+               uci_json_add_boolean "enable" "log_enable" "1"
+               json_add_string "name" "$RUN_DIR/log/openlist.log"
+               uci_json_add_int "max_size" "log_max_size" "5"
+               uci_json_add_int "max_backups" "log_max_backups" "1"
+               uci_json_add_int "max_age" "log_max_age" "15"
+               json_add_boolean "compress" "0"
+       json_close_object
+       json_add_int "delayed_start" "0"
+       uci_json_add_int "max_connections" "site_max_connections"
+       uci_json_add_boolean "tls_insecure_skip_verify" "site_tls_insecure"
+       json_dump > "$CONF_DIR/config.json"
+
+       local db_type
+       config_get db_type "config" "db_type" "sqlite3"
+       [ "$db_type" != "sqlite3" -o -e "$CONF_DIR/data.db" ] || "$PROG" --data "$CONF_DIR" admin set "password" 2>"/dev/null"
+
+       procd_open_instance
+       procd_set_param command "$PROG"
+       procd_append_param command server
+       procd_append_param command --data "$CONF_DIR"
+       procd_append_param command --no-prefix
+
+       local debug
+       config_get_bool debug "config" "debug" "0"
+       [ "$debug" -eq "0" ] || procd_append_param command --debug
+
+       procd_set_param limits core="unlimited"
+       procd_set_param limits nofile="1000000 1000000"
+       procd_set_param respawn
+       [ "$debug" -eq "0" ] || procd_set_param stderr 1
+
+       procd_close_instance
+}
+
+stop_service() {
+       rm -rf "$RUN_DIR"
+}
+
+service_triggers() {
+       procd_add_reload_trigger "$CONF"
+}
diff --git a/net/openlist/files/openlist.uci b/net/openlist/files/openlist.uci
new file mode 100644 (file)
index 0000000..4a36d0f
--- /dev/null
@@ -0,0 +1,13 @@
+#!/bin/sh
+
+if [ -d "/etc/alist" ]; then
+       mv -f "/etc/alist" "/etc/openlist"
+fi
+
+if [ -f "/etc/config/alist" ]; then
+       mv -f "/etc/config/alist" "/etc/config/openlist"
+       uci -q set openlist.config=openlist
+       uci -q commit openlist
+fi
+
+exit 0
diff --git a/net/openlist/test.sh b/net/openlist/test.sh
new file mode 100644 (file)
index 0000000..d09b0ba
--- /dev/null
@@ -0,0 +1,3 @@
+#!/bin/sh
+
+openlist version | grep "$PKG_VERSION"