mirror of
https://github.com/fosrl/pangolin.git
synced 2026-03-03 09:16:40 +00:00
Merge branch 'clients' of https://github.com/fosrl/pangolin_dg into clients
This commit is contained in:
@@ -37,10 +37,10 @@ const createClientSchema = z
|
||||
.object({
|
||||
name: z.string().min(1).max(255),
|
||||
siteId: z.number().int().positive(),
|
||||
pubKey: z.string(),
|
||||
subnet: z.string(),
|
||||
olmId: z.string(),
|
||||
secret: z.string(),
|
||||
pubKey: z.string().optional(),
|
||||
subnet: z.string().optional(),
|
||||
olmId: z.string().optional(),
|
||||
secret: z.string().optional(),
|
||||
type: z.enum(["olm"])
|
||||
})
|
||||
.strict();
|
||||
|
||||
@@ -101,12 +101,16 @@ export async function pickClientDefaults(
|
||||
subnets.push(
|
||||
address.replace(
|
||||
/\/\d+$/,
|
||||
`/${config.getRawConfig().wg_site.block_size}`
|
||||
`/${config.getRawConfig().wg_site.site_block_size}`
|
||||
)
|
||||
);
|
||||
logger.debug(`Subnets: ${subnets}`);
|
||||
logger.debug(`Address: ${address}`);
|
||||
logger.debug(`Block size: ${config.getRawConfig().wg_site.block_size}`);
|
||||
logger.debug(`Site block size: ${config.getRawConfig().wg_site.site_block_size}`);
|
||||
const newSubnet = findNextAvailableCidr(
|
||||
subnets,
|
||||
config.getRawConfig().wg_site.block_size,
|
||||
config.getRawConfig().wg_site.site_block_size,
|
||||
address
|
||||
);
|
||||
if (!newSubnet) {
|
||||
|
||||
Reference in New Issue
Block a user