AmneziaWG 2.0 (#2226)
* feat!: awg * feat: add description to fields, add I5 * fix: awg i18n * fix: types * minor fixes * Remove TODO comment from types.ts Removed TODO comment for more validation. --------- Co-authored-by: Bernd Storath <999999bst@gmail.com>
This commit is contained in:
committed by
GitHub
parent
a8ba7f7247
commit
6a282e6ab9
@@ -36,6 +36,14 @@ export const client = sqliteTable('clients_table', {
|
||||
.notNull(),
|
||||
persistentKeepalive: int('persistent_keepalive').notNull(),
|
||||
mtu: int().notNull(),
|
||||
jC: int('j_c'),
|
||||
jMin: int('j_min'),
|
||||
jMax: int('j_max'),
|
||||
i1: text(),
|
||||
i2: text(),
|
||||
i3: text(),
|
||||
i4: text(),
|
||||
i5: text(),
|
||||
dns: text({ mode: 'json' }).$type<string[]>(),
|
||||
serverEndpoint: text('server_endpoint'),
|
||||
enabled: int({ mode: 'boolean' }).notNull(),
|
||||
|
||||
@@ -214,6 +214,14 @@ export class ClientService {
|
||||
ipv4Address,
|
||||
ipv6Address,
|
||||
mtu: clientConfig.defaultMtu,
|
||||
jC: clientConfig.defaultJC,
|
||||
jMin: clientConfig.defaultJMin,
|
||||
jMax: clientConfig.defaultJMax,
|
||||
i1: clientConfig.defaultI1,
|
||||
i2: clientConfig.defaultI2,
|
||||
i3: clientConfig.defaultI3,
|
||||
i4: clientConfig.defaultI4,
|
||||
i5: clientConfig.defaultI5,
|
||||
persistentKeepalive: clientConfig.defaultPersistentKeepalive,
|
||||
serverAllowedIps: [],
|
||||
enabled: true,
|
||||
@@ -278,6 +286,13 @@ export class ClientService {
|
||||
ipv4Address,
|
||||
ipv6Address,
|
||||
mtu: clientConfig.defaultMtu,
|
||||
jC: clientConfig.defaultJC,
|
||||
jMin: clientConfig.defaultJMin,
|
||||
jMax: clientConfig.defaultJMax,
|
||||
i1: clientConfig.defaultI1,
|
||||
i2: clientConfig.defaultI2,
|
||||
i3: clientConfig.defaultI3,
|
||||
i4: clientConfig.defaultI4,
|
||||
allowedIps: clientConfig.defaultAllowedIps,
|
||||
dns: clientConfig.defaultDns,
|
||||
persistentKeepalive: clientConfig.defaultPersistentKeepalive,
|
||||
|
||||
@@ -72,6 +72,14 @@ export const ClientUpdateSchema = schemaForType<UpdateClientType>()(
|
||||
allowedIps: AllowedIpsSchema.nullable(),
|
||||
serverAllowedIps: serverAllowedIps,
|
||||
mtu: MtuSchema,
|
||||
jC: JcSchema,
|
||||
jMin: JminSchema,
|
||||
jMax: JmaxSchema,
|
||||
i1: ISchema,
|
||||
i2: ISchema,
|
||||
i3: ISchema,
|
||||
i4: ISchema,
|
||||
i5: ISchema,
|
||||
persistentKeepalive: PersistentKeepaliveSchema,
|
||||
serverEndpoint: AddressSchema.nullable(),
|
||||
dns: DnsSchema.nullable(),
|
||||
|
||||
@@ -13,6 +13,22 @@ export const wgInterface = sqliteTable('interfaces_table', {
|
||||
ipv4Cidr: text('ipv4_cidr').notNull(),
|
||||
ipv6Cidr: text('ipv6_cidr').notNull(),
|
||||
mtu: int().notNull(),
|
||||
jC: int('j_c').default(7),
|
||||
jMin: int('j_min').default(10),
|
||||
jMax: int('j_max').default(1000),
|
||||
s1: int().default(128),
|
||||
s2: int().default(56),
|
||||
s3: int(),
|
||||
s4: int(),
|
||||
i1: text(),
|
||||
i2: text(),
|
||||
i3: text(),
|
||||
i4: text(),
|
||||
i5: text(),
|
||||
h1: int().default(0),
|
||||
h2: int().default(0),
|
||||
h3: int().default(0),
|
||||
h4: int().default(0),
|
||||
// does nothing yet
|
||||
enabled: int({ mode: 'boolean' }).notNull(),
|
||||
createdAt: text('created_at')
|
||||
|
||||
@@ -31,6 +31,22 @@ export const InterfaceUpdateSchema = schemaForType<InterfaceUpdateType>()(
|
||||
ipv4Cidr: cidr,
|
||||
ipv6Cidr: cidr,
|
||||
mtu: MtuSchema,
|
||||
jC: JcSchema,
|
||||
jMin: JminSchema,
|
||||
jMax: JmaxSchema,
|
||||
s1: SSchema,
|
||||
s2: SSchema,
|
||||
s3: SSchema,
|
||||
s4: SSchema,
|
||||
i1: ISchema,
|
||||
i2: ISchema,
|
||||
i3: ISchema,
|
||||
i4: ISchema,
|
||||
i5: ISchema,
|
||||
h1: HSchema,
|
||||
h2: HSchema,
|
||||
h3: HSchema,
|
||||
h4: HSchema,
|
||||
port: PortSchema,
|
||||
device: device,
|
||||
enabled: EnabledSchema,
|
||||
|
||||
@@ -18,6 +18,14 @@ export const userConfig = sqliteTable('user_configs_table', {
|
||||
defaultAllowedIps: text('default_allowed_ips', { mode: 'json' })
|
||||
.$type<string[]>()
|
||||
.notNull(),
|
||||
defaultJC: int('default_j_c').default(7),
|
||||
defaultJMin: int('default_j_min').default(10),
|
||||
defaultJMax: int('default_j_max').default(1000),
|
||||
defaultI1: text('default_i1'),
|
||||
defaultI2: text('default_i2'),
|
||||
defaultI3: text('default_i3'),
|
||||
defaultI4: text('default_i4'),
|
||||
defaultI5: text('default_i5'),
|
||||
host: text().notNull(),
|
||||
port: int().notNull(),
|
||||
createdAt: text('created_at')
|
||||
|
||||
@@ -26,6 +26,14 @@ export const UserConfigUpdateSchema = schemaForType<UserConfigUpdateType>()(
|
||||
defaultPersistentKeepalive: PersistentKeepaliveSchema,
|
||||
defaultDns: DnsSchema,
|
||||
defaultAllowedIps: AllowedIpsSchema,
|
||||
defaultJC: JcSchema,
|
||||
defaultJMin: JminSchema,
|
||||
defaultJMax: JmaxSchema,
|
||||
defaultI1: ISchema,
|
||||
defaultI2: ISchema,
|
||||
defaultI3: ISchema,
|
||||
defaultI4: ISchema,
|
||||
defaultI5: ISchema,
|
||||
host: host,
|
||||
})
|
||||
);
|
||||
|
||||
Reference in New Issue
Block a user