-
Notifications
You must be signed in to change notification settings - Fork 1
/
types.ts
111 lines (104 loc) · 2.46 KB
/
types.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
export interface UpstreamServer {
address: string;
weight?: number;
maxFails?: number;
failTimeout?: string;
}
export interface CacheConfig {
enabled: boolean;
validTime?: string;
keys?: string[];
useStale?: string[];
minUses?: number;
bypass?: string[];
noCache?: string[];
noStore?: string[];
methods?: string[];
}
export interface RateLimit {
rate: string;
burstSize?: number;
nodelay?: boolean;
}
export interface SecurityHeaders {
xFrameOptions?: string;
xContentTypeOptions?: boolean;
xXSSProtection?: boolean;
strictTransport?: boolean;
referrerPolicy?: string;
contentSecurityPolicy?: string[];
}
export interface SSLConfig {
certificate: string;
certificateKey: string;
protocols?: string[];
forceRedirect?: boolean;
ciphers?: string[];
preferServerCiphers?: boolean;
dhParam?: string;
ocspStapling?: boolean;
sessionTimeout?: string;
sessionTickets?: boolean;
hsts?: {
enabled: boolean;
maxAge?: number;
includeSubdomains?: boolean;
preload?: boolean;
};
}
export interface WebSocketConfig {
enabled: boolean;
timeout?: number;
keepaliveTimeout?: number;
}
export interface MicroserviceRoute {
path: string;
upstream: string;
rewrite?: string;
stripPath?: boolean;
methods?: string[];
cors?: {
enabled: boolean;
origins?: string[];
methods?: string[];
headers?: string[];
credentials?: boolean;
};
}
export interface NginxConfig {
domain: string;
serverName: string;
port: number;
ssl?: SSLConfig;
security?: SecurityHeaders;
clientMaxBodySize?: string;
upstreams?: {
[name: string]: UpstreamServer[];
};
gzip?: boolean;
gzipTypes?: string[];
microservices?: MicroserviceRoute[];
locations: {
path: string;
proxyPass?: string;
root?: string;
index?: string;
try_files?: string;
extraDirectives?: string[];
php?: {
enabled: boolean;
socketPath?: string;
extraParams?: { [key: string]: string };
};
websocket?: WebSocketConfig;
cache?: CacheConfig;
rateLimit?: RateLimit;
cors?: {
enabled: boolean;
origins?: string[];
methods?: string[];
headers?: string[];
credentials?: boolean;
};
}[];
}