| 1 | import { timingSafeEqual } from "crypto"; |
| 2 | import type { NextRequest |
| 3 | import { z } |
| 4 | import { env } |
| 5 | import { BootstrapError, bootstrapInstaller |
| 6 | |
| 7 | const bodySchema = z |
| 8 | email: z.string |
| 9 | password: z.string |
| 10 | name: z.string |
| 11 | locationName: z.string |
| 12 | wings: z |
| 13 | .object({ |
| 14 | fqdn: z.string |
| 15 | nodeName: z.string |
| 16 | scheme: z.enum |
| 17 | daemonListen: z.number |
| 18 | memory: z.number |
| 19 | disk: z.number |
| 20 | uploadSize: z.number |
| 21 | }) |
| 22 | .optional(), |
| 23 | }); |
| 24 | |
| 25 | function secretMatches(header: |
| 26 | if (!header) |
| 27 | const a = |
| 28 | const b = |
| 29 | return a.length |
| 30 | } |
| 31 | |
| 32 | export async function POST |
| 33 | const secret = |
| 34 | if (!secret || |
| 35 | return new Response |
| 36 | } |
| 37 | |
| 38 | const parsed = |
| 39 | if (!parsed.success |
| 40 | return new Response |
| 41 | } |
| 42 | |
| 43 | try { |
| 44 | return Response.json |
| 45 | } catch (e) |
| 46 | if (e instanceof |
| 47 | return Response.json |
| 48 | } |
| 49 | throw e; |
| 50 | } |
| 51 | } |