1 | |
2 | |
3 | * Add custom domain to the helm. |
4 | * Add a custom domain to this helm in order not to use qovery autogenerated domain |
5 | */ |
6 | export async function main(auth: RT.Qovery, helmId: string, body: Body) { |
7 | const url = new URL(`https://api.qovery.com/helm/${helmId}/customDomain`) |
8 |
|
9 | const response = await fetch(url, { |
10 | method: 'POST', |
11 | headers: { |
12 | 'Content-Type': 'application/json', |
13 | Authorization: 'Token ' + auth.apiKey |
14 | }, |
15 | body: JSON.stringify(body) |
16 | }) |
17 | if (!response.ok) { |
18 | const text = await response.text() |
19 | throw new Error(`${response.status} ${text}`) |
20 | } |
21 | return await response.json() |
22 | } |
23 |
|
24 | |
25 | |
26 | * This file was automatically generated by json-schema-to-typescript. |
27 | * DO NOT MODIFY IT BY HAND. Instead, modify the source JSONSchema file, |
28 | * and run json-schema-to-typescript to regenerate this file. |
29 | */ |
30 |
|
31 | export interface Body { |
32 | |
33 | * your custom domain |
34 | */ |
35 | domain: string |
36 | |
37 | * to control if a certificate has to be generated for this custom domain by Qovery. The default value is `true`. This flag should be set to `false` if a CDN or other entities are managing the certificate for the specified domain and the traffic is proxied by the CDN to Qovery. |
38 | */ |
39 | generate_certificate: boolean |
40 | |
41 | * Indicates if the custom domain is behind a CDN (i.e Cloudflare). |
42 | * This will condition the way we are checking CNAME before & during a deployment: |
43 | * * If `true` then we only check the domain points to an IP |
44 | * * If `false` then we check that the domain resolves to the correct service Load Balancer |
45 | * |
46 | */ |
47 | use_cdn?: boolean |
48 | [k: string]: unknown |
49 | } |
50 |
|