~添加ss和vmess入站支持

This commit is contained in:
juewuy
2025-12-20 12:54:42 +08:00
parent 8d20c90900
commit 51f5795731
6 changed files with 207 additions and 26 deletions

View File

@@ -0,0 +1,25 @@
#!/bin/sh
# Copyright (C) Juewuy
#meta内核vmess入站生成
[ "$vms_service" = ON ] && {
cat >>"$TMPDIR"/yamls/listeners.yaml <<EOF
- name: "vmess-in"
type: vmess
port: $vms_port
listen: 0.0.0.0
uuid: $vms_uuid
ws-path: $vms_ws_path
EOF
}
#meta内核ss入站生成
[ "$sss_service" = ON ] && {
cat >>"$TMPDIR"/yamls/listeners.yaml <<EOF
- name: "ss-in"
port: $sss_port
listen: 0.0.0.0
cipher: $sss_cipher
password: $sss_pwd
udp: true
EOF
}

View File

@@ -0,0 +1,19 @@
#!/bin/sh
# Copyright (C) Juewuy
[ "$wg_service" = ON ] && {
cat >>"$TMPDIR"/yamls/proxies.yaml <<EOF
- name: "wg"
type: wireguard
private-key: $wg_private_key
server: $wg_server
port: $wg_port
ip: $wg_ipv4
ipv6: $wg_ipv6
public-key: $wg_public_key
allowed-ips: ['0.0.0.0/0', '::/0']
pre-shared-key: $wg_pre_shared_key
mtu: 1420
udp: true
EOF
}

View File

@@ -0,0 +1,50 @@
#!/bin/sh
# Copyright (C) Juewuy
[ "$ts_service" = ON ] && {
[ "$ts_subnet" = true ] && advertise_routes='"10.0.0.0/8", "172.16.0.0/12", "192.168.0.0/16"'
[ -z "$ts_exit_node" ] && ts_exit_node=false
cat >"$TMPDIR"/jsons/tailscale.json <<EOF
{
"endpoints": [
{
"type": "tailscale",
"tag": "ts-ep",
"state_directory": "/tmp/ShellCrash/tailscale",
"auth_key": "$ts_auth_key",
"hostname": "ShellCrash-ts-ep",
"advertise_routes": [$advertise_routes],
"advertise_exit_node": $ts_exit_node,
"udp_timeout": "5m"
}
]
}
EOF
}
[ "$wg_service" = ON ] && {
[ -n "$wg_ipv6" ] && wg_ipv6_add=", \"$wg_ipv6\""
cat >"$TMPDIR"/jsons/wireguard.json <<EOF
{
"endpoints": [
{
"type": "wireguard",
"tag": "wg-ep",
"system": true,
"mtu": 1420,
"address": [ "$wg_ipv4"$wg_ipv6_add ],
"private_key": "$wg_private_key",
"peers": [
{
"address": "$wg_server",
"port": $wg_port,
"public_key": "$wg_public_key",
"pre_shared_key": "$wg_pre_shared_key",
"allowed_ips": ["0.0.0.0/0", "::/0"]
}
]
}
]
}
EOF
}

View File

@@ -0,0 +1,38 @@
#!/bin/sh
# Copyright (C) Juewuy
[ "$vms_service" = ON ] && {
[ -n "$vms_ws_path" ] && transport=', "transport": { "type": "ws", "path": '"$vms_ws_path"' }'
cat >"$TMPDIR"/jsons/vmess-in.json <<EOF
{
"inbounds": [
{
"type": "vmess",
"tag": "vmess-in",
"listen": "::",
"listen_port": $vms_port,
"users": [
{
"uuid": "$vms_uuid"
}
]$transport
}
]
}
EOF
}
[ "$sss_service" = ON ] && {
cat >"$TMPDIR"/jsons/ss-in.json <<EOF
{
"inbounds": [
{
"type": "shadowsocks",
"tag": "ss-in",
"method": "$sss_cipher",
"password": "$sss_pwd",
}
]
}
EOF
}