mirror of
https://github.com/juewuy/ShellCrash.git
synced 2026-09-08 13:46:33 +00:00
Compare commits
6
Commits
master
..
de1d9e20f7
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
de1d9e20f7 | ||
|
|
df9ae2a8d8 | ||
|
|
b255ac47f4 | ||
|
|
ed18140af6 | ||
|
|
376197c654 | ||
|
|
d37267bceb |
@@ -74,7 +74,10 @@ COPY --from=builder /tmp/s6_noarch.tar.xz /tmp/s6_noarch.tar.xz
|
||||
RUN tar -xJf /tmp/s6_noarch.tar.xz -C / && rm -rf /tmp/s6_noarch.tar.xz
|
||||
RUN tar -xJf /tmp/s6_arch.tar.xz -C / && rm -rf /tmp/s6_arch.tar.xz
|
||||
COPY docker/s6-rc.d /etc/s6-overlay/s6-rc.d
|
||||
COPY docker/s6-overlay/scripts/sync-autostart /etc/s6-overlay/scripts/sync-autostart
|
||||
RUN chmod +x /etc/s6-overlay/scripts/sync-autostart
|
||||
ENV S6_CMD_WAIT_FOR_SERVICES=1
|
||||
ENV S6_STAGE2_HOOK=/etc/s6-overlay/scripts/sync-autostart
|
||||
|
||||
ENTRYPOINT ["/init"]
|
||||
|
||||
|
||||
+3
-1
@@ -89,6 +89,8 @@ mkdir -p /root/ShellCrash
|
||||
docker run -d \
|
||||
………………
|
||||
-v shellcrash_configs:/etc/ShellCrash/configs \
|
||||
-v shellcrash_yamls:/etc/ShellCrash/yamls \
|
||||
-v shellcrash_jsons:/etc/ShellCrash/jsons \
|
||||
………………
|
||||
```
|
||||
|
||||
@@ -134,7 +136,7 @@ docker rm -f shellcrash
|
||||
### Docker删除卷
|
||||
|
||||
```shell
|
||||
docker volume rm shellcrash_configs
|
||||
docker volume rm shellcrash_configs shellcrash_yamls shellcrash_jsons
|
||||
```
|
||||
|
||||
### Compose删除容器&卷
|
||||
|
||||
@@ -18,10 +18,14 @@ services:
|
||||
# - net.ipv6.conf.all.forwarding=1
|
||||
volumes:
|
||||
- shellcrash_configs:/etc/ShellCrash/configs:rw
|
||||
- shellcrash_yamls:/etc/ShellCrash/yamls:rw
|
||||
- shellcrash_jsons:/etc/ShellCrash/jsons:rw
|
||||
restart: unless-stopped
|
||||
|
||||
volumes:
|
||||
shellcrash_configs:
|
||||
shellcrash_yamls:
|
||||
shellcrash_jsons:
|
||||
|
||||
networks:
|
||||
macvlan_lan:
|
||||
|
||||
@@ -0,0 +1,22 @@
|
||||
#!/bin/sh
|
||||
# 在 s6-rc 编译 user bundle 之前,把 configs 卷中的自启状态同步到 contents.d
|
||||
# 由 S6_STAGE2_HOOK 调用;删除重建容器后仍可按 volume 恢复开机自启
|
||||
|
||||
CRASHDIR=/etc/ShellCrash
|
||||
CFG_MARK="$CRASHDIR/configs/.autostart"
|
||||
S6_MARK=/etc/s6-overlay/s6-rc.d/user/contents.d/afstart
|
||||
|
||||
mkdir -p "$CRASHDIR/configs" /etc/s6-overlay/s6-rc.d/user/contents.d
|
||||
|
||||
# 兼容旧容器:仅有 s6 标记时迁移到 configs
|
||||
if [ -f "$S6_MARK" ] && [ ! -f "$CFG_MARK" ]; then
|
||||
touch "$CFG_MARK"
|
||||
fi
|
||||
|
||||
if [ -f "$CFG_MARK" ] && [ ! -f "$CRASHDIR/.dis_startup" ]; then
|
||||
touch "$S6_MARK"
|
||||
else
|
||||
rm -f "$S6_MARK"
|
||||
fi
|
||||
|
||||
exit 0
|
||||
@@ -11,7 +11,7 @@ proxy-groups:
|
||||
- {name: 🚀 节点选择, type: select, proxies: [♻️ 自动选择, ✨ 自动选择(去高倍率), 🛠️ 手动切换, ⚖️ 负载均衡, 🚑 故障转移, 🎯 本地直连, 🇭🇰 香港节点, 🇹🇼 台湾节点, 🇺🇸 美国节点, 🇯🇵 日本节点, 🇪🇺 欧洲节点, 🇰🇷 韩国节点, 🇸🇬 狮城节点, 👑 高级节点, 📉 省流节点, {providers_tags}]}
|
||||
- {name: 🛠️ 手动切换, type: select, include-all: true, proxies: [🎯 本地直连, 🇭🇰 香港节点, 🇹🇼 台湾节点, 🇺🇸 美国节点, 🇯🇵 日本节点, 🇪🇺 欧洲节点, 🇰🇷 韩国节点, 🇸🇬 狮城节点, 👑 高级节点, 📉 省流节点, {providers_tags}]}
|
||||
- {name: ♻️ 自动选择, type: url-test, interval: 1800, tolerance: 50, include-all: true, exclude-filter: "(?i)(剩余|重置|到期|防失联|官网|导航|客服|http|www)"}
|
||||
- {name: ✨ 自动选择(去高倍率), type: url-test, interval: 1800, tolerance: 50, include-all: true, exclude-filter: "(?i)(剩余|重置|到期|防失联|官网|导航|客服|http|www)`(?i)(专线|专用|高级|直连|急速|高速|高倍率|游戏|铂金|钻石|企业|VIP|Ultra|Game|IEPL|IPLC|AIA|BGP|GIA|CN2|CMI|HGC|HKT|CTM|CC|AC|x([2-9]|\\d{2,}))"}
|
||||
- {name: ✨ 自动选择(去高倍率), type: url-test, interval: 1800, tolerance: 50, include-all: true, exclude-filter: "(?i)(剩余|重置|到期|防失联|官网|导航|客服|http|www)`(?i)(专线|专用|高级|直连|急速|高速|高倍率|游戏|铂金|钻石|企业|VIP|Ultra|Game|IEPL|IPLC|AIA|BGP|GIA|CN2|CMI|HGC|HKT|CTM|CC|AC|(x([2-9]|[1-9][0-9]+)|([2-9]|[1-9][0-9]+)x))"}
|
||||
- {name: ⚖️ 负载均衡, type: load-balance, interval: 1800, include-all: true, hidden: true, exclude-filter: "(?i)(剩余|重置|到期|防失联|官网|导航|客服|http|www)"}
|
||||
- {name: 🚑 故障转移, type: fallback, interval: 1800, include-all: true, hidden: true, exclude-filter: "(?i)(剩余|重置|到期|防失联|官网|导航|客服|http|www)"}
|
||||
#
|
||||
@@ -51,7 +51,7 @@ proxy-groups:
|
||||
- {name: 🇰🇷 韩国节点, type: url-test, interval: 120, tolerance: 50, include-all: true, filter: "(?i)(🇰🇷|韩|韓|首尔|kr|kor)"}
|
||||
- {name: 🇸🇬 狮城节点, type: url-test, interval: 120, tolerance: 50, include-all: true, filter: "(?i)(🇸🇬|新加坡|狮城|sg|singapore)"}
|
||||
|
||||
- {name: 👑 高级节点, type: url-test, interval: 1800, tolerance: 50, include-all: true, filter: "(?i)(专线|专用|高级|直连|急速|高速|高倍率|游戏|铂金|钻石|企业|VIP|Ultra|Game|IEPL|IPLC|AIA|BGP|GIA|CN2|CMI|HGC|HKT|CTM|CC|AC|x([2-9]|\\d{2,}))"}
|
||||
- {name: 👑 高级节点, type: url-test, interval: 1800, tolerance: 50, include-all: true, filter: "(?i)(专线|专用|高级|直连|急速|高速|高倍率|游戏|铂金|钻石|企业|VIP|Ultra|Game|IEPL|IPLC|AIA|BGP|GIA|CN2|CMI|HGC|HKT|CTM|CC|AC|(x([2-9]|[1-9][0-9]+)|([2-9]|[1-9][0-9]+)x))"}
|
||||
- {name: 📉 省流节点, type: url-test, interval: 1800, tolerance: 50, include-all: true, filter: "(?i)(0\\.[1-6]|低倍率|省流|大流量|公益|免费|闲时|Low)"}
|
||||
|
||||
#规则提供者(更新mrs格式)
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
{ "tag": "🚀 节点选择", "type": "selector", "outbounds": ["♻️ 自动选择", "✨ 自动选择(去高倍率)", "🛠️ 手动切换", "🎯 本地直连", "🇭🇰 香港节点", "🇹🇼 台湾节点", "🇺🇸 美国节点", "🇯🇵 日本节点", "🇪🇺 欧洲节点", "🇰🇷 韩国节点", "🇸🇬 狮城节点", "👑 高级节点", "📉 省流节点", {providers_tags}] },
|
||||
{ "tag": "🛠️ 手动切换", "type": "selector", "use_all_providers": true, "outbounds": ["🎯 本地直连", "🇭🇰 香港节点", "🇹🇼 台湾节点", "🇺🇸 美国节点", "🇯🇵 日本节点", "🇪🇺 欧洲节点", "🇰🇷 韩国节点", "🇸🇬 狮城节点", "👑 高级节点", "📉 省流节点", {providers_tags}] },
|
||||
{ "tag": "♻️ 自动选择", "type": "urltest", "interval": "2m", "use_all_providers": true, "exclude": "(?i)(剩余|重置|到期|防失联|官网|导航|客服|http|www)" },
|
||||
{ "tag": "✨ 自动选择(去高倍率)", "type": "urltest", "interval": "2m", "use_all_providers": true, "exclude": "(?i)(剩余|重置|到期|防失联|官网|导航|客服|http|www|专线|专用|高级|直连|急速|高速|高倍率|游戏|铂金|钻石|企业|VIP|Ultra|Game|IEPL|IPLC|AIA|BGP|GIA|CN2|CMI|HGC|HKT|CTM|CC|AC|x([2-9]|[0-9][0-9]+))" },
|
||||
{ "tag": "✨ 自动选择(去高倍率)", "type": "urltest", "interval": "2m", "use_all_providers": true, "exclude": "(?i)(剩余|重置|到期|防失联|官网|导航|客服|http|www|专线|专用|高级|直连|急速|高速|高倍率|游戏|铂金|钻石|企业|VIP|Ultra|Game|IEPL|IPLC|AIA|BGP|GIA|CN2|CMI|HGC|HKT|CTM|CC|AC|(x([2-9]|[1-9][0-9]+)|([2-9]|[1-9][0-9]+)x))" },
|
||||
|
||||
{ "tag": "🤖 AI 平台", "type": "selector", "outbounds": ["🚀 节点选择", "🤖 AI节点(过滤港澳)", "🎯 本地直连", "♻️ 自动选择", "🛠️ 手动切换", "🇭🇰 香港节点", "🇹🇼 台湾节点", "🇺🇸 美国节点", "🇯🇵 日本节点", "🇪🇺 欧洲节点", "🇰🇷 韩国节点", "🇸🇬 狮城节点", "👑 高级节点", "📉 省流节点", {providers_tags}] },
|
||||
{ "tag": "🤖 AI节点(过滤港澳)", "type": "urltest", "interval": "2m", "use_all_providers": true, "exclude": "(?i)(剩余|重置|到期|防失联|官网|导航|客服|http|www|🇭🇰|港|🇲🇴|澳门|hk|hongkong|hong kong)" },
|
||||
@@ -42,7 +42,7 @@
|
||||
{ "tag": "🇰🇷 韩国节点", "type": "urltest", "interval": "2m", "use_all_providers": true, "include": "(?i)(🇰🇷|韩|韓|首尔|kr|kor)" },
|
||||
{ "tag": "🇸🇬 狮城节点", "type": "urltest", "interval": "2m", "use_all_providers": true, "include": "(?i)(🇸🇬|新加坡|狮城|sg|singapore)" },
|
||||
|
||||
{ "tag": "👑 高级节点", "type": "urltest", "interval": "2m", "use_all_providers": true, "include": "(?i)(专线|专用|高级|直连|急速|高速|高倍率|游戏|铂金|钻石|企业|VIP|Ultra|Game|IEPL|IPLC|AIA|BGP|GIA|CN2|CMI|HGC|HKT|CTM|CC|AC|x([2-9]|[0-9][0-9]+))" },
|
||||
{ "tag": "👑 高级节点", "type": "urltest", "interval": "2m", "use_all_providers": true, "include": "(?i)(专线|专用|高级|直连|急速|高速|高倍率|游戏|铂金|钻石|企业|VIP|Ultra|Game|IEPL|IPLC|AIA|BGP|GIA|CN2|CMI|HGC|HKT|CTM|CC|AC|(x([2-9]|[1-9][0-9]+)|([2-9]|[1-9][0-9]+)x))" },
|
||||
{ "tag": "📉 省流节点", "type": "urltest", "interval": "2m", "use_all_providers": true, "include": "(?i)(0[.][1-5]|低倍率|省流|大流量|公益|免费|闲时|Low)" }
|
||||
],
|
||||
"route": {
|
||||
|
||||
@@ -1,3 +1,22 @@
|
||||
# s6 / Docker:自启状态以 configs 卷内标记为准,并同步到 s6 contents.d
|
||||
|
||||
enable_s6_autostart_marks() {
|
||||
mkdir -p "$CRASHDIR/configs" /etc/s6-overlay/s6-rc.d/user/contents.d
|
||||
touch "$CRASHDIR/configs/.autostart" /etc/s6-overlay/s6-rc.d/user/contents.d/afstart
|
||||
}
|
||||
|
||||
disable_s6_autostart_marks() {
|
||||
rm -f "$CRASHDIR/configs/.autostart" /etc/s6-overlay/s6-rc.d/user/contents.d/afstart
|
||||
}
|
||||
|
||||
# 将旧版仅写在可写层的 s6 标记迁移到 configs
|
||||
migrate_s6_autostart_mark() {
|
||||
if [ -f /etc/s6-overlay/s6-rc.d/user/contents.d/afstart ] && [ ! -f "$CRASHDIR/configs/.autostart" ]; then
|
||||
mkdir -p "$CRASHDIR/configs"
|
||||
touch "$CRASHDIR/configs/.autostart"
|
||||
fi
|
||||
}
|
||||
|
||||
check_autostart(){
|
||||
if [ "$start_old" = ON ];then
|
||||
[ ! -f "$CRASHDIR"/.dis_startup ] && return 0
|
||||
@@ -7,7 +26,8 @@ check_autostart(){
|
||||
elif ckcmd systemctl; then
|
||||
[ "$(systemctl is-enabled shellcrash.service 2>&1)" = enabled ] && return 0
|
||||
elif grep -q 's6' /proc/1/comm; then
|
||||
[ -f /etc/s6-overlay/s6-rc.d/user/contents.d/afstart ] && return 0
|
||||
migrate_s6_autostart_mark
|
||||
[ -f "$CRASHDIR/configs/.autostart" ] && [ ! -f "$CRASHDIR"/.dis_startup ] && return 0
|
||||
elif rc-status -r >/dev/null 2>&1; then
|
||||
rc-update show default | grep -q "shellcrash" && return 0
|
||||
else
|
||||
|
||||
@@ -12,7 +12,7 @@ allow_autostart() {
|
||||
fi
|
||||
|
||||
ckcmd systemctl && systemctl enable shellcrash.service >/dev/null 2>&1
|
||||
grep -q 's6' /proc/1/comm && touch /etc/s6-overlay/s6-rc.d/user/contents.d/afstart
|
||||
grep -q 's6' /proc/1/comm && enable_s6_autostart_marks
|
||||
rc-status -r >/dev/null 2>&1 && rc-update add shellcrash default >/dev/null 2>&1
|
||||
rm -rf "$CRASHDIR"/.dis_startup
|
||||
}
|
||||
@@ -20,7 +20,7 @@ allow_autostart() {
|
||||
disable_autostart() {
|
||||
[ -d /etc/rc.d ] && cd /etc/rc.d && rm -rf *shellcrash >/dev/null 2>&1 && cd - >/dev/null
|
||||
ckcmd systemctl && systemctl disable shellcrash.service >/dev/null 2>&1
|
||||
grep -q 's6' /proc/1/comm && rm -rf /etc/s6-overlay/s6-rc.d/user/contents.d/afstart
|
||||
grep -q 's6' /proc/1/comm && disable_s6_autostart_marks
|
||||
rc-status -r >/dev/null 2>&1 && rc-update del shellcrash default >/dev/null 2>&1
|
||||
touch "$CRASHDIR"/.dis_startup
|
||||
}
|
||||
|
||||
@@ -69,6 +69,7 @@ forwhat() {
|
||||
fi
|
||||
|
||||
ckcmd systemctl && [ "$(cat /proc/1/comm)" = "systemd" ] && systemctl enable shellcrash.service >/dev/null 2>&1
|
||||
grep -q 's6' /proc/1/comm && enable_s6_autostart_marks
|
||||
rm -rf "$CRASHDIR"/.dis_startup
|
||||
autostart=enable
|
||||
# 检测IP转发
|
||||
|
||||
+2
-1
@@ -11,6 +11,7 @@
|
||||
. "$CRASHDIR"/libs/set_config.sh
|
||||
. "$CRASHDIR"/libs/set_cron.sh
|
||||
. "$CRASHDIR"/libs/check_cmd.sh
|
||||
. "$CRASHDIR"/libs/check_autostart.sh
|
||||
. "$CRASHDIR"/libs/compare.sh
|
||||
. "$CRASHDIR"/libs/logger.sh
|
||||
. "$CRASHDIR"/libs/web_save.sh
|
||||
@@ -54,7 +55,7 @@ start)
|
||||
systemctl start shellcrash.service || . "$CRASHDIR"/starts/start_error.sh
|
||||
elif grep -q 's6' /proc/1/comm; then
|
||||
bfstart && /command/s6-svc -u /run/service/shellcrash && {
|
||||
[ ! -f "$CRASHDIR"/.dis_startup ] && touch /etc/s6-overlay/s6-rc.d/user/contents.d/afstart
|
||||
[ ! -f "$CRASHDIR"/.dis_startup ] && enable_s6_autostart_marks
|
||||
afstart &
|
||||
}
|
||||
elif rc-status -r >/dev/null 2>&1; then
|
||||
|
||||
Reference in New Issue
Block a user