From 5212149cf3462bc67bd13814d4c04798b12e6051 Mon Sep 17 00:00:00 2001 From: OPPEN321 Date: Tue, 23 Sep 2025 18:58:39 +0800 Subject: [PATCH] Create 01-prepare_package.sh --- scripts/01-prepare_package.sh | 202 ++++++++++++++++++++++++++++++++++ 1 file changed, 202 insertions(+) create mode 100644 scripts/01-prepare_package.sh diff --git a/scripts/01-prepare_package.sh b/scripts/01-prepare_package.sh new file mode 100644 index 0000000..b6f3517 --- /dev/null +++ b/scripts/01-prepare_package.sh @@ -0,0 +1,202 @@ +#!/bin/bash -e + +# autocore +git clone https://$github/sbwml/autocore-arm -b openwrt-24.10 package/system/autocore + +# golang 1.25 +rm -rf feeds/packages/lang/golang +git clone https://$github/sbwml/packages_lang_golang -b 25.x feeds/packages/lang/golang + +# node - prebuilt +rm -rf feeds/packages/lang/node +git clone https://$github/sbwml/feeds_packages_lang_node-prebuilt feeds/packages/lang/node -b packages-24.10 + +# default settings +git clone https://$github/zhiern/default-settings package/new/default-settings -b openwrt-24.10 + +# linkease +git clone https://$github/zhiern/package_new_linkease package/new/linkease + +# luci-app-quickfile +git clone https://$github/sbwml/luci-app-quickfile package/new/quickfile + +# luci-app-airplay2 +git clone https://$github/sbwml/luci-app-airplay2 package/new/airplay2 + +# luci-app-webdav +git clone https://$github/sbwml/luci-app-webdav package/new/luci-app-webdav + +# ddns - fix boot +sed -i '/boot()/,+2d' feeds/packages/net/ddns-scripts/files/etc/init.d/ddns + +# nlbwmon - disable syslog +sed -i 's/stderr 1/stderr 0/g' feeds/packages/net/nlbwmon/files/nlbwmon.init + +# UPnP +rm -rf feeds/{packages/net/miniupnpd,luci/applications/luci-app-upnp} +git clone https://$gitea/zhao/miniupnpd feeds/packages/net/miniupnpd -b v2.3.9 +git clone https://$gitea/zhao/luci-app-upnp feeds/luci/applications/luci-app-upnp -b openwrt-24.10 + +# Docker +rm -rf feeds/luci/applications/luci-app-dockerman +git clone https://$gitea/zhao/luci-app-dockerman -b openwrt-24.10 feeds/luci/applications/luci-app-dockerman +rm -rf feeds/packages/utils/{docker,dockerd,containerd,runc} +git clone https://$github/sbwml/packages_utils_docker feeds/packages/utils/docker +git clone https://$github/sbwml/packages_utils_dockerd feeds/packages/utils/dockerd +git clone https://$github/sbwml/packages_utils_containerd feeds/packages/utils/containerd +git clone https://$github/sbwml/packages_utils_runc feeds/packages/utils/runc + +# Use nginx instead of uhttpd +if [ "$web_server" = "nginx" ]; then + sed -i 's/+uhttpd /+luci-nginx /g' feeds/luci/collections/luci/Makefile + sed -i 's/+uhttpd-mod-ubus //' feeds/luci/collections/luci/Makefile + sed -i 's/+uhttpd /+luci-nginx /g' feeds/luci/collections/luci-light/Makefile + sed -i "s/+luci /+luci-nginx /g" feeds/luci/collections/luci-ssl-openssl/Makefile + sed -i "s/+luci /+luci-nginx /g" feeds/luci/collections/luci-ssl/Makefile + sed -i 's/+uhttpd +uhttpd-mod-ubus /+luci-nginx /g' feeds/packages/net/wg-installer/Makefile + sed -i '/uhttpd-mod-ubus/d' feeds/luci/collections/luci-light/Makefile + sed -i 's/+luci-nginx \\$/+luci-nginx/' feeds/luci/collections/luci-light/Makefile +fi + +# nginx - latest version +rm -rf feeds/packages/net/nginx +git clone https://$github/sbwml/feeds_packages_net_nginx feeds/packages/net/nginx -b openwrt-24.10 +sed -i 's/procd_set_param stdout 1/procd_set_param stdout 0/g;s/procd_set_param stderr 1/procd_set_param stderr 0/g' feeds/packages/net/nginx/files/nginx.init + +# nginx - ubus +sed -i 's/ubus_parallel_req 2/ubus_parallel_req 6/g' feeds/packages/net/nginx/files-luci-support/60_nginx-luci-support +sed -i '/ubus_parallel_req/a\ ubus_script_timeout 300;' feeds/packages/net/nginx/files-luci-support/60_nginx-luci-support + +# nginx - config +curl -s $mirror/openwrt/nginx/luci.locations > feeds/packages/net/nginx/files-luci-support/luci.locations +curl -s $mirror/openwrt/nginx/uci.conf.template > feeds/packages/net/nginx-util/files/uci.conf.template + +# opkg +mkdir -p package/system/opkg/patches +curl -s $mirror/openwrt/patch/opkg/900-opkg-download-disable-hsts.patch > package/system/opkg/patches/900-opkg-download-disable-hsts.patch +curl -s $mirror/openwrt/patch/opkg/901-libopkg-opkg_install-copy-conffiles-to-the-system-co.patch > package/system/opkg/patches/901-libopkg-opkg_install-copy-conffiles-to-the-system-co.patch + +# uwsgi - fix timeout +sed -i '$a cgi-timeout = 600' feeds/packages/net/uwsgi/files-luci-support/luci-*.ini +sed -i '/limit-as/c\limit-as = 5000' feeds/packages/net/uwsgi/files-luci-support/luci-webui.ini +# disable error log +sed -i "s/procd_set_param stderr 1/procd_set_param stderr 0/g" feeds/packages/net/uwsgi/files/uwsgi.init + +# uwsgi - performance +sed -i 's/threads = 1/threads = 2/g' feeds/packages/net/uwsgi/files-luci-support/luci-webui.ini +sed -i 's/processes = 3/processes = 4/g' feeds/packages/net/uwsgi/files-luci-support/luci-webui.ini +sed -i 's/cheaper = 1/cheaper = 2/g' feeds/packages/net/uwsgi/files-luci-support/luci-webui.ini + +# rpcd - fix timeout +sed -i 's/option timeout 30/option timeout 60/g' package/system/rpcd/files/rpcd.config +sed -i 's#20) \* 1000#60) \* 1000#g' feeds/luci/modules/luci-base/htdocs/luci-static/resources/rpc.js + +# frpc +sed -i 's/procd_set_param stdout $stdout/procd_set_param stdout 0/g' feeds/packages/net/frp/files/frpc.init +sed -i 's/procd_set_param stderr $stderr/procd_set_param stderr 0/g' feeds/packages/net/frp/files/frpc.init +sed -i 's/stdout stderr //g' feeds/packages/net/frp/files/frpc.init +sed -i '/stdout:bool/d;/stderr:bool/d' feeds/packages/net/frp/files/frpc.init +sed -i '/stdout/d;/stderr/d' feeds/packages/net/frp/files/frpc.config +sed -i 's/env conf_inc/env conf_inc enable/g' feeds/packages/net/frp/files/frpc.init +sed -i "s/'conf_inc:list(string)'/& \\\\/" feeds/packages/net/frp/files/frpc.init +sed -i "/conf_inc:list/a\\\t\t\'enable:bool:0\'" feeds/packages/net/frp/files/frpc.init +sed -i '/procd_open_instance/i\\t\[ "$enable" -ne 1 \] \&\& return 1\n' feeds/packages/net/frp/files/frpc.init +curl -s $mirror/openwrt/patch/luci/applications/luci-app-frpc/001-luci-app-frpc-hide-token.patch | patch -p1 +curl -s $mirror/openwrt/patch/luci/applications/luci-app-frpc/002-luci-app-frpc-add-enable-flag.patch | patch -p1 + +# natmap +sed -i 's/log_stdout:bool:1/log_stdout:bool:0/g;s/log_stderr:bool:1/log_stderr:bool:0/g' feeds/packages/net/natmap/files/natmap.init +pushd feeds/luci + curl -s $mirror/openwrt/patch/luci/applications/luci-app-natmap/0001-luci-app-natmap-add-default-STUN-server-lists.patch | patch -p1 +popd + +# samba4 - bump version +rm -rf feeds/packages/net/samba4 +git clone https://$github/sbwml/feeds_packages_net_samba4 feeds/packages/net/samba4 +# enable multi-channel +sed -i '/workgroup/a \\n\t## enable multi-channel' feeds/packages/net/samba4/files/smb.conf.template +sed -i '/enable multi-channel/a \\tserver multi channel support = yes' feeds/packages/net/samba4/files/smb.conf.template +# default config +sed -i 's/#aio read size = 0/aio read size = 0/g' feeds/packages/net/samba4/files/smb.conf.template +sed -i 's/#aio write size = 0/aio write size = 0/g' feeds/packages/net/samba4/files/smb.conf.template +sed -i 's/invalid users = root/#invalid users = root/g' feeds/packages/net/samba4/files/smb.conf.template +sed -i 's/bind interfaces only = yes/bind interfaces only = no/g' feeds/packages/net/samba4/files/smb.conf.template +sed -i 's/#create mask/create mask/g' feeds/packages/net/samba4/files/smb.conf.template +sed -i 's/#directory mask/directory mask/g' feeds/packages/net/samba4/files/smb.conf.template +sed -i 's/0666/0644/g;s/0744/0755/g;s/0777/0755/g' feeds/luci/applications/luci-app-samba4/htdocs/luci-static/resources/view/samba4.js +sed -i 's/0666/0644/g;s/0777/0755/g' feeds/packages/net/samba4/files/samba.config +sed -i 's/0666/0644/g;s/0777/0755/g' feeds/packages/net/samba4/files/smb.conf.template + +# aria2 & ariaNG +rm -rf feeds/packages/net/ariang +rm -rf feeds/luci/applications/luci-app-aria2 +git clone https://$github/sbwml/ariang-nginx package/new/ariang-nginx +rm -rf feeds/packages/net/aria2 +git clone https://$github/sbwml/feeds_packages_net_aria2 -b 22.03 feeds/packages/net/aria2 + +# airconnect +git clone https://$github/sbwml/luci-app-airconnect package/new/airconnect --depth=1 + +# netkit-ftp +git clone https://$github/sbwml/package_new_ftp package/new/ftp + +# SSRP & Passwall +rm -rf feeds/packages/net/{xray-core,v2ray-core,v2ray-geodata,sing-box} +git clone https://$github/sbwml/openwrt_helloworld package/new/helloworld -b v5 + +# openlist +git clone https://$github/sbwml/luci-app-openlist2 package/new/openlist --depth=1 + +# qBittorrent +git clone https://$github/sbwml/luci-app-qbittorrent package/new/qbittorrent --depth=1 + +# unblockneteasemusic +git clone https://$github/UnblockNeteaseMusic/luci-app-unblockneteasemusic package/new/luci-app-unblockneteasemusic --depth=1 +sed -i 's/解除网易云音乐播放限制/网易云音乐解锁/g' package/new/luci-app-unblockneteasemusic/root/usr/share/luci/menu.d/luci-app-unblockneteasemusic.json + +# Mosdns +git clone https://$github/sbwml/luci-app-mosdns -b v5 package/new/mosdns --depth=1 + +# OpenAppFilter +git clone https://$github/sbwml/OpenAppFilter --depth=1 package/new/OpenAppFilter -b v6 + +# iperf3 +sed -i "s/D_GNU_SOURCE/D_GNU_SOURCE -funroll-loops/g" feeds/packages/net/iperf3/Makefile + +# nlbwmon +sed -i 's/services/network/g' feeds/luci/applications/luci-app-nlbwmon/root/usr/share/luci/menu.d/luci-app-nlbwmon.json +sed -i 's/services/network/g' feeds/luci/applications/luci-app-nlbwmon/htdocs/luci-static/resources/view/nlbw/config.js + +# mentohust +git clone https://$github/sbwml/luci-app-mentohust package/new/mentohust + +# luci-compat - fix translation +sed -i 's/<%:Up%>/<%:Move up%>/g' feeds/luci/modules/luci-compat/luasrc/view/cbi/tblsection.htm +sed -i 's/<%:Down%>/<%:Move down%>/g' feeds/luci/modules/luci-compat/luasrc/view/cbi/tblsection.htm + +# frpc translation +sed -i 's,发送,Transmission,g' feeds/luci/applications/luci-app-transmission/po/zh_Hans/transmission.po +sed -i 's,frp 服务器,Frp 服务器,g' feeds/luci/applications/luci-app-frps/po/zh_Hans/frps.po +sed -i 's,frp 客户端,Frp 客户端,g' feeds/luci/applications/luci-app-frpc/po/zh_Hans/frpc.po + +# luci-app-sqm +rm -rf feeds/luci/applications/luci-app-sqm +git clone https://$gitea/zhao/luci-app-sqm feeds/luci/applications/luci-app-sqm + +# unzip +rm -rf feeds/packages/utils/unzip +git clone https://$github/sbwml/feeds_packages_utils_unzip feeds/packages/utils/unzip + +# lucky +git clone https://$github/gdy666/luci-app-lucky.git package/new/lucky + +# custom packages +rm -rf feeds/packages/utils/coremark +git clone https://$github/sbwml/openwrt_pkgs package/new/custom --depth=1 +rm -rf package/new/custom/luci-app-adguardhome + +# adguardhome +git clone https://$gitea/zhao/luci-app-adguardhome package/new/luci-app-adguardhome + +# argon +git clone https://$github/zhiern/luci-theme-argon package/new/luci-theme-argon