-
Notifications
You must be signed in to change notification settings - Fork 28
Expand file tree
/
Copy pathtypes.ts
More file actions
166 lines (153 loc) · 4.22 KB
/
Copy pathtypes.ts
File metadata and controls
166 lines (153 loc) · 4.22 KB
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
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
// CLI types
export interface CliGlobalOptions {
dir: string;
silent?: boolean;
verbose?: boolean;
}
export interface ListrContextBuildAndPublish {
// Build and upload
releaseHash: string;
releaseMultiHash: string;
// create Github release
nextVersion: string;
txData: TxData;
}
// Interal types
export type Architecture = "linux/amd64" | "linux/arm64";
export const architectures: Architecture[] = ["linux/amd64", "linux/arm64"];
export const defaultArch = "linux/amd64";
export type ReleaseType = "major" | "minor" | "patch";
export const releaseTypes: ReleaseType[] = ["major", "minor", "patch"];
export type PackageImageLocal = {
type: "local";
imageTag: string;
};
export type PackageImageExternal = {
type: "external";
imageTag: string;
originalImageTag: string;
};
export type PackageImage = PackageImageLocal | PackageImageExternal;
export interface TxData {
to: string;
value: number;
data: string;
gasLimit: number;
ensName: string;
currentVersion: string;
releaseMultiHash: string;
developerAddress?: string;
}
export interface TxDataShortKeys {
r: string; // repoName
v: string; // version
h: string; // hash
d?: string; // developerAddress
}
export interface Manifest {
name: string;
version: string;
upstreamVersion?: string;
description?: string;
type?: string;
author?: string;
license?: string;
avatar?: string;
image?: ManifestImage;
repository?: {
type?: string;
url?: string;
directory?: string;
};
categories?: string[];
links?: {
homepage?: string;
ui?: string;
api?: string;
gateway?: string;
[linkName: string]: string | undefined;
};
architectures?: Architecture[];
}
export interface ManifestImage {
hash: string;
size: number;
path: string;
volumes?: string[];
external_vol?: string[];
ports?: string[];
environment?: string[];
restart?: string;
privileged?: boolean;
cap_add?: string[];
cap_drop?: string[];
devices?: string[];
subnet?: string;
ipv4_address?: string;
network_mode?: string;
command?: string;
labels?: string[];
}
export interface ComposeVolumes {
// volumeName: "dncore_ipfsdnpdappnodeeth_data"
[volumeName: string]: {
// Allowed to user
external?: boolean | { name: string }; // name: "dncore_ipfsdnpdappnodeeth_data"
// NOT allowed to user, only used by DAppNode internally (if any)
name?: string; // Volumes can only be declared locally or be external
driver?: string; // Dangerous
driver_opts?:
| { type: "none"; device: string; o: "bind" }
| { [driverOptName: string]: string }; // driver_opts are passed down to whatever driver is being used, there's. No verification on docker's part nor detailed documentation
labels?: { [labelName: string]: string }; // User should not use this feature
};
}
export interface ComposeService {
build?:
| string
| {
context?: string; // ./dir
dockerfile?: string; // Dockerfile-alternate
args?: { [varName: string]: string }; // { buildno: 1}
};
container_name?: string; // "DAppNodeCore-dappmanager.dnp.dappnode.eth";
image: string; // "dappmanager.dnp.dappnode.eth:0.2.6";
volumes?: string[]; // ["dappmanagerdnpdappnodeeth_data:/usr/src/app/dnp_repo/"];
ports?: string[];
environment?: { [key: string]: string } | string[];
labels?: { [labelName: string]: string };
env_file?: string[];
// ipv4_address: "172.33.1.7";
networks?: string[] | { [networkName: string]: { ipv4_address: string } };
dns?: string; // "172.33.1.2";
restart?: string; // "always";
privileged?: boolean;
cap_add?: string[];
cap_drop?: string[];
devices?: string[];
network_mode?: string;
command?: string;
entrypoint?: string;
// Logging
logging?: {
driver?: string;
options?: {
[optName: string]: string | number | null;
};
};
}
export interface Compose {
version: string; // "3.4"
// dnpName: "dappmanager.dnp.dappnode.eth"
services: {
[dnpName: string]: ComposeService;
};
networks?: {
[networkName: string]: {
external?: boolean;
driver?: string; // "bridge";
ipam?: { config: { subnet: string }[] }; // { subnet: "172.33.0.0/16" }
};
};
volumes?: ComposeVolumes; // { dappmanagerdnpdappnodeeth_data: {} };
}