Expand Shadowsocks runtime compatibility
This commit is contained in:
parent
d1638726ca
commit
4d1f589280
167 changed files with 57173 additions and 1640 deletions
47
deploy/railway-sing-box/entrypoint.sh
Normal file
47
deploy/railway-sing-box/entrypoint.sh
Normal file
|
|
@ -0,0 +1,47 @@
|
|||
#!/bin/sh
|
||||
set -eu
|
||||
|
||||
: "${SS_PASSWORD:?Set SS_PASSWORD to a strong test password in Railway variables}"
|
||||
|
||||
SS_METHOD="${SS_METHOD:-chacha20-ietf-poly1305}"
|
||||
SS_LISTEN_HOST="${SS_LISTEN_HOST:-0.0.0.0}"
|
||||
SS_LISTEN_PORT="${SS_LISTEN_PORT:-8388}"
|
||||
LOG_LEVEL="${LOG_LEVEL:-info}"
|
||||
|
||||
json_escape() {
|
||||
printf '%s' "$1" | sed 's/\\/\\\\/g; s/"/\\"/g'
|
||||
}
|
||||
|
||||
SS_METHOD_JSON="$(json_escape "$SS_METHOD")"
|
||||
SS_PASSWORD_JSON="$(json_escape "$SS_PASSWORD")"
|
||||
LOG_LEVEL_JSON="$(json_escape "$LOG_LEVEL")"
|
||||
SS_LISTEN_HOST_JSON="$(json_escape "$SS_LISTEN_HOST")"
|
||||
|
||||
mkdir -p /etc/sing-box
|
||||
cat >/etc/sing-box/config.json <<EOF
|
||||
{
|
||||
"log": {
|
||||
"level": "$LOG_LEVEL_JSON",
|
||||
"timestamp": true
|
||||
},
|
||||
"inbounds": [
|
||||
{
|
||||
"type": "shadowsocks",
|
||||
"tag": "ss-test",
|
||||
"listen": "$SS_LISTEN_HOST_JSON",
|
||||
"listen_port": $SS_LISTEN_PORT,
|
||||
"method": "$SS_METHOD_JSON",
|
||||
"password": "$SS_PASSWORD_JSON"
|
||||
}
|
||||
],
|
||||
"outbounds": [
|
||||
{
|
||||
"type": "direct",
|
||||
"tag": "direct"
|
||||
}
|
||||
]
|
||||
}
|
||||
EOF
|
||||
|
||||
echo "starting sing-box Shadowsocks test server on $SS_LISTEN_HOST:$SS_LISTEN_PORT"
|
||||
exec sing-box run -c /etc/sing-box/config.json
|
||||
Loading…
Add table
Add a link
Reference in a new issue