refactor: remove promotional content, ads, and author branding for a clean project
Main / build (push) Waiting to run
Main / build (push) Waiting to run
This commit is contained in:
@@ -1,56 +1,23 @@
|
||||
# 介绍
|
||||
# sing-box 一键安装及管理脚本
|
||||
|
||||
最好用的 sing-box 一键安装脚本 & 管理脚本
|
||||
这是一个用于快速部署 and 管理 sing-box 的一键脚本。
|
||||
|
||||
# 特点
|
||||
## 特点
|
||||
|
||||
- 快速安装
|
||||
- 无敌好用
|
||||
- 零学习成本
|
||||
- 自动化 TLS
|
||||
- 简化所有流程
|
||||
- 兼容 sing-box 命令
|
||||
- 强大的快捷参数
|
||||
- 支持所有常用协议
|
||||
- 一键添加 VLESS-REALITY (默认)
|
||||
- 一键添加 TUIC
|
||||
- 一键添加 Trojan
|
||||
- 一键添加 Hysteria2
|
||||
- 一键添加 AnyTLS
|
||||
- 一键添加 Shadowsocks 2022
|
||||
- 一键添加 VMess-(TCP/HTTP/QUIC)
|
||||
- 一键添加 VMess-(WS/H2/HTTPUpgrade)-TLS
|
||||
- 一键添加 VLESS-(WS/H2/HTTPUpgrade)-TLS
|
||||
- 一键添加 Trojan-(WS/H2/HTTPUpgrade)-TLS
|
||||
- 支持所有常用协议(VLESS-REALITY, TUIC, Trojan, Hysteria2, Shadowsocks, VMess 等)
|
||||
- 一键启用 BBR
|
||||
- 一键更改伪装网站
|
||||
- 一键更改 (端口/UUID/密码/域名/路径/加密方式/SNI/等...)
|
||||
- 还有更多...
|
||||
|
||||
# 设计理念
|
||||
|
||||
设计理念为:**高效率,超快速,极易用**
|
||||
|
||||
脚本基于作者的自身使用需求,以 **多配置同时运行** 为核心设计
|
||||
|
||||
并且专门优化了,添加、更改、查看、删除、这四项常用功能
|
||||
|
||||
你只需要一条命令即可完成 添加、更改、查看、删除、等操作
|
||||
|
||||
例如,添加一个配置仅需不到 1 秒!瞬间完成添加!其他操作亦是如此!
|
||||
|
||||
脚本的参数非常高效率并且超级易用,请掌握参数的使用
|
||||
|
||||
# 文档
|
||||
|
||||
安装及使用:https://233boy.com/sing-box/sing-box-script/
|
||||
|
||||
# 帮助
|
||||
## 帮助信息
|
||||
|
||||
使用:`sing-box help`
|
||||
|
||||
```
|
||||
sing-box script v1.0 by 233boy
|
||||
sing-box script v1.0
|
||||
Usage: sing-box [options]... [args]...
|
||||
|
||||
基本:
|
||||
@@ -68,6 +35,7 @@ Usage: sing-box [options]... [args]...
|
||||
qr [name] 二维码信息
|
||||
url [name] URL 信息
|
||||
log 查看日志
|
||||
|
||||
更改:
|
||||
full [name] [...] 更改多个参数
|
||||
id [name] [uuid | auto] 更改 UUID
|
||||
@@ -110,6 +78,4 @@ Usage: sing-box [options]... [args]...
|
||||
h, help 显示此帮助界面
|
||||
|
||||
谨慎使用 del, ddel, 此选项会直接删除配置; 无需确认
|
||||
反馈问题) https://github.com/233boy/sing-box/issues
|
||||
文档(doc) https://233boy.com/sing-box/sing-box-script/
|
||||
```
|
||||
+3
-4
@@ -1,7 +1,6 @@
|
||||
#!/bin/bash
|
||||
|
||||
author=233boy
|
||||
# github=https://github.com/233boy/sing-box
|
||||
author=sb
|
||||
|
||||
# bash fonts colors
|
||||
red='\e[31m'
|
||||
@@ -303,7 +302,7 @@ exit_and_del_tmpdir() {
|
||||
[[ ! $1 ]] && {
|
||||
msg err "哦豁.."
|
||||
msg err "安装过程出现错误..."
|
||||
echo -e "反馈问题) https://github.com/${is_sh_repo}/issues"
|
||||
echo -e "反馈问题) 请前往项目平台提交 Issue"
|
||||
echo
|
||||
exit 1
|
||||
}
|
||||
@@ -324,7 +323,7 @@ main() {
|
||||
# show welcome msg
|
||||
clear
|
||||
echo
|
||||
echo "........... $is_core_name script by $author .........."
|
||||
echo "........... $is_core_name script .........."
|
||||
echo
|
||||
|
||||
# start installing...
|
||||
|
||||
+2
-6
@@ -4,11 +4,7 @@ caddy_config() {
|
||||
new)
|
||||
mkdir -p $is_caddy_dir $is_caddy_dir/sites $is_caddy_conf
|
||||
cat >$is_caddyfile <<-EOF
|
||||
# don't edit this file #
|
||||
# for more info, see https://233boy.com/$is_core/caddy-auto-tls/
|
||||
# 不要编辑这个文件 #
|
||||
# 更多相关请阅读此文章: https://233boy.com/$is_core/caddy-auto-tls/
|
||||
# https://caddyserver.com/docs/caddyfile/options
|
||||
# caddy configuration #
|
||||
{
|
||||
admin off
|
||||
http_port $is_http_port
|
||||
@@ -52,6 +48,6 @@ reverse_proxy https://$proxy_site {
|
||||
;;
|
||||
esac
|
||||
[[ $1 != "new" && $1 != 'proxy' ]] && {
|
||||
[[ ! -f ${is_caddy_site_file}.add ]] && echo "# see https://233boy.com/$is_core/caddy-auto-tls/" >${is_caddy_site_file}.add
|
||||
[[ ! -f ${is_caddy_site_file}.add ]] && echo "# caddy site configuration" >${is_caddy_site_file}.add
|
||||
}
|
||||
}
|
||||
|
||||
+18
-45
@@ -43,7 +43,6 @@ mainmenu=(
|
||||
"卸载"
|
||||
"帮助"
|
||||
"其他"
|
||||
"关于"
|
||||
)
|
||||
info_list=(
|
||||
"协议 (protocol)"
|
||||
@@ -618,9 +617,6 @@ change() {
|
||||
[[ $is_auto ]] && is_new_servername=$is_random_servername
|
||||
[[ ! $is_new_servername ]] && ask string is_new_servername "请输入新的 serverName:"
|
||||
is_servername=$is_new_servername
|
||||
[[ $(grep -i "^233boy.com$" <<<$is_servername) ]] && {
|
||||
err "你干嘛~哎呦~"
|
||||
}
|
||||
add $net
|
||||
;;
|
||||
11)
|
||||
@@ -632,13 +628,9 @@ change() {
|
||||
[[ ! -f $is_caddy_conf/${host}.conf.add ]] && err "无法配置伪装网站."
|
||||
[[ ! $is_new_proxy_site ]] && ask string is_new_proxy_site "请输入新的伪装网站 (例如 example.com):"
|
||||
proxy_site=$(sed 's#^.*//##;s#/$##' <<<$is_new_proxy_site)
|
||||
[[ $(grep -i "^233boy.com$" <<<$proxy_site) ]] && {
|
||||
err "你干嘛~哎呦~"
|
||||
} || {
|
||||
load caddy.sh
|
||||
caddy_config proxy
|
||||
manage restart caddy &
|
||||
}
|
||||
load caddy.sh
|
||||
caddy_config proxy
|
||||
manage restart caddy &
|
||||
msg "\n已更新伪装网站为: $(_green $proxy_site) \n"
|
||||
;;
|
||||
12)
|
||||
@@ -1000,7 +992,6 @@ add() {
|
||||
get_port
|
||||
is_https_port=$tmp_port
|
||||
warn "端口 (80 或 443) 已经被占用, 你也可以考虑使用 no-auto-tls"
|
||||
msg "\e[41m no-auto-tls 帮助(help)\e[0m: $(msg_ul https://233boy.com/$is_core/no-auto-tls/)\n"
|
||||
msg "\n Caddy 将使用非标准端口实现自动配置 TLS, HTTP:$is_http_port HTTPS:$is_https_port\n"
|
||||
msg "请确定是否继续???"
|
||||
pause
|
||||
@@ -1223,7 +1214,7 @@ get() {
|
||||
socks*)
|
||||
net=socks
|
||||
is_protocol=$net
|
||||
[[ ! $is_socks_user ]] && is_socks_user=233boy
|
||||
[[ ! $is_socks_user ]] && is_socks_user=admin
|
||||
[[ ! $is_socks_pass ]] && is_socks_pass=$uuid
|
||||
json_str="users:[{username: \"$is_socks_user\", password: \"$is_socks_pass\"}]"
|
||||
;;
|
||||
@@ -1368,7 +1359,7 @@ info() {
|
||||
is_can_change=(0 1 2 3 5)
|
||||
is_info_show=(0 1 2 3 4 6 7 8)
|
||||
[[ $is_protocol == 'vmess' ]] && {
|
||||
is_vmess_url=$(jq -c '{v:2,ps:'\"233boy-$net-$host\"',add:'\"$is_addr\"',port:'\"$is_https_port\"',id:'\"$uuid\"',aid:"0",net:'\"$net\"',host:'\"$host\"',path:'\"$path\"',tls:'\"tls\"'}' <<<{})
|
||||
is_vmess_url=$(jq -c '{v:2,ps:'\"sb-$net-$host\"',add:'\"$is_addr\"',port:'\"$is_https_port\"',id:'\"$uuid\"',aid:"0",net:'\"$net\"',host:'\"$host\"',path:'\"$path\"',tls:'\"tls\"'}' <<<{})
|
||||
is_url=vmess://$(echo -n $is_vmess_url | base64 -w 0)
|
||||
} || {
|
||||
[[ $is_protocol == "trojan" ]] && {
|
||||
@@ -1377,7 +1368,7 @@ info() {
|
||||
is_can_change=(0 1 2 3 4)
|
||||
is_info_show=(0 1 2 10 4 6 7 8)
|
||||
}
|
||||
is_url="$is_protocol://$uuid@$host:$is_https_port?encryption=none&security=tls&type=$net&host=$host&path=$path#233boy-$net-$host"
|
||||
is_url="$is_protocol://$uuid@$host:$is_https_port?encryption=none&security=tls&type=$net&host=$host&path=$path#sb-$net-$host"
|
||||
}
|
||||
[[ $is_caddy ]] && is_can_change+=(11)
|
||||
is_info_str=($is_protocol $is_addr $is_https_port $uuid $net $host $path 'tls')
|
||||
@@ -1399,21 +1390,21 @@ info() {
|
||||
is_info_str+=(tls h3 true)
|
||||
is_quic_add=",tls:\"tls\",alpn:\"h3\"" # cant add allowInsecure
|
||||
}
|
||||
is_vmess_url=$(jq -c "{v:2,ps:\"233boy-${net}-$is_addr\",add:\"$is_addr\",port:\"$port\",id:\"$uuid\",aid:\"0\",net:\"$net\",type:\"$is_type\"$is_quic_add}" <<<{})
|
||||
is_vmess_url=$(jq -c "{v:2,ps:\"sb-${net}-$is_addr\",add:\"$is_addr\",port:\"$port\",id:\"$uuid\",aid:\"0\",net:\"$net\",type:\"$is_type\"$is_quic_add}" <<<{})
|
||||
is_url=vmess://$(echo -n $is_vmess_url | base64 -w 0)
|
||||
fi
|
||||
;;
|
||||
ss)
|
||||
is_can_change=(0 1 4 6)
|
||||
is_info_show=(0 1 2 10 11)
|
||||
is_url="ss://$(echo -n ${ss_method}:${ss_password} | base64 -w 0)@${is_addr}:${port}#233boy-$net-${is_addr}"
|
||||
is_url="ss://$(echo -n ${ss_method}:${ss_password} | base64 -w 0)@${is_addr}:${port}#sb-$net-${is_addr}"
|
||||
is_info_str=($is_protocol $is_addr $port $ss_password $ss_method)
|
||||
;;
|
||||
trojan)
|
||||
is_insecure=1
|
||||
is_can_change=(0 1 4)
|
||||
is_info_show=(0 1 2 10 4 8 20)
|
||||
is_url="$is_protocol://$password@$is_addr:$port?type=tcp&security=tls&insecure=1&allowInsecure=1#233boy-$net-$is_addr"
|
||||
is_url="$is_protocol://$password@$is_addr:$port?type=tcp&security=tls&insecure=1&allowInsecure=1#sb-$net-$is_addr"
|
||||
is_info_str=($is_protocol $is_addr $port $password tcp tls true)
|
||||
;;
|
||||
hy*)
|
||||
@@ -1421,14 +1412,14 @@ info() {
|
||||
is_info_show=(0 1 2 10 8 9 20)
|
||||
# fix xray core for client use.
|
||||
is_sha256=$(openssl x509 -noout -fingerprint -sha256 -in $is_core_dir/bin/tls.cer | sed 's/.*=//;s/://g')
|
||||
is_url="$is_protocol://$password@$is_addr:$port?alpn=h3&insecure=1&allowInsecure=1&pinSHA256=$is_sha256#233boy-$net-$is_addr"
|
||||
is_url="$is_protocol://$password@$is_addr:$port?alpn=h3&insecure=1&allowInsecure=1&pinSHA256=$is_sha256#sb-$net-$is_addr"
|
||||
is_info_str=($is_protocol $is_addr $port $password tls h3 "true (设置, 固定证书>证书指纹(SHA-256): $is_sha256)")
|
||||
;;
|
||||
tuic)
|
||||
is_insecure=1
|
||||
is_can_change=(0 1 4 5)
|
||||
is_info_show=(0 1 2 3 10 8 9 20 21)
|
||||
is_url="$is_protocol://$uuid:$password@$is_addr:$port?alpn=h3&insecure=1&allowInsecure=1&congestion_control=bbr#233boy-$net-$is_addr"
|
||||
is_url="$is_protocol://$uuid:$password@$is_addr:$port?alpn=h3&insecure=1&allowInsecure=1&congestion_control=bbr#sb-$net-$is_addr"
|
||||
is_info_str=($is_protocol $is_addr $port $uuid $password tls h3 true bbr)
|
||||
;;
|
||||
reality)
|
||||
@@ -1443,19 +1434,19 @@ info() {
|
||||
is_info_show=(${is_info_show[@]/15/})
|
||||
}
|
||||
is_info_str=($is_protocol $is_addr $port $uuid $is_flow $is_net_type reality $is_servername chrome $is_public_key)
|
||||
is_url="$is_protocol://$uuid@$is_addr:$port?encryption=none&security=reality&flow=$is_flow&type=$is_net_type&sni=$is_servername&pbk=$is_public_key&fp=chrome#233boy-$net-$is_addr"
|
||||
is_url="$is_protocol://$uuid@$is_addr:$port?encryption=none&security=reality&flow=$is_flow&type=$is_net_type&sni=$is_servername&pbk=$is_public_key&fp=chrome#sb-$net-$is_addr"
|
||||
;;
|
||||
anytls)
|
||||
is_can_change=(0 1 4)
|
||||
if [[ $is_anytls_domain ]]; then
|
||||
is_info_show=(0 1 2 10 8)
|
||||
is_info_str=($is_protocol $is_anytls_domain $port $password tls)
|
||||
is_url="anytls://$password@$is_anytls_domain:$port#233boy-$net-$is_anytls_domain"
|
||||
is_url="anytls://$password@$is_anytls_domain:$port#sb-$net-$is_anytls_domain"
|
||||
else
|
||||
is_insecure=1
|
||||
is_info_show=(0 1 2 10 8 20)
|
||||
is_info_str=($is_protocol $is_addr $port $password tls true)
|
||||
is_url="anytls://$password@$is_addr:$port?insecure=1&allowInsecure=1#233boy-$net-$is_addr"
|
||||
is_url="anytls://$password@$is_addr:$port?insecure=1&allowInsecure=1#sb-$net-$is_addr"
|
||||
fi
|
||||
;;
|
||||
direct)
|
||||
@@ -1467,7 +1458,7 @@ info() {
|
||||
is_can_change=(0 1 12 4)
|
||||
is_info_show=(0 1 2 19 10)
|
||||
is_info_str=($is_protocol $is_addr $port $is_socks_user $is_socks_pass)
|
||||
is_url="socks://$(echo -n ${is_socks_user}:${is_socks_pass} | base64 -w 0)@${is_addr}:${port}#233boy-$net-${is_addr}"
|
||||
is_url="socks://$(echo -n ${is_socks_user}:${is_socks_pass} | base64 -w 0)@${is_addr}:${port}#sb-$net-${is_addr}"
|
||||
;;
|
||||
esac
|
||||
[[ $is_dont_show_info || $is_gen || $is_dont_auto_exit ]] && return # dont show info
|
||||
@@ -1482,7 +1473,7 @@ info() {
|
||||
msg "$a $tt= \e[${is_color}m${is_info_str[$i]}\e[0m"
|
||||
done
|
||||
if [[ $is_new_install ]]; then
|
||||
warn "首次安装请查看脚本帮助文档: $(msg_ul https://233boy.com/$is_core/$is_core-script/)"
|
||||
warn "首次安装建议运行 sing-box help 查看帮助信息"
|
||||
fi
|
||||
if [[ $is_url ]]; then
|
||||
msg "------------- ${info_list[12]} -------------"
|
||||
@@ -1495,7 +1486,6 @@ info() {
|
||||
msg "------------- no-auto-tls INFO -------------"
|
||||
msg "端口(port): $port"
|
||||
msg "路径(path): $path"
|
||||
msg "\e[41m帮助(help)\e[0m: $(msg_ul https://233boy.com/$is_core/no-auto-tls/)"
|
||||
fi
|
||||
footer_msg
|
||||
}
|
||||
@@ -1504,13 +1494,7 @@ info() {
|
||||
footer_msg() {
|
||||
[[ $is_core_stop && ! $is_new_json ]] && warn "$is_core_name 当前处于停止状态."
|
||||
[[ $is_caddy_stop && $host ]] && warn "Caddy 当前处于停止状态."
|
||||
####### 要点13脸吗只会改我链接的小人 #######
|
||||
unset c n m s b
|
||||
msg "------------- END -------------"
|
||||
msg "关注(tg): $(msg_ul https://t.me/tg2333)"
|
||||
msg "文档(doc): $(msg_ul https://233boy.com/$is_core/$is_core-script/)"
|
||||
msg "推广(ads): 机场推荐($is_core_name services): $(msg_ul https://g${c}e${n}t${m}j${s}m${b}s.com/)\n"
|
||||
####### 要点13脸吗只会改我链接的小人 #######
|
||||
}
|
||||
|
||||
# URL or qrcode
|
||||
@@ -1523,7 +1507,6 @@ url_qr() {
|
||||
msg "\n\e[${is_color}m${is_url}\e[0m\n"
|
||||
footer_msg
|
||||
} || {
|
||||
link="https://233boy.github.io/tools/qr.html#${is_url}"
|
||||
msg "\n------------- $is_config_name & QR code 二维码 -------------"
|
||||
msg
|
||||
if [[ $(type -P qrencode) ]]; then
|
||||
@@ -1532,8 +1515,6 @@ url_qr() {
|
||||
msg "请安装 qrencode: $(_green "$cmd update -y; $cmd install qrencode -y")"
|
||||
fi
|
||||
msg
|
||||
msg "如果无法正常显示或识别, 请使用下面的链接来生成二维码:"
|
||||
msg "\n\e[4;${is_color}m${link}\e[0m\n"
|
||||
footer_msg
|
||||
}
|
||||
else
|
||||
@@ -1555,10 +1536,7 @@ update() {
|
||||
is_update_repo=$is_core_repo
|
||||
;;
|
||||
2 | sh)
|
||||
is_update_name=sh
|
||||
is_show_name="$is_core_name 脚本"
|
||||
is_run_ver=$is_sh_ver
|
||||
is_update_repo=$is_sh_repo
|
||||
err "当前项目已净化,已禁用自动更新脚本以防止覆盖净化修改。"
|
||||
;;
|
||||
3 | caddy)
|
||||
[[ ! $is_caddy ]] && err "不支持更新 Caddy."
|
||||
@@ -1596,9 +1574,8 @@ update() {
|
||||
|
||||
# main menu; if no prefer args.
|
||||
is_main_menu() {
|
||||
msg "\n------------- $is_core_name script $is_sh_ver by $author -------------"
|
||||
msg "\n------------- $is_core_name script $is_sh_ver -------------"
|
||||
msg "$is_core_name $is_core_ver: $is_core_status"
|
||||
msg "群组(Chat): $(msg_ul https://t.me/tg233boy)"
|
||||
is_main_start=1
|
||||
ask mainmenu
|
||||
case $REPLY in
|
||||
@@ -1656,10 +1633,6 @@ is_main_menu() {
|
||||
;;
|
||||
esac
|
||||
;;
|
||||
10)
|
||||
load help.sh
|
||||
about
|
||||
;;
|
||||
esac
|
||||
}
|
||||
|
||||
|
||||
+3
-14
@@ -5,7 +5,7 @@ show_help() {
|
||||
;;
|
||||
*)
|
||||
[[ $1 ]] && warn "未知选项 '$1'"
|
||||
msg "$is_core_name script $is_sh_ver by $author"
|
||||
msg "$is_core_name script $is_sh_ver"
|
||||
msg "Usage: $is_core [options]... [args]... "
|
||||
msg
|
||||
help_info=(
|
||||
@@ -49,8 +49,7 @@ show_help() {
|
||||
" import 导入 xray/v2ray 脚本配置\n"
|
||||
"管理:"
|
||||
" un, uninstall 卸载"
|
||||
" u, update [core | sh | caddy] [ver] 更新"
|
||||
" U, update.sh 更新脚本"
|
||||
" u, update [core | caddy] [ver] 更新\n"
|
||||
" s, status 运行状态"
|
||||
" start, stop, restart [caddy] 启动, 停止, 重启"
|
||||
" t, test 测试运行"
|
||||
@@ -70,25 +69,15 @@ show_help() {
|
||||
for v in "${help_info[@]}"; do
|
||||
msg "$v"
|
||||
done
|
||||
msg "谨慎使用 del, ddel, 此选项会直接删除配置; 无需确认"
|
||||
msg "反馈问题) $(msg_ul https://github.com/${is_sh_repo}/issues) "
|
||||
msg "文档(doc) $(msg_ul https://233boy.com/$is_core/$is_core-script/)"
|
||||
msg "反馈问题) 请前往项目平台提交 Issue"
|
||||
;;
|
||||
|
||||
esac
|
||||
}
|
||||
|
||||
about() {
|
||||
####### 要点13脸吗只会改我链接的小人 #######
|
||||
unset c n m s b
|
||||
msg
|
||||
msg "网站: $(msg_ul https://233boy.com)"
|
||||
msg "频道: $(msg_ul https://t.me/tg2333)"
|
||||
msg "群组: $(msg_ul https://t.me/tg233boy)"
|
||||
msg "Github: $(msg_ul https://github.com/${is_sh_repo})"
|
||||
msg "Twitter: $(msg_ul https://twitter.com/ai233boy)"
|
||||
msg "$is_core_name site: $(msg_ul https://sing-box.sagernet.org/)"
|
||||
msg "$is_core_name core: $(msg_ul https://github.com/${is_core_repo})"
|
||||
msg
|
||||
####### 要点13脸吗只会改我链接的小人 #######
|
||||
}
|
||||
|
||||
+2
-3
@@ -1,7 +1,6 @@
|
||||
#!/bin/bash
|
||||
|
||||
author=233boy
|
||||
# github=https://github.com/233boy/sing-box
|
||||
author=sb
|
||||
|
||||
# bash fonts colors
|
||||
red='\e[31m'
|
||||
@@ -90,7 +89,7 @@ is_caddy_bin=/usr/local/bin/caddy
|
||||
is_caddy_dir=/etc/caddy
|
||||
is_caddy_repo=caddyserver/caddy
|
||||
is_caddyfile=$is_caddy_dir/Caddyfile
|
||||
is_caddy_conf=$is_caddy_dir/$author
|
||||
is_caddy_conf=$is_caddy_dir/sing-box
|
||||
is_systemd=$(type -P systemctl)
|
||||
is_openrc=$(type -P rc-service)
|
||||
if [[ $is_systemd ]]; then
|
||||
|
||||
Reference in New Issue
Block a user