@wocker/ws 1.0.13 → 1.0.15
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/AppModule.js +3 -2
- package/lib/controllers/PresetController.d.ts +2 -1
- package/lib/controllers/PresetController.js +31 -4
- package/lib/controllers/ProjectController.d.ts +12 -3
- package/lib/controllers/ProjectController.js +259 -51
- package/lib/controllers/ProxyController.d.ts +5 -12
- package/lib/controllers/ProxyController.js +25 -220
- package/lib/env.d.ts +1 -0
- package/lib/env.js +2 -1
- package/lib/plugins/index.d.ts +0 -1
- package/lib/plugins/index.js +0 -1
- package/lib/services/DockerService.d.ts +1 -1
- package/lib/services/DockerService.js +20 -15
- package/lib/services/PluginService.js +1 -1
- package/lib/services/PresetService.d.ts +7 -3
- package/lib/services/PresetService.js +158 -21
- package/lib/services/ProjectService.d.ts +4 -6
- package/lib/services/ProjectService.js +34 -45
- package/lib/services/ProxyService.d.ts +14 -0
- package/lib/services/ProxyService.js +87 -0
- package/lib/services/index.d.ts +1 -0
- package/lib/services/index.js +1 -0
- package/package.json +5 -3
- package/presets/bun/config.json +1 -0
- package/presets/go/config.json +1 -0
- package/presets/php-fpm/config.json +1 -0
- package/presets/shopify/config.json +2 -0
- package/lib/plugins/PageKitePlugin.d.ts +0 -30
- package/lib/plugins/PageKitePlugin.js +0 -145
- package/plugins/pagekite/Dockerfile +0 -3
- package/presets/node/Dockerfile +0 -39
- package/presets/node/config.json +0 -39
- package/presets/php-apache/Dockerfile +0 -227
- package/presets/php-apache/bin/compare-version +0 -3
- package/presets/php-apache/config.json +0 -64
- package/presets/php-apache/etc/apache2/apache2.conf +0 -230
- package/presets/php-apache/etc/apache2/mods-available/mpm_prefork.conf +0 -16
- package/presets/php-apache/etc/apache2/sites-available/000-default.conf +0 -21
package/lib/AppModule.js
CHANGED
|
@@ -47,7 +47,7 @@ let AppModule = AppModule_1 = class AppModule {
|
|
|
47
47
|
if (!Plugin) {
|
|
48
48
|
continue;
|
|
49
49
|
}
|
|
50
|
-
const name = Reflect.getMetadata(core_1.
|
|
50
|
+
const name = Reflect.getMetadata(core_1.PLUGIN_NAME_METADATA, Plugin);
|
|
51
51
|
Reflect.defineMetadata(core_1.MODULE_METADATA.PROVIDERS, [
|
|
52
52
|
...Reflect.getMetadata(core_1.MODULE_METADATA.PROVIDERS, Plugin) || [],
|
|
53
53
|
{
|
|
@@ -88,7 +88,8 @@ exports.AppModule = AppModule = AppModule_1 = __decorate([
|
|
|
88
88
|
services_1.LogService,
|
|
89
89
|
services_1.PluginService,
|
|
90
90
|
services_1.PresetService,
|
|
91
|
-
services_1.ProjectService
|
|
91
|
+
services_1.ProjectService,
|
|
92
|
+
services_1.ProxyService
|
|
92
93
|
],
|
|
93
94
|
exports: [
|
|
94
95
|
services_1.AppConfigService,
|
|
@@ -11,7 +11,8 @@ export declare class PresetController {
|
|
|
11
11
|
protected onInit(project: Project): Promise<void>;
|
|
12
12
|
protected onRebuild(project: Project): Promise<void>;
|
|
13
13
|
protected onBeforeStart(project: Project): Promise<void>;
|
|
14
|
-
add(
|
|
14
|
+
add(name: string): Promise<void>;
|
|
15
|
+
delete(name: string, confirm?: boolean): Promise<void>;
|
|
15
16
|
eject(name?: string): Promise<void>;
|
|
16
17
|
build(rebuild: boolean, presetName: string): Promise<void>;
|
|
17
18
|
}
|
|
@@ -115,7 +115,7 @@ let PresetController = class PresetController {
|
|
|
115
115
|
}
|
|
116
116
|
}
|
|
117
117
|
async onRebuild(project) {
|
|
118
|
-
if (project.type !==
|
|
118
|
+
if (project.type !== core_1.PROJECT_TYPE_PRESET) {
|
|
119
119
|
return;
|
|
120
120
|
}
|
|
121
121
|
const preset = await this.presetService.get(project.preset);
|
|
@@ -130,7 +130,7 @@ let PresetController = class PresetController {
|
|
|
130
130
|
}
|
|
131
131
|
}
|
|
132
132
|
async onBeforeStart(project) {
|
|
133
|
-
if (project.type !==
|
|
133
|
+
if (project.type !== core_1.PROJECT_TYPE_PRESET) {
|
|
134
134
|
return;
|
|
135
135
|
}
|
|
136
136
|
const preset = await this.presetService.get(project.preset);
|
|
@@ -143,13 +143,28 @@ let PresetController = class PresetController {
|
|
|
143
143
|
presetName: preset.name
|
|
144
144
|
},
|
|
145
145
|
buildArgs: project.buildArgs,
|
|
146
|
-
context:
|
|
146
|
+
context: preset.path,
|
|
147
147
|
src: preset.dockerfile
|
|
148
148
|
});
|
|
149
149
|
}
|
|
150
150
|
}
|
|
151
151
|
}
|
|
152
|
-
async add(
|
|
152
|
+
async add(name) {
|
|
153
|
+
await this.presetService.addPreset(name);
|
|
154
|
+
}
|
|
155
|
+
async delete(name, confirm) {
|
|
156
|
+
const preset = await this.presetService.get(name);
|
|
157
|
+
if (typeof confirm === "undefined" || confirm === null) {
|
|
158
|
+
confirm = await (0, utils_2.promptConfirm)({
|
|
159
|
+
message: `Delete preset ${name}?`,
|
|
160
|
+
default: false
|
|
161
|
+
});
|
|
162
|
+
}
|
|
163
|
+
if (!confirm) {
|
|
164
|
+
return;
|
|
165
|
+
}
|
|
166
|
+
console.info("Deleting...");
|
|
167
|
+
await preset.delete();
|
|
153
168
|
}
|
|
154
169
|
async eject(name) {
|
|
155
170
|
if (name) {
|
|
@@ -221,10 +236,22 @@ let PresetController = class PresetController {
|
|
|
221
236
|
exports.PresetController = PresetController;
|
|
222
237
|
__decorate([
|
|
223
238
|
(0, core_1.Command)("preset:add <preset>"),
|
|
239
|
+
__param(0, (0, core_1.Param)("preset")),
|
|
224
240
|
__metadata("design:type", Function),
|
|
225
241
|
__metadata("design:paramtypes", [String]),
|
|
226
242
|
__metadata("design:returntype", Promise)
|
|
227
243
|
], PresetController.prototype, "add", null);
|
|
244
|
+
__decorate([
|
|
245
|
+
(0, core_1.Command)("preset:delete <preset>"),
|
|
246
|
+
__param(0, (0, core_1.Param)("preset")),
|
|
247
|
+
__param(1, (0, core_1.Option)("yes", {
|
|
248
|
+
alias: "y",
|
|
249
|
+
description: "Confirm deletion"
|
|
250
|
+
})),
|
|
251
|
+
__metadata("design:type", Function),
|
|
252
|
+
__metadata("design:paramtypes", [String, Boolean]),
|
|
253
|
+
__metadata("design:returntype", Promise)
|
|
254
|
+
], PresetController.prototype, "delete", null);
|
|
228
255
|
__decorate([
|
|
229
256
|
(0, core_1.Command)("preset:eject"),
|
|
230
257
|
__param(0, (0, core_1.Option)("name", {
|
|
@@ -12,8 +12,15 @@ export declare class ProjectController {
|
|
|
12
12
|
projectList(all: boolean): Promise<string>;
|
|
13
13
|
start(name?: string, detach?: boolean, attach?: boolean, rebuild?: boolean, restart?: boolean): Promise<void>;
|
|
14
14
|
stop(name: string): Promise<void>;
|
|
15
|
-
|
|
16
|
-
|
|
15
|
+
domains(name?: string): Promise<string>;
|
|
16
|
+
addDomain(name: string, addDomains: string[]): Promise<void>;
|
|
17
|
+
setDomains(name: string, domains: string[]): Promise<void>;
|
|
18
|
+
removeDomain(name: string, removeDomains: string[]): Promise<void>;
|
|
19
|
+
clearDomain(name?: string): Promise<void>;
|
|
20
|
+
ports(name?: string): Promise<string>;
|
|
21
|
+
addPort(hostPort: string, containerPort: string, name?: string): Promise<void>;
|
|
22
|
+
removePort(hostPort: string, containerPort: string, name?: string): Promise<void>;
|
|
23
|
+
clearPorts(name?: string): Promise<void>;
|
|
17
24
|
configList(name?: string, global?: boolean): Promise<string>;
|
|
18
25
|
configGet(name: string, global: boolean, keys: string[]): Promise<string>;
|
|
19
26
|
configSet(name: string, global: boolean, variables: string[]): Promise<void>;
|
|
@@ -25,6 +32,8 @@ export declare class ProjectController {
|
|
|
25
32
|
volumeList(name?: string): Promise<string>;
|
|
26
33
|
volumeMount(name: string, volumes: string[]): Promise<void>;
|
|
27
34
|
volumeUnmount(name: string, volumes: string[]): Promise<void>;
|
|
28
|
-
logs(name
|
|
35
|
+
logs(name?: string, global?: boolean, detach?: boolean, follow?: boolean): Promise<void>;
|
|
29
36
|
exec(name?: string, command?: string[]): Promise<void>;
|
|
37
|
+
run(name: string, script: string, args?: string[]): Promise<void>;
|
|
38
|
+
attach(name?: string): Promise<void>;
|
|
30
39
|
}
|
|
@@ -90,6 +90,7 @@ let ProjectController = class ProjectController {
|
|
|
90
90
|
message: "Project name:",
|
|
91
91
|
default: project.name || Path.basename(project.path)
|
|
92
92
|
});
|
|
93
|
+
project.addDomain(project.containerName);
|
|
93
94
|
}
|
|
94
95
|
if (type) {
|
|
95
96
|
project.type = type;
|
|
@@ -160,22 +161,18 @@ let ProjectController = class ProjectController {
|
|
|
160
161
|
await this.projectService.cdProject(name);
|
|
161
162
|
}
|
|
162
163
|
const project = await this.projectService.get();
|
|
163
|
-
|
|
164
|
-
await this.projectService.rebuild(project);
|
|
165
|
-
}
|
|
166
|
-
await this.projectService.start(project, restart);
|
|
164
|
+
await this.projectService.start(project, restart, rebuild);
|
|
167
165
|
if (detach) {
|
|
168
166
|
console.info(chalk_1.default.yellow("Warning: Detach option is deprecated"));
|
|
169
167
|
}
|
|
170
168
|
if (attach) {
|
|
171
169
|
const project = await this.projectService.get();
|
|
172
|
-
const
|
|
173
|
-
const container = await this.dockerService.getContainer(containerName);
|
|
170
|
+
const container = await this.dockerService.getContainer(project.containerName);
|
|
174
171
|
await container.resize({
|
|
175
172
|
w: process.stdout.columns,
|
|
176
173
|
h: process.stdout.rows
|
|
177
174
|
});
|
|
178
|
-
await this.dockerService.attach(containerName);
|
|
175
|
+
await this.dockerService.attach(project.containerName);
|
|
179
176
|
}
|
|
180
177
|
}
|
|
181
178
|
async stop(name) {
|
|
@@ -185,38 +182,96 @@ let ProjectController = class ProjectController {
|
|
|
185
182
|
const project = await this.projectService.get();
|
|
186
183
|
await this.projectService.stop(project);
|
|
187
184
|
}
|
|
188
|
-
async
|
|
185
|
+
async domains(name) {
|
|
189
186
|
if (name) {
|
|
190
187
|
await this.projectService.cdProject(name);
|
|
191
188
|
}
|
|
192
189
|
const project = await this.projectService.get();
|
|
193
|
-
|
|
194
|
-
|
|
190
|
+
const table = new cli_table3_1.default({
|
|
191
|
+
head: [chalk_1.default.yellow("Domain")]
|
|
192
|
+
});
|
|
193
|
+
for (const domain of project.domains) {
|
|
194
|
+
table.push([domain]);
|
|
195
195
|
}
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
196
|
+
return table.toString();
|
|
197
|
+
}
|
|
198
|
+
async addDomain(name, addDomains) {
|
|
199
|
+
if (name) {
|
|
200
|
+
await this.projectService.cdProject(name);
|
|
199
201
|
}
|
|
200
|
-
const
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
202
|
+
const project = await this.projectService.get();
|
|
203
|
+
for (const domain of addDomains) {
|
|
204
|
+
project.addDomain(domain);
|
|
205
|
+
}
|
|
206
|
+
await project.save();
|
|
207
|
+
}
|
|
208
|
+
async setDomains(name, domains) {
|
|
209
|
+
if (name) {
|
|
210
|
+
await this.projectService.cdProject(name);
|
|
211
|
+
}
|
|
212
|
+
const project = await this.projectService.get();
|
|
213
|
+
project.clearDomains();
|
|
214
|
+
for (const domain of domains) {
|
|
215
|
+
project.addDomain(domain);
|
|
216
|
+
}
|
|
217
|
+
await project.save();
|
|
218
|
+
}
|
|
219
|
+
async removeDomain(name, removeDomains) {
|
|
220
|
+
if (name) {
|
|
221
|
+
await this.projectService.cdProject(name);
|
|
222
|
+
}
|
|
223
|
+
const project = await this.projectService.get();
|
|
224
|
+
for (const domain of removeDomains) {
|
|
225
|
+
project.removeDomain(domain);
|
|
226
|
+
}
|
|
227
|
+
await project.save();
|
|
228
|
+
}
|
|
229
|
+
async clearDomain(name) {
|
|
230
|
+
if (name) {
|
|
231
|
+
await this.projectService.cdProject(name);
|
|
232
|
+
}
|
|
233
|
+
const project = await this.projectService.get();
|
|
234
|
+
project.clearDomains();
|
|
235
|
+
await project.save();
|
|
236
|
+
}
|
|
237
|
+
async ports(name) {
|
|
238
|
+
if (name) {
|
|
239
|
+
await this.projectService.cdProject(name);
|
|
240
|
+
}
|
|
241
|
+
const project = await this.projectService.get();
|
|
242
|
+
const table = new cli_table3_1.default({
|
|
243
|
+
head: ["Ports"]
|
|
211
244
|
});
|
|
212
|
-
|
|
245
|
+
for (const port of project.ports || []) {
|
|
246
|
+
table.push([port]);
|
|
247
|
+
}
|
|
248
|
+
return table.toString();
|
|
213
249
|
}
|
|
214
|
-
async
|
|
250
|
+
async addPort(hostPort, containerPort, name) {
|
|
215
251
|
if (name) {
|
|
216
252
|
await this.projectService.cdProject(name);
|
|
217
253
|
}
|
|
218
254
|
const project = await this.projectService.get();
|
|
219
|
-
|
|
255
|
+
project.linkPort(parseInt(hostPort), parseInt(containerPort));
|
|
256
|
+
await project.save();
|
|
257
|
+
}
|
|
258
|
+
async removePort(hostPort, containerPort, name) {
|
|
259
|
+
if (name) {
|
|
260
|
+
await this.projectService.cdProject(name);
|
|
261
|
+
}
|
|
262
|
+
const project = await this.projectService.get();
|
|
263
|
+
project.unlinkPort(parseInt(hostPort), parseInt(containerPort));
|
|
264
|
+
await project.save();
|
|
265
|
+
}
|
|
266
|
+
async clearPorts(name) {
|
|
267
|
+
if (name) {
|
|
268
|
+
await this.projectService.cdProject(name);
|
|
269
|
+
}
|
|
270
|
+
const project = await this.projectService.get();
|
|
271
|
+
if (project.ports) {
|
|
272
|
+
delete project.ports;
|
|
273
|
+
await project.save();
|
|
274
|
+
}
|
|
220
275
|
}
|
|
221
276
|
async configList(name, global) {
|
|
222
277
|
if (name) {
|
|
@@ -473,7 +528,11 @@ let ProjectController = class ProjectController {
|
|
|
473
528
|
follow: true
|
|
474
529
|
});
|
|
475
530
|
stream.on("data", (data) => {
|
|
476
|
-
|
|
531
|
+
try {
|
|
532
|
+
data = (0, utils_1.demuxOutput)(data);
|
|
533
|
+
}
|
|
534
|
+
catch (err) { }
|
|
535
|
+
process.stdout.write(data);
|
|
477
536
|
});
|
|
478
537
|
}
|
|
479
538
|
else {
|
|
@@ -490,8 +549,40 @@ let ProjectController = class ProjectController {
|
|
|
490
549
|
await this.projectService.cdProject(name);
|
|
491
550
|
}
|
|
492
551
|
const project = await this.projectService.get();
|
|
493
|
-
|
|
494
|
-
|
|
552
|
+
await this.dockerService.exec(project.containerName, command);
|
|
553
|
+
}
|
|
554
|
+
async run(name, script, args) {
|
|
555
|
+
if (name) {
|
|
556
|
+
await this.projectService.cdProject(name);
|
|
557
|
+
}
|
|
558
|
+
const project = await this.projectService.get();
|
|
559
|
+
if (!project.scripts || !project.scripts[script]) {
|
|
560
|
+
throw new Error(`Script ${script} not found`);
|
|
561
|
+
}
|
|
562
|
+
const container = await this.dockerService.getContainer(`${project.name}.workspace`);
|
|
563
|
+
if (!container) {
|
|
564
|
+
throw new Error("The project is not started");
|
|
565
|
+
}
|
|
566
|
+
const exec = await container.exec({
|
|
567
|
+
Cmd: ["bash", "-i", "-c", [project.scripts[script], ...args || []].join(" ")],
|
|
568
|
+
AttachStdin: true,
|
|
569
|
+
AttachStdout: true,
|
|
570
|
+
AttachStderr: true,
|
|
571
|
+
Tty: process.stdin.isTTY
|
|
572
|
+
});
|
|
573
|
+
const stream = await exec.start({
|
|
574
|
+
hijack: true,
|
|
575
|
+
stdin: true,
|
|
576
|
+
Tty: process.stdin.isTTY
|
|
577
|
+
});
|
|
578
|
+
await this.dockerService.attachStream(stream);
|
|
579
|
+
}
|
|
580
|
+
async attach(name) {
|
|
581
|
+
if (name) {
|
|
582
|
+
await this.projectService.cdProject(name);
|
|
583
|
+
}
|
|
584
|
+
const project = await this.projectService.get();
|
|
585
|
+
await this.dockerService.attach(project.containerName);
|
|
495
586
|
}
|
|
496
587
|
};
|
|
497
588
|
exports.ProjectController = ProjectController;
|
|
@@ -512,7 +603,7 @@ __decorate([
|
|
|
512
603
|
__param(0, (0, core_1.Option)("name", {
|
|
513
604
|
type: "string",
|
|
514
605
|
alias: "n",
|
|
515
|
-
description: "
|
|
606
|
+
description: "The name of the project"
|
|
516
607
|
})),
|
|
517
608
|
__param(1, (0, core_1.Option)("type", {
|
|
518
609
|
type: "string",
|
|
@@ -545,7 +636,7 @@ __decorate([
|
|
|
545
636
|
__param(0, (0, core_1.Option)("name", {
|
|
546
637
|
type: "string",
|
|
547
638
|
alias: "n",
|
|
548
|
-
description: "
|
|
639
|
+
description: "The name of the project",
|
|
549
640
|
help: true
|
|
550
641
|
})),
|
|
551
642
|
__param(1, (0, core_1.Option)("detach", {
|
|
@@ -577,39 +668,121 @@ __decorate([
|
|
|
577
668
|
__param(0, (0, core_1.Option)("name", {
|
|
578
669
|
type: "string",
|
|
579
670
|
alias: "n",
|
|
580
|
-
description: "
|
|
671
|
+
description: "The name of the project"
|
|
581
672
|
})),
|
|
582
673
|
__metadata("design:type", Function),
|
|
583
674
|
__metadata("design:paramtypes", [String]),
|
|
584
675
|
__metadata("design:returntype", Promise)
|
|
585
676
|
], ProjectController.prototype, "stop", null);
|
|
586
677
|
__decorate([
|
|
587
|
-
(0, core_1.Command)("
|
|
678
|
+
(0, core_1.Command)("domains"),
|
|
679
|
+
__param(0, (0, core_1.Option)("name", {
|
|
680
|
+
type: "string",
|
|
681
|
+
alias: "n",
|
|
682
|
+
description: "The name of the project"
|
|
683
|
+
})),
|
|
684
|
+
__metadata("design:type", Function),
|
|
685
|
+
__metadata("design:paramtypes", [String]),
|
|
686
|
+
__metadata("design:returntype", Promise)
|
|
687
|
+
], ProjectController.prototype, "domains", null);
|
|
688
|
+
__decorate([
|
|
689
|
+
(0, core_1.Command)("domain:add [...domains]"),
|
|
690
|
+
__param(0, (0, core_1.Option)("name", {
|
|
691
|
+
type: "string",
|
|
692
|
+
alias: "n",
|
|
693
|
+
description: "The name of the project"
|
|
694
|
+
})),
|
|
695
|
+
__metadata("design:type", Function),
|
|
696
|
+
__metadata("design:paramtypes", [String, Array]),
|
|
697
|
+
__metadata("design:returntype", Promise)
|
|
698
|
+
], ProjectController.prototype, "addDomain", null);
|
|
699
|
+
__decorate([
|
|
700
|
+
(0, core_1.Command)("domain:set [...domains]"),
|
|
588
701
|
__param(0, (0, core_1.Option)("name", {
|
|
589
702
|
type: "string",
|
|
590
703
|
alias: "n",
|
|
591
704
|
description: "Project name"
|
|
592
705
|
})),
|
|
593
706
|
__metadata("design:type", Function),
|
|
594
|
-
__metadata("design:paramtypes", [String,
|
|
707
|
+
__metadata("design:paramtypes", [String, Array]),
|
|
595
708
|
__metadata("design:returntype", Promise)
|
|
596
|
-
], ProjectController.prototype, "
|
|
709
|
+
], ProjectController.prototype, "setDomains", null);
|
|
597
710
|
__decorate([
|
|
598
|
-
(0, core_1.Command)("
|
|
711
|
+
(0, core_1.Command)("domain:remove [...domains]"),
|
|
712
|
+
__param(0, (0, core_1.Option)("name", {
|
|
713
|
+
type: "string",
|
|
714
|
+
alias: "n",
|
|
715
|
+
description: "The name of the project"
|
|
716
|
+
})),
|
|
717
|
+
__metadata("design:type", Function),
|
|
718
|
+
__metadata("design:paramtypes", [String, Array]),
|
|
719
|
+
__metadata("design:returntype", Promise)
|
|
720
|
+
], ProjectController.prototype, "removeDomain", null);
|
|
721
|
+
__decorate([
|
|
722
|
+
(0, core_1.Command)("domain:clear"),
|
|
599
723
|
__param(0, (0, core_1.Option)("name", {
|
|
600
724
|
type: "string",
|
|
601
|
-
alias: "n"
|
|
725
|
+
alias: "n",
|
|
726
|
+
description: "The name of the project"
|
|
602
727
|
})),
|
|
603
728
|
__metadata("design:type", Function),
|
|
604
729
|
__metadata("design:paramtypes", [String]),
|
|
605
730
|
__metadata("design:returntype", Promise)
|
|
606
|
-
], ProjectController.prototype, "
|
|
731
|
+
], ProjectController.prototype, "clearDomain", null);
|
|
732
|
+
__decorate([
|
|
733
|
+
(0, core_1.Command)("ports"),
|
|
734
|
+
__param(0, (0, core_1.Option)("name", {
|
|
735
|
+
type: "string",
|
|
736
|
+
alias: "n",
|
|
737
|
+
description: "The name of the project"
|
|
738
|
+
})),
|
|
739
|
+
__metadata("design:type", Function),
|
|
740
|
+
__metadata("design:paramtypes", [String]),
|
|
741
|
+
__metadata("design:returntype", Promise)
|
|
742
|
+
], ProjectController.prototype, "ports", null);
|
|
743
|
+
__decorate([
|
|
744
|
+
(0, core_1.Command)("port:add <host-port>:<container-port>"),
|
|
745
|
+
__param(0, (0, core_1.Param)("host-port")),
|
|
746
|
+
__param(1, (0, core_1.Param)("container-port")),
|
|
747
|
+
__param(2, (0, core_1.Option)("name", {
|
|
748
|
+
type: "string",
|
|
749
|
+
alias: "n",
|
|
750
|
+
description: "The name of the project"
|
|
751
|
+
})),
|
|
752
|
+
__metadata("design:type", Function),
|
|
753
|
+
__metadata("design:paramtypes", [String, String, String]),
|
|
754
|
+
__metadata("design:returntype", Promise)
|
|
755
|
+
], ProjectController.prototype, "addPort", null);
|
|
756
|
+
__decorate([
|
|
757
|
+
(0, core_1.Command)("port:remove <host-port>:<container-port>"),
|
|
758
|
+
__param(0, (0, core_1.Param)("host-port")),
|
|
759
|
+
__param(1, (0, core_1.Param)("container-port")),
|
|
760
|
+
__param(2, (0, core_1.Option)("name", {
|
|
761
|
+
type: "string",
|
|
762
|
+
alias: "n",
|
|
763
|
+
description: "The name of the project"
|
|
764
|
+
})),
|
|
765
|
+
__metadata("design:type", Function),
|
|
766
|
+
__metadata("design:paramtypes", [String, String, String]),
|
|
767
|
+
__metadata("design:returntype", Promise)
|
|
768
|
+
], ProjectController.prototype, "removePort", null);
|
|
769
|
+
__decorate([
|
|
770
|
+
(0, core_1.Command)("port:clear"),
|
|
771
|
+
__param(0, (0, core_1.Option)("name", {
|
|
772
|
+
type: "string",
|
|
773
|
+
alias: "n",
|
|
774
|
+
description: "The name of the project"
|
|
775
|
+
})),
|
|
776
|
+
__metadata("design:type", Function),
|
|
777
|
+
__metadata("design:paramtypes", [String]),
|
|
778
|
+
__metadata("design:returntype", Promise)
|
|
779
|
+
], ProjectController.prototype, "clearPorts", null);
|
|
607
780
|
__decorate([
|
|
608
781
|
(0, core_1.Command)("config"),
|
|
609
782
|
__param(0, (0, core_1.Option)("name", {
|
|
610
783
|
type: "string",
|
|
611
784
|
alias: "n",
|
|
612
|
-
description: "
|
|
785
|
+
description: "The name of the project"
|
|
613
786
|
})),
|
|
614
787
|
__param(1, (0, core_1.Option)("global", {
|
|
615
788
|
type: "boolean",
|
|
@@ -623,7 +796,8 @@ __decorate([
|
|
|
623
796
|
(0, core_1.Command)("config:get [...key]"),
|
|
624
797
|
__param(0, (0, core_1.Option)("name", {
|
|
625
798
|
type: "string",
|
|
626
|
-
alias: "n"
|
|
799
|
+
alias: "n",
|
|
800
|
+
description: "The name of the project"
|
|
627
801
|
})),
|
|
628
802
|
__param(1, (0, core_1.Option)("global", {
|
|
629
803
|
type: "boolean",
|
|
@@ -638,12 +812,14 @@ __decorate([
|
|
|
638
812
|
(0, core_1.Command)("config:set [...configs]"),
|
|
639
813
|
__param(0, (0, core_1.Option)("name", {
|
|
640
814
|
type: "string",
|
|
641
|
-
alias: "n"
|
|
815
|
+
alias: "n",
|
|
816
|
+
description: "The name of the project"
|
|
642
817
|
})),
|
|
643
818
|
__param(1, (0, core_1.Option)("global", {
|
|
644
819
|
type: "boolean",
|
|
645
820
|
alias: "g"
|
|
646
821
|
})),
|
|
822
|
+
__param(2, (0, core_1.Param)("configs")),
|
|
647
823
|
__metadata("design:type", Function),
|
|
648
824
|
__metadata("design:paramtypes", [String, Boolean, Array]),
|
|
649
825
|
__metadata("design:returntype", Promise)
|
|
@@ -652,7 +828,8 @@ __decorate([
|
|
|
652
828
|
(0, core_1.Command)("config:unset [...configs]"),
|
|
653
829
|
__param(0, (0, core_1.Option)("name", {
|
|
654
830
|
type: "string",
|
|
655
|
-
alias: "n"
|
|
831
|
+
alias: "n",
|
|
832
|
+
description: "The name of the project"
|
|
656
833
|
})),
|
|
657
834
|
__param(1, (0, core_1.Option)("global", {
|
|
658
835
|
type: "boolean",
|
|
@@ -666,7 +843,8 @@ __decorate([
|
|
|
666
843
|
(0, core_1.Command)("build-args"),
|
|
667
844
|
__param(0, (0, core_1.Option)("name", {
|
|
668
845
|
type: "string",
|
|
669
|
-
alias: "n"
|
|
846
|
+
alias: "n",
|
|
847
|
+
description: "The name of the project"
|
|
670
848
|
})),
|
|
671
849
|
__metadata("design:type", Function),
|
|
672
850
|
__metadata("design:paramtypes", [String]),
|
|
@@ -677,6 +855,7 @@ __decorate([
|
|
|
677
855
|
__param(0, (0, core_1.Option)("name", {
|
|
678
856
|
type: "string",
|
|
679
857
|
alias: "n",
|
|
858
|
+
description: "The name of the project"
|
|
680
859
|
})),
|
|
681
860
|
__metadata("design:type", Function),
|
|
682
861
|
__metadata("design:paramtypes", [String, Array]),
|
|
@@ -686,7 +865,8 @@ __decorate([
|
|
|
686
865
|
(0, core_1.Command)("build-args:set [...buildArgs]"),
|
|
687
866
|
__param(0, (0, core_1.Option)("name", {
|
|
688
867
|
type: "string",
|
|
689
|
-
alias: "n"
|
|
868
|
+
alias: "n",
|
|
869
|
+
description: "The name of the project"
|
|
690
870
|
})),
|
|
691
871
|
__metadata("design:type", Function),
|
|
692
872
|
__metadata("design:paramtypes", [String, Array]),
|
|
@@ -696,7 +876,8 @@ __decorate([
|
|
|
696
876
|
(0, core_1.Command)("build-args:unset [...buildArgs]"),
|
|
697
877
|
__param(0, (0, core_1.Option)("name", {
|
|
698
878
|
type: "string",
|
|
699
|
-
alias: "n"
|
|
879
|
+
alias: "n",
|
|
880
|
+
description: "The name of the project"
|
|
700
881
|
})),
|
|
701
882
|
__metadata("design:type", Function),
|
|
702
883
|
__metadata("design:paramtypes", [String, Array]),
|
|
@@ -706,7 +887,8 @@ __decorate([
|
|
|
706
887
|
(0, core_1.Command)("volumes"),
|
|
707
888
|
__param(0, (0, core_1.Option)("name", {
|
|
708
889
|
type: "string",
|
|
709
|
-
alias: "n"
|
|
890
|
+
alias: "n",
|
|
891
|
+
description: "The name of the project"
|
|
710
892
|
})),
|
|
711
893
|
__metadata("design:type", Function),
|
|
712
894
|
__metadata("design:paramtypes", [String]),
|
|
@@ -716,7 +898,8 @@ __decorate([
|
|
|
716
898
|
(0, core_1.Command)("volume:mount [...volumes]"),
|
|
717
899
|
__param(0, (0, core_1.Option)("name", {
|
|
718
900
|
type: "string",
|
|
719
|
-
alias: "n"
|
|
901
|
+
alias: "n",
|
|
902
|
+
description: "The name of the project"
|
|
720
903
|
})),
|
|
721
904
|
__metadata("design:type", Function),
|
|
722
905
|
__metadata("design:paramtypes", [String, Array]),
|
|
@@ -726,7 +909,8 @@ __decorate([
|
|
|
726
909
|
(0, core_1.Command)("volume:unmount [...volumes]"),
|
|
727
910
|
__param(0, (0, core_1.Option)("name", {
|
|
728
911
|
type: "string",
|
|
729
|
-
alias: "n"
|
|
912
|
+
alias: "n",
|
|
913
|
+
description: "The name of the project"
|
|
730
914
|
})),
|
|
731
915
|
__metadata("design:type", Function),
|
|
732
916
|
__metadata("design:paramtypes", [String, Array]),
|
|
@@ -737,7 +921,7 @@ __decorate([
|
|
|
737
921
|
__param(0, (0, core_1.Option)("name", {
|
|
738
922
|
type: "string",
|
|
739
923
|
alias: "n",
|
|
740
|
-
description: "
|
|
924
|
+
description: "The name of the project"
|
|
741
925
|
})),
|
|
742
926
|
__param(1, (0, core_1.Option)("global", {
|
|
743
927
|
type: "boolean",
|
|
@@ -760,12 +944,36 @@ __decorate([
|
|
|
760
944
|
__param(0, (0, core_1.Option)("name", {
|
|
761
945
|
type: "string",
|
|
762
946
|
alias: "n",
|
|
763
|
-
description: "
|
|
947
|
+
description: "The name of the project"
|
|
764
948
|
})),
|
|
765
949
|
__metadata("design:type", Function),
|
|
766
950
|
__metadata("design:paramtypes", [String, Array]),
|
|
767
951
|
__metadata("design:returntype", Promise)
|
|
768
952
|
], ProjectController.prototype, "exec", null);
|
|
953
|
+
__decorate([
|
|
954
|
+
(0, core_1.Command)("run <script> [...args]"),
|
|
955
|
+
__param(0, (0, core_1.Option)("name", {
|
|
956
|
+
type: "string",
|
|
957
|
+
alias: "n",
|
|
958
|
+
description: "The name of the project"
|
|
959
|
+
})),
|
|
960
|
+
__param(1, (0, core_1.Param)("script")),
|
|
961
|
+
__param(2, (0, core_1.Param)("args")),
|
|
962
|
+
__metadata("design:type", Function),
|
|
963
|
+
__metadata("design:paramtypes", [String, String, Array]),
|
|
964
|
+
__metadata("design:returntype", Promise)
|
|
965
|
+
], ProjectController.prototype, "run", null);
|
|
966
|
+
__decorate([
|
|
967
|
+
(0, core_1.Command)("attach"),
|
|
968
|
+
__param(0, (0, core_1.Option)("name", {
|
|
969
|
+
type: "string",
|
|
970
|
+
alias: "n",
|
|
971
|
+
description: "The name of the project"
|
|
972
|
+
})),
|
|
973
|
+
__metadata("design:type", Function),
|
|
974
|
+
__metadata("design:paramtypes", [String]),
|
|
975
|
+
__metadata("design:returntype", Promise)
|
|
976
|
+
], ProjectController.prototype, "attach", null);
|
|
769
977
|
exports.ProjectController = ProjectController = __decorate([
|
|
770
978
|
(0, core_1.Controller)(),
|
|
771
979
|
__metadata("design:paramtypes", [services_1.AppConfigService,
|
|
@@ -1,24 +1,17 @@
|
|
|
1
1
|
import { Project } from "@wocker/core";
|
|
2
|
-
import { AppConfigService, AppEventsService, ProjectService,
|
|
2
|
+
import { AppConfigService, AppEventsService, ProjectService, ProxyService } from "../services";
|
|
3
3
|
export declare class ProxyController {
|
|
4
4
|
protected readonly appConfigService: AppConfigService;
|
|
5
5
|
protected readonly appEventsService: AppEventsService;
|
|
6
6
|
protected readonly projectService: ProjectService;
|
|
7
|
-
protected readonly
|
|
7
|
+
protected readonly proxyService: ProxyService;
|
|
8
8
|
protected containerName: string;
|
|
9
|
-
constructor(appConfigService: AppConfigService, appEventsService: AppEventsService, projectService: ProjectService,
|
|
9
|
+
constructor(appConfigService: AppConfigService, appEventsService: AppEventsService, projectService: ProjectService, proxyService: ProxyService);
|
|
10
10
|
onProjectStart(project: Project): Promise<void>;
|
|
11
11
|
onProjectStop(project: Project): Promise<void>;
|
|
12
12
|
getProjectNames(): Promise<string[]>;
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
start(): Promise<void>;
|
|
13
|
+
init(httpPort?: number, httpsPort?: number): Promise<void>;
|
|
14
|
+
start(restart?: boolean): Promise<void>;
|
|
16
15
|
stop(): Promise<void>;
|
|
17
|
-
restart(): Promise<void>;
|
|
18
|
-
domainList(name: string): Promise<string>;
|
|
19
|
-
setDomains(name: string, domains: string[]): Promise<void>;
|
|
20
|
-
addDomain(name: string, addDomains: string[]): Promise<void>;
|
|
21
|
-
removeDomain(name: string, removeDomains: string[]): Promise<void>;
|
|
22
|
-
clearDomains(name: string): Promise<void>;
|
|
23
16
|
logs(): Promise<void>;
|
|
24
17
|
}
|