mirror of
https://github.com/MHSanaei/3x-ui.git
synced 2026-07-25 05:46:18 +00:00
feat(inbounds): expose Vision testseed field with sensible default
Add a "Vision testseed" form item to the inbound modal for TCP + TLS/reality inbounds, normalized to positive integers and defaulting to [900,500,900,256]. Apply the same default in the outbound form adapter when no valid saved seed is present. Replace the http/mixed snapshot assertions in inbound-defaults with explicit field checks so generated credentials don't break the snapshots.
This commit is contained in:
@@ -112,13 +112,23 @@ describe('createDefault*InboundSettings factories', () => {
|
||||
|
||||
it('http', () => {
|
||||
const s = createDefaultHttpInboundSettings();
|
||||
expect(s).toMatchSnapshot();
|
||||
expect(s.allowTransparent).toBe(false);
|
||||
const accounts = s.accounts ?? [];
|
||||
expect(accounts).toHaveLength(1);
|
||||
expect(accounts[0].user.length).toBe(8);
|
||||
expect(accounts[0].pass.length).toBe(12);
|
||||
expect(HttpInboundSettingsSchema.parse(s)).toEqual(s);
|
||||
});
|
||||
|
||||
it('mixed', () => {
|
||||
const s = createDefaultMixedInboundSettings();
|
||||
expect(s).toMatchSnapshot();
|
||||
expect(s.auth).toBe('password');
|
||||
expect(s.udp).toBe(false);
|
||||
expect(s.ip).toBe('127.0.0.1');
|
||||
const accounts = s.accounts ?? [];
|
||||
expect(accounts).toHaveLength(1);
|
||||
expect(accounts[0].user.length).toBe(8);
|
||||
expect(accounts[0].pass.length).toBe(12);
|
||||
expect(MixedInboundSettingsSchema.parse(s)).toEqual(s);
|
||||
});
|
||||
|
||||
|
||||
Reference in New Issue
Block a user