@wocker/ws 1.0.7 → 1.0.8
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/bin/ws.js +1 -1
- package/lib/App.d.ts +1 -6
- package/lib/App.js +1 -27
- package/lib/AppModule.d.ts +6 -0
- package/lib/AppModule.js +97 -0
- package/lib/controllers/CompletionController.d.ts +6 -0
- package/lib/controllers/CompletionController.js +32 -0
- package/lib/controllers/ImageController.d.ts +5 -8
- package/lib/controllers/ImageController.js +27 -12
- package/lib/controllers/PluginController.d.ts +9 -13
- package/lib/controllers/PluginController.js +56 -18
- package/lib/controllers/PresetController.d.ts +9 -15
- package/lib/controllers/PresetController.js +41 -22
- package/lib/controllers/ProjectController.d.ts +27 -69
- package/lib/controllers/ProjectController.js +336 -261
- package/lib/controllers/ProxyController.d.ts +15 -25
- package/lib/controllers/ProxyController.js +142 -96
- package/lib/controllers/index.d.ts +1 -0
- package/lib/controllers/index.js +1 -0
- package/lib/index.d.ts +0 -1
- package/lib/index.js +0 -11
- package/lib/main.d.ts +3 -0
- package/lib/main.js +11 -0
- package/lib/makes/Logger.d.ts +2 -2
- package/lib/makes/Logger.js +19 -8
- package/lib/makes/Preset.d.ts +3 -4
- package/lib/makes/Preset.js +19 -8
- package/lib/makes/index.d.ts +0 -6
- package/lib/makes/index.js +0 -6
- package/lib/plugins/ElasticSearchPlugin.d.ts +5 -6
- package/lib/plugins/ElasticSearchPlugin.js +19 -8
- package/lib/plugins/LocaltunnelPlugin.d.ts +8 -8
- package/lib/plugins/LocaltunnelPlugin.js +25 -10
- package/lib/plugins/MaildevPlugin.d.ts +5 -6
- package/lib/plugins/MaildevPlugin.js +21 -8
- package/lib/plugins/MongodbPlugin.d.ts +5 -5
- package/lib/plugins/MongodbPlugin.js +26 -11
- package/lib/plugins/NgrokPlugin.d.ts +7 -6
- package/lib/plugins/NgrokPlugin.js +32 -17
- package/lib/plugins/PageKitePlugin.d.ts +10 -8
- package/lib/plugins/PageKitePlugin.js +36 -20
- package/lib/plugins/ProxmoxPlugin.d.ts +8 -5
- package/lib/plugins/ProxmoxPlugin.js +25 -9
- package/lib/plugins/RedisPlugin.d.ts +4 -6
- package/lib/plugins/RedisPlugin.js +19 -8
- package/lib/plugins/index.d.ts +0 -2
- package/lib/plugins/index.js +0 -2
- package/lib/services/AppConfigService.d.ts +3 -3
- package/lib/services/AppConfigService.js +16 -2
- package/lib/services/AppEventsService.d.ts +1 -2
- package/lib/services/AppEventsService.js +11 -2
- package/lib/services/DockerService.d.ts +9 -39
- package/lib/services/DockerService.js +122 -4
- package/lib/services/LogService.d.ts +3 -5
- package/lib/services/LogService.js +19 -4
- package/lib/services/PluginService.d.ts +4 -9
- package/lib/services/PluginService.js +18 -8
- package/lib/services/PresetService.d.ts +5 -5
- package/lib/services/PresetService.js +11 -2
- package/lib/services/ProjectService.d.ts +9 -6
- package/lib/services/ProjectService.js +62 -31
- package/lib/utils/get-config.d.ts +2 -2
- package/lib/utils/index.d.ts +0 -1
- package/lib/utils/index.js +0 -1
- package/lib/utils/set-config.d.ts +2 -2
- package/package.json +4 -4
- package/presets/node/config.json +1 -1
- package/presets/php-fpm/Dockerfile +1 -1
- package/lib/decorators/Inject.d.ts +0 -1
- package/lib/decorators/Inject.js +0 -8
- package/lib/decorators/Injectable.d.ts +0 -4
- package/lib/decorators/Injectable.js +0 -17
- package/lib/decorators/index.d.ts +0 -1
- package/lib/decorators/index.js +0 -17
- package/lib/makes/Controller.d.ts +0 -5
- package/lib/makes/Controller.js +0 -8
- package/lib/makes/DI.d.ts +0 -7
- package/lib/makes/DI.js +0 -27
- package/lib/makes/Docker.d.ts +0 -58
- package/lib/makes/Docker.js +0 -320
- package/lib/makes/Plugin.d.ts +0 -13
- package/lib/makes/Plugin.js +0 -61
- package/lib/makes/Project.d.ts +0 -45
- package/lib/makes/Project.js +0 -127
- package/lib/makes/Repository.d.ts +0 -11
- package/lib/makes/Repository.js +0 -22
- package/lib/plugins/PostgresPlugin.d.ts +0 -16
- package/lib/plugins/PostgresPlugin.js +0 -121
- package/lib/types/Config.d.ts +0 -12
- package/lib/types/Config.js +0 -2
- package/lib/types/EnvConfig.d.ts +0 -3
- package/lib/types/EnvConfig.js +0 -2
- package/lib/types/index.d.ts +0 -2
- package/lib/types/index.js +0 -18
- package/lib/utils/demuxOutput.d.ts +0 -2
- package/lib/utils/demuxOutput.js +0 -19
|
@@ -1,121 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
-
if (k2 === undefined) k2 = k;
|
|
4
|
-
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
-
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
-
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
-
}
|
|
8
|
-
Object.defineProperty(o, k2, desc);
|
|
9
|
-
}) : (function(o, m, k, k2) {
|
|
10
|
-
if (k2 === undefined) k2 = k;
|
|
11
|
-
o[k2] = m[k];
|
|
12
|
-
}));
|
|
13
|
-
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
-
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
-
}) : function(o, v) {
|
|
16
|
-
o["default"] = v;
|
|
17
|
-
});
|
|
18
|
-
var __importStar = (this && this.__importStar) || function (mod) {
|
|
19
|
-
if (mod && mod.__esModule) return mod;
|
|
20
|
-
var result = {};
|
|
21
|
-
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
22
|
-
__setModuleDefault(result, mod);
|
|
23
|
-
return result;
|
|
24
|
-
};
|
|
25
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
26
|
-
exports.PostgresPlugin = void 0;
|
|
27
|
-
const Path = __importStar(require("path"));
|
|
28
|
-
const env_1 = require("../env");
|
|
29
|
-
const makes_1 = require("../makes");
|
|
30
|
-
class PostgresPlugin extends makes_1.Plugin {
|
|
31
|
-
constructor() {
|
|
32
|
-
super("postgres");
|
|
33
|
-
this.container = "postgres.workspace";
|
|
34
|
-
this.adminContainer = "dbadmin-postgres.workspace";
|
|
35
|
-
this.dataDir = Path.join(env_1.DATA_DIR, "db/postgres");
|
|
36
|
-
}
|
|
37
|
-
install(cli) {
|
|
38
|
-
super.install(cli);
|
|
39
|
-
cli.command("postgres:start")
|
|
40
|
-
.action(() => this.start());
|
|
41
|
-
cli.command("postgres:stop")
|
|
42
|
-
.action(() => this.stop());
|
|
43
|
-
cli.command("postgres:restart")
|
|
44
|
-
.action(() => this.restart());
|
|
45
|
-
}
|
|
46
|
-
async start() {
|
|
47
|
-
await this.startDB();
|
|
48
|
-
await this.startAdmin();
|
|
49
|
-
}
|
|
50
|
-
async startDB() {
|
|
51
|
-
console.log("Postgres starting...");
|
|
52
|
-
await makes_1.Docker.pullImage("postgres:latest");
|
|
53
|
-
const container = await makes_1.Docker.createContainer({
|
|
54
|
-
name: this.container,
|
|
55
|
-
restart: "always",
|
|
56
|
-
image: "postgres:latest",
|
|
57
|
-
volumes: [
|
|
58
|
-
`${this.dataPath()}:/var/lib/postgresql/data`
|
|
59
|
-
],
|
|
60
|
-
ports: ["5432:5432"],
|
|
61
|
-
env: {
|
|
62
|
-
POSTGRES_USER: "root",
|
|
63
|
-
POSTGRES_PASSWORD: "toor"
|
|
64
|
-
}
|
|
65
|
-
});
|
|
66
|
-
await container.start();
|
|
67
|
-
}
|
|
68
|
-
async startAdmin() {
|
|
69
|
-
console.log("Postgres Admin starting...");
|
|
70
|
-
await makes_1.Docker.pullImage("dpage/pgadmin4:latest");
|
|
71
|
-
const container = await makes_1.Docker.createContainer({
|
|
72
|
-
name: this.adminContainer,
|
|
73
|
-
restart: "always",
|
|
74
|
-
links: [
|
|
75
|
-
`${this.container}:postgres`
|
|
76
|
-
],
|
|
77
|
-
env: {
|
|
78
|
-
PGADMIN_DEFAULT_EMAIL: "postgres@workspace.com.ua",
|
|
79
|
-
PGADMIN_DEFAULT_PASSWORD: "toor",
|
|
80
|
-
VIRTUAL_HOST: this.adminContainer
|
|
81
|
-
},
|
|
82
|
-
image: "dpage/pgadmin4:latest"
|
|
83
|
-
});
|
|
84
|
-
await container.start();
|
|
85
|
-
}
|
|
86
|
-
async stop() {
|
|
87
|
-
await this.stopDB();
|
|
88
|
-
await this.stopAdmin();
|
|
89
|
-
}
|
|
90
|
-
async stopDB() {
|
|
91
|
-
console.log("Postgres stopping...");
|
|
92
|
-
const container = await makes_1.Docker.getContainer(this.container);
|
|
93
|
-
if (container) {
|
|
94
|
-
try {
|
|
95
|
-
await container.stop();
|
|
96
|
-
await container.remove();
|
|
97
|
-
}
|
|
98
|
-
catch (err) {
|
|
99
|
-
makes_1.Logger.error(err.message);
|
|
100
|
-
}
|
|
101
|
-
}
|
|
102
|
-
}
|
|
103
|
-
async stopAdmin() {
|
|
104
|
-
console.log("Stopping postgres admin...");
|
|
105
|
-
const container = await makes_1.Docker.getContainer(this.adminContainer);
|
|
106
|
-
if (container) {
|
|
107
|
-
try {
|
|
108
|
-
await container.stop();
|
|
109
|
-
await container.remove();
|
|
110
|
-
}
|
|
111
|
-
catch (err) {
|
|
112
|
-
makes_1.Logger.error(err.message);
|
|
113
|
-
}
|
|
114
|
-
}
|
|
115
|
-
}
|
|
116
|
-
async restart() {
|
|
117
|
-
await this.stop();
|
|
118
|
-
await this.start();
|
|
119
|
-
}
|
|
120
|
-
}
|
|
121
|
-
exports.PostgresPlugin = PostgresPlugin;
|
package/lib/types/Config.d.ts
DELETED
package/lib/types/Config.js
DELETED
package/lib/types/EnvConfig.d.ts
DELETED
package/lib/types/EnvConfig.js
DELETED
package/lib/types/index.d.ts
DELETED
package/lib/types/index.js
DELETED
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
-
if (k2 === undefined) k2 = k;
|
|
4
|
-
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
-
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
-
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
-
}
|
|
8
|
-
Object.defineProperty(o, k2, desc);
|
|
9
|
-
}) : (function(o, m, k, k2) {
|
|
10
|
-
if (k2 === undefined) k2 = k;
|
|
11
|
-
o[k2] = m[k];
|
|
12
|
-
}));
|
|
13
|
-
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
|
-
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
|
-
};
|
|
16
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
-
__exportStar(require("./Config"), exports);
|
|
18
|
-
__exportStar(require("./EnvConfig"), exports);
|
package/lib/utils/demuxOutput.js
DELETED
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.demuxOutput = void 0;
|
|
4
|
-
const demuxOutput = (buffer) => {
|
|
5
|
-
let nextDataLength = null, output = Buffer.from([]);
|
|
6
|
-
while (buffer.length > 0) {
|
|
7
|
-
const header = bufferSlice(8);
|
|
8
|
-
nextDataLength = header.readUInt32BE(4);
|
|
9
|
-
const content = bufferSlice(nextDataLength);
|
|
10
|
-
output = Buffer.concat([output, content]);
|
|
11
|
-
}
|
|
12
|
-
function bufferSlice(end) {
|
|
13
|
-
const out = buffer.slice(0, end);
|
|
14
|
-
buffer = Buffer.from(buffer.slice(end, buffer.length));
|
|
15
|
-
return out;
|
|
16
|
-
}
|
|
17
|
-
return output;
|
|
18
|
-
};
|
|
19
|
-
exports.demuxOutput = demuxOutput;
|