fix(inbounds): refuse 2022-blake3-chacha20-poly1305 on shadowsocks inbounds

xray-core builds a Shadowsocks-2022 inbound with users only for the AES
methods: the multi-user identity header is AES-only, so the config
builder and the multi-user server both reject chacha20. Every panel
inbound carries clients, so picking 2022-blake3-chacha20-poly1305 in the
inbound form kept the whole core from starting; its links also failed
on the client with "multi-key is not supported".

The inbound form no longer offers the method and AddInbound/UpdateInbound
reject it. Startup moves stored inbounds to 2022-blake3-aes-256-gcm,
which takes the same 32-byte keys, so every stored key stays valid.
Outbounds keep the method, since a single-key outbound to such a server
works. The share-link generator drops the single-user branch that only
this method reached.
This commit is contained in:
MHSanaei
2026-10-11 21:20:07 +02:00
parent b9e1d3afee
commit f1ed1a9b17
16 changed files with 203 additions and 45 deletions
@@ -1,6 +1,6 @@
import { z } from 'zod';
import { SSMethodSchema } from '../shared/shadowsocks';
import { SSInboundMethodSchema } from '../shared/shadowsocks';
export const SSNetworkSchema = z.enum(['tcp', 'udp', 'tcp,udp']);
export type SSNetwork = z.infer<typeof SSNetworkSchema>;
@@ -30,7 +30,7 @@ export const ShadowsocksClientSchema = z.object({
export type ShadowsocksClient = z.infer<typeof ShadowsocksClientSchema>;
export const ShadowsocksInboundSettingsSchema = z.object({
method: SSMethodSchema.default('2022-blake3-aes-256-gcm'),
method: SSInboundMethodSchema.default('2022-blake3-aes-256-gcm'),
password: z.string().default(''),
network: SSNetworkSchema.default('tcp,udp'),
clients: z.array(ShadowsocksClientSchema).default([]),
@@ -10,3 +10,7 @@ export const SSMethodSchema = z.enum([
'2022-blake3-chacha20-poly1305',
]);
export type SSMethod = z.infer<typeof SSMethodSchema>;
// xray-core refuses a 2022 chacha20 inbound with users: the multi-user identity
// header is AES-only, and every panel inbound carries users.
export const SSInboundMethodSchema = SSMethodSchema.exclude(['2022-blake3-chacha20-poly1305']);