shyp 0.1.0
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/LICENSE +21 -0
- package/README.md +218 -0
- package/dist/cli.d.ts +3 -0
- package/dist/cli.d.ts.map +1 -0
- package/dist/cli.js +64 -0
- package/dist/cli.js.map +1 -0
- package/dist/commands/add.d.ts +9 -0
- package/dist/commands/add.d.ts.map +1 -0
- package/dist/commands/add.js +69 -0
- package/dist/commands/add.js.map +1 -0
- package/dist/commands/deploy.d.ts +4 -0
- package/dist/commands/deploy.d.ts.map +1 -0
- package/dist/commands/deploy.js +104 -0
- package/dist/commands/deploy.js.map +1 -0
- package/dist/commands/doctor.d.ts +2 -0
- package/dist/commands/doctor.d.ts.map +1 -0
- package/dist/commands/doctor.js +97 -0
- package/dist/commands/doctor.js.map +1 -0
- package/dist/commands/index.d.ts +10 -0
- package/dist/commands/index.d.ts.map +1 -0
- package/dist/commands/index.js +10 -0
- package/dist/commands/index.js.map +1 -0
- package/dist/commands/init.d.ts +4 -0
- package/dist/commands/init.d.ts.map +1 -0
- package/dist/commands/init.js +150 -0
- package/dist/commands/init.js.map +1 -0
- package/dist/commands/logs.d.ts +5 -0
- package/dist/commands/logs.d.ts.map +1 -0
- package/dist/commands/logs.js +56 -0
- package/dist/commands/logs.js.map +1 -0
- package/dist/commands/ports.d.ts +2 -0
- package/dist/commands/ports.d.ts.map +1 -0
- package/dist/commands/ports.js +73 -0
- package/dist/commands/ports.js.map +1 -0
- package/dist/commands/start.d.ts +2 -0
- package/dist/commands/start.d.ts.map +1 -0
- package/dist/commands/start.js +11 -0
- package/dist/commands/start.js.map +1 -0
- package/dist/commands/status.d.ts +2 -0
- package/dist/commands/status.d.ts.map +1 -0
- package/dist/commands/status.js +73 -0
- package/dist/commands/status.js.map +1 -0
- package/dist/commands/sync.d.ts +4 -0
- package/dist/commands/sync.d.ts.map +1 -0
- package/dist/commands/sync.js +95 -0
- package/dist/commands/sync.js.map +1 -0
- package/dist/index.d.ts +4 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +6 -0
- package/dist/index.js.map +1 -0
- package/dist/lib/config.d.ts +10 -0
- package/dist/lib/config.d.ts.map +1 -0
- package/dist/lib/config.js +116 -0
- package/dist/lib/config.js.map +1 -0
- package/dist/lib/deploy.d.ts +12 -0
- package/dist/lib/deploy.d.ts.map +1 -0
- package/dist/lib/deploy.js +288 -0
- package/dist/lib/deploy.js.map +1 -0
- package/dist/lib/git.d.ts +24 -0
- package/dist/lib/git.d.ts.map +1 -0
- package/dist/lib/git.js +82 -0
- package/dist/lib/git.js.map +1 -0
- package/dist/lib/index.d.ts +7 -0
- package/dist/lib/index.d.ts.map +1 -0
- package/dist/lib/index.js +7 -0
- package/dist/lib/index.js.map +1 -0
- package/dist/lib/nginx.d.ts +16 -0
- package/dist/lib/nginx.d.ts.map +1 -0
- package/dist/lib/nginx.js +312 -0
- package/dist/lib/nginx.js.map +1 -0
- package/dist/lib/pm2.d.ts +25 -0
- package/dist/lib/pm2.d.ts.map +1 -0
- package/dist/lib/pm2.js +106 -0
- package/dist/lib/pm2.js.map +1 -0
- package/dist/lib/state.d.ts +12 -0
- package/dist/lib/state.d.ts.map +1 -0
- package/dist/lib/state.js +112 -0
- package/dist/lib/state.js.map +1 -0
- package/dist/schemas/app.d.ts +272 -0
- package/dist/schemas/app.d.ts.map +1 -0
- package/dist/schemas/app.js +79 -0
- package/dist/schemas/app.js.map +1 -0
- package/dist/schemas/config.d.ts +508 -0
- package/dist/schemas/config.d.ts.map +1 -0
- package/dist/schemas/config.js +62 -0
- package/dist/schemas/config.js.map +1 -0
- package/dist/schemas/engine.d.ts +772 -0
- package/dist/schemas/engine.d.ts.map +1 -0
- package/dist/schemas/engine.js +93 -0
- package/dist/schemas/engine.js.map +1 -0
- package/dist/schemas/index.d.ts +5 -0
- package/dist/schemas/index.d.ts.map +1 -0
- package/dist/schemas/index.js +5 -0
- package/dist/schemas/index.js.map +1 -0
- package/dist/schemas/state.d.ts +416 -0
- package/dist/schemas/state.d.ts.map +1 -0
- package/dist/schemas/state.js +56 -0
- package/dist/schemas/state.js.map +1 -0
- package/dist/server/index.d.ts +2 -0
- package/dist/server/index.d.ts.map +1 -0
- package/dist/server/index.js +51 -0
- package/dist/server/index.js.map +1 -0
- package/dist/server/webhook.d.ts +6 -0
- package/dist/server/webhook.d.ts.map +1 -0
- package/dist/server/webhook.js +163 -0
- package/dist/server/webhook.js.map +1 -0
- package/dist/utils/index.d.ts +4 -0
- package/dist/utils/index.d.ts.map +1 -0
- package/dist/utils/index.js +4 -0
- package/dist/utils/index.js.map +1 -0
- package/dist/utils/logger.d.ts +17 -0
- package/dist/utils/logger.d.ts.map +1 -0
- package/dist/utils/logger.js +25 -0
- package/dist/utils/logger.js.map +1 -0
- package/dist/utils/paths.d.ts +37 -0
- package/dist/utils/paths.d.ts.map +1 -0
- package/dist/utils/paths.js +35 -0
- package/dist/utils/paths.js.map +1 -0
- package/dist/utils/spinner.d.ts +4 -0
- package/dist/utils/spinner.d.ts.map +1 -0
- package/dist/utils/spinner.js +20 -0
- package/dist/utils/spinner.js.map +1 -0
- package/package.json +58 -0
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import type { Request, Response } from 'express';
|
|
2
|
+
export declare function verifySignature(secret: string, payload: string, signature: string | undefined): boolean;
|
|
3
|
+
export declare function createWebhookHandler(secret: string): (req: Request, res: Response) => Promise<void>;
|
|
4
|
+
export declare function healthHandler(req: Request, res: Response): void;
|
|
5
|
+
export declare function createManualDeployHandler(): (req: Request, res: Response) => Promise<void>;
|
|
6
|
+
//# sourceMappingURL=webhook.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"webhook.d.ts","sourceRoot":"","sources":["../../src/server/webhook.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,OAAO,EAAE,QAAQ,EAAgB,MAAM,SAAS,CAAA;AAM9D,wBAAgB,eAAe,CAC7B,MAAM,EAAE,MAAM,EACd,OAAO,EAAE,MAAM,EACf,SAAS,EAAE,MAAM,GAAG,SAAS,GAC5B,OAAO,CAWT;AA8DD,wBAAgB,oBAAoB,CAAC,MAAM,EAAE,MAAM,IACnC,KAAK,OAAO,EAAE,KAAK,QAAQ,KAAG,OAAO,CAAC,IAAI,CAAC,CAyE1D;AAGD,wBAAgB,aAAa,CAAC,GAAG,EAAE,OAAO,EAAE,GAAG,EAAE,QAAQ,GAAG,IAAI,CAM/D;AAGD,wBAAgB,yBAAyB,KACzB,KAAK,OAAO,EAAE,KAAK,QAAQ,KAAG,OAAO,CAAC,IAAI,CAAC,CAwB1D"}
|
|
@@ -0,0 +1,163 @@
|
|
|
1
|
+
import crypto from 'crypto';
|
|
2
|
+
import { loadAppConfigs, loadEngineConfigs } from '../lib/config.js';
|
|
3
|
+
import { deployApp, deployModule } from '../lib/deploy.js';
|
|
4
|
+
import { log } from '../utils/logger.js';
|
|
5
|
+
// Verify GitHub webhook signature
|
|
6
|
+
export function verifySignature(secret, payload, signature) {
|
|
7
|
+
if (!signature)
|
|
8
|
+
return false;
|
|
9
|
+
const hmac = crypto.createHmac('sha256', secret);
|
|
10
|
+
const digest = 'sha256=' + hmac.update(payload).digest('hex');
|
|
11
|
+
try {
|
|
12
|
+
return crypto.timingSafeEqual(Buffer.from(signature), Buffer.from(digest));
|
|
13
|
+
}
|
|
14
|
+
catch {
|
|
15
|
+
return false;
|
|
16
|
+
}
|
|
17
|
+
}
|
|
18
|
+
// Deployment queue to prevent concurrent deploys
|
|
19
|
+
const deploymentQueue = new Map();
|
|
20
|
+
async function queueDeployment(name, fn) {
|
|
21
|
+
// Wait for any existing deployment to finish
|
|
22
|
+
const existing = deploymentQueue.get(name);
|
|
23
|
+
if (existing) {
|
|
24
|
+
await existing.catch(() => { }); // Ignore errors from previous
|
|
25
|
+
}
|
|
26
|
+
// Queue this deployment
|
|
27
|
+
const promise = fn();
|
|
28
|
+
deploymentQueue.set(name, promise);
|
|
29
|
+
try {
|
|
30
|
+
await promise;
|
|
31
|
+
}
|
|
32
|
+
finally {
|
|
33
|
+
deploymentQueue.delete(name);
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
// Find app config by repository name
|
|
37
|
+
async function findAppByRepo(repoFullName, repoName) {
|
|
38
|
+
const apps = await loadAppConfigs();
|
|
39
|
+
const engines = await loadEngineConfigs();
|
|
40
|
+
// Check apps first
|
|
41
|
+
for (const [name, config] of apps) {
|
|
42
|
+
// Extract repo name from URL (e.g., git@github.com:user/repo.git -> user/repo)
|
|
43
|
+
const repoFromUrl = config.repo
|
|
44
|
+
.replace(/.*github\.com[:/]/, '')
|
|
45
|
+
.replace(/\.git$/, '');
|
|
46
|
+
if (repoFromUrl === repoFullName || repoFromUrl.endsWith(`/${repoName}`)) {
|
|
47
|
+
return { type: 'app', name, config };
|
|
48
|
+
}
|
|
49
|
+
}
|
|
50
|
+
// Check engine modules
|
|
51
|
+
for (const [engineName, engine] of engines) {
|
|
52
|
+
for (const [moduleName, moduleConfig] of Object.entries(engine.modules)) {
|
|
53
|
+
if (moduleConfig.repo) {
|
|
54
|
+
const repoFromUrl = moduleConfig.repo
|
|
55
|
+
.replace(/.*github\.com[:/]/, '')
|
|
56
|
+
.replace(/\.git$/, '');
|
|
57
|
+
if (repoFromUrl === repoFullName || repoFromUrl.endsWith(`/${repoName}`)) {
|
|
58
|
+
return { type: 'module', name: moduleName, config: moduleConfig, engine };
|
|
59
|
+
}
|
|
60
|
+
}
|
|
61
|
+
}
|
|
62
|
+
}
|
|
63
|
+
return null;
|
|
64
|
+
}
|
|
65
|
+
// Webhook handler middleware
|
|
66
|
+
export function createWebhookHandler(secret) {
|
|
67
|
+
return async (req, res) => {
|
|
68
|
+
const signature = req.headers['x-hub-signature-256'];
|
|
69
|
+
const event = req.headers['x-github-event'];
|
|
70
|
+
// Log webhook receipt
|
|
71
|
+
const ip = req.headers['x-forwarded-for'] || req.socket.remoteAddress;
|
|
72
|
+
log.dim(`Webhook received from ${ip}`);
|
|
73
|
+
// Verify signature
|
|
74
|
+
const rawBody = JSON.stringify(req.body);
|
|
75
|
+
if (!verifySignature(secret, rawBody, signature)) {
|
|
76
|
+
log.error('Invalid webhook signature');
|
|
77
|
+
res.status(401).send('Unauthorized');
|
|
78
|
+
return;
|
|
79
|
+
}
|
|
80
|
+
// Only handle push events
|
|
81
|
+
if (event !== 'push') {
|
|
82
|
+
log.dim(`Ignoring event: ${event}`);
|
|
83
|
+
res.status(200).send(`Event ${event} ignored`);
|
|
84
|
+
return;
|
|
85
|
+
}
|
|
86
|
+
const { repository, ref } = req.body;
|
|
87
|
+
if (!repository || !ref) {
|
|
88
|
+
res.status(400).send('Invalid payload');
|
|
89
|
+
return;
|
|
90
|
+
}
|
|
91
|
+
const repoName = repository.name;
|
|
92
|
+
const repoFullName = repository.full_name;
|
|
93
|
+
const branch = ref.split('/').pop();
|
|
94
|
+
log.info(`Push to ${repoFullName} (${branch})`);
|
|
95
|
+
// Find matching app or module
|
|
96
|
+
const match = await findAppByRepo(repoFullName, repoName);
|
|
97
|
+
if (!match) {
|
|
98
|
+
log.dim(`No config found for ${repoFullName}`);
|
|
99
|
+
res.status(200).send('Repository not configured');
|
|
100
|
+
return;
|
|
101
|
+
}
|
|
102
|
+
// Check branch matches
|
|
103
|
+
const expectedBranch = match.config.branch || 'main';
|
|
104
|
+
if (branch !== expectedBranch) {
|
|
105
|
+
log.dim(`Ignoring push to ${branch}, expected ${expectedBranch}`);
|
|
106
|
+
res.status(200).send(`Branch ${branch} ignored`);
|
|
107
|
+
return;
|
|
108
|
+
}
|
|
109
|
+
// Respond immediately
|
|
110
|
+
res.status(200).send('Deployment started');
|
|
111
|
+
// Queue deployment in background
|
|
112
|
+
const deployName = match.type === 'module'
|
|
113
|
+
? `${match.engine.name}/${match.name}`
|
|
114
|
+
: match.name;
|
|
115
|
+
queueDeployment(deployName, async () => {
|
|
116
|
+
try {
|
|
117
|
+
if (match.type === 'app') {
|
|
118
|
+
await deployApp(match.config);
|
|
119
|
+
log.success(`Deployed ${match.name}`);
|
|
120
|
+
}
|
|
121
|
+
else {
|
|
122
|
+
await deployModule(match.engine, match.name, match.config);
|
|
123
|
+
log.success(`Deployed module ${match.engine.name}/${match.name}`);
|
|
124
|
+
}
|
|
125
|
+
}
|
|
126
|
+
catch (error) {
|
|
127
|
+
log.error(`Deployment failed for ${deployName}: ${error}`);
|
|
128
|
+
}
|
|
129
|
+
});
|
|
130
|
+
};
|
|
131
|
+
}
|
|
132
|
+
// Health check handler
|
|
133
|
+
export function healthHandler(req, res) {
|
|
134
|
+
res.status(200).json({
|
|
135
|
+
status: 'healthy',
|
|
136
|
+
timestamp: new Date().toISOString(),
|
|
137
|
+
version: process.env.npm_package_version || '0.1.0',
|
|
138
|
+
});
|
|
139
|
+
}
|
|
140
|
+
// Manual deploy handler
|
|
141
|
+
export function createManualDeployHandler() {
|
|
142
|
+
return async (req, res) => {
|
|
143
|
+
const { name } = req.params;
|
|
144
|
+
log.info(`Manual deployment triggered for ${name}`);
|
|
145
|
+
const apps = await loadAppConfigs();
|
|
146
|
+
const config = apps.get(name);
|
|
147
|
+
if (!config) {
|
|
148
|
+
res.status(404).send(`App not found: ${name}`);
|
|
149
|
+
return;
|
|
150
|
+
}
|
|
151
|
+
res.status(200).send(`Deployment started for ${name}`);
|
|
152
|
+
queueDeployment(name, async () => {
|
|
153
|
+
try {
|
|
154
|
+
await deployApp(config);
|
|
155
|
+
log.success(`Deployed ${name}`);
|
|
156
|
+
}
|
|
157
|
+
catch (error) {
|
|
158
|
+
log.error(`Deployment failed for ${name}: ${error}`);
|
|
159
|
+
}
|
|
160
|
+
});
|
|
161
|
+
};
|
|
162
|
+
}
|
|
163
|
+
//# sourceMappingURL=webhook.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"webhook.js","sourceRoot":"","sources":["../../src/server/webhook.ts"],"names":[],"mappings":"AAAA,OAAO,MAAM,MAAM,QAAQ,CAAA;AAE3B,OAAO,EAAE,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CAAA;QACnC,MAAM,MAAM,GAAG,IAAI,CAAC,GAAG,CAAC,IAAI,CAAC,CAAA;QAE7B,IAAI,CAAC,MAAM,EAAE,CAAC;YACZ,GAAG,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC,IAAI,CAAC,kBAAkB,IAAI,EAAE,CAAC,CAAA;YAC9C,OAAM;QACR,CAAC;QAED,GAAG,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC,IAAI,CAAC,0BAA0B,IAAI,EAAE,CAAC,CAAA;QAEtD,eAAe,CAAC,IAAI,EAAE,KAAK,IAAI,EAAE;YAC/B,IAAI,CAAC;gBACH,MAAM,SAAS,CAAC,MAAM,CAAC,CAAA;gBACvB,GAAG,CAAC,OAAO,CAAC,YAAY,IAAI,EAAE,CAAC,CAAA;YACjC,CAAC;YAAC,OAAO,KAAK,EAAE,CAAC;gBACf,GAAG,CAAC,KAAK,CAAC,yBAAyB,IAAI,KAAK,KAAK,EAAE,CAAC,CAAA;YACtD,CAAC;QACH,CAAC,CAAC,CAAA;IACJ,CAAC,CAAA;AACH,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/utils/index.ts"],"names":[],"mappings":"AAAA,cAAc,aAAa,CAAA;AAC3B,cAAc,cAAc,CAAA;AAC5B,cAAc,YAAY,CAAA"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/utils/index.ts"],"names":[],"mappings":"AAAA,cAAc,aAAa,CAAA;AAC3B,cAAc,cAAc,CAAA;AAC5B,cAAc,YAAY,CAAA"}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
export declare const log: {
|
|
2
|
+
info: (msg: string) => void;
|
|
3
|
+
success: (msg: string) => void;
|
|
4
|
+
warn: (msg: string) => void;
|
|
5
|
+
error: (msg: string) => void;
|
|
6
|
+
healthy: (name: string) => void;
|
|
7
|
+
stopped: (name: string) => void;
|
|
8
|
+
building: (name: string) => void;
|
|
9
|
+
step: (msg: string) => void;
|
|
10
|
+
command: (cmd: string) => void;
|
|
11
|
+
header: (text: string) => void;
|
|
12
|
+
row: (label: string, value: string) => void;
|
|
13
|
+
dim: (msg: string) => void;
|
|
14
|
+
bold: (msg: string) => void;
|
|
15
|
+
banner: () => void;
|
|
16
|
+
};
|
|
17
|
+
//# sourceMappingURL=logger.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"logger.d.ts","sourceRoot":"","sources":["../../src/utils/logger.ts"],"names":[],"mappings":"AAEA,eAAO,MAAM,GAAG;gBACF,MAAM;mBACH,MAAM;gBACT,MAAM;iBACL,MAAM;oBAGH,MAAM;oBACN,MAAM;qBACL,MAAM;gBAGX,MAAM;mBACH,MAAM;mBAGN,MAAM;iBACR,MAAM,SAAS,MAAM;eAGvB,MAAM;gBACL,MAAM;;CAMnB,CAAA"}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import chalk from 'chalk';
|
|
2
|
+
export const log = {
|
|
3
|
+
info: (msg) => console.log(chalk.blue('ℹ'), msg),
|
|
4
|
+
success: (msg) => console.log(chalk.green('✓'), msg),
|
|
5
|
+
warn: (msg) => console.log(chalk.yellow('⚠'), msg),
|
|
6
|
+
error: (msg) => console.log(chalk.red('✗'), msg),
|
|
7
|
+
// Status indicators
|
|
8
|
+
healthy: (name) => console.log(chalk.green('●'), chalk.white(name), chalk.dim('healthy')),
|
|
9
|
+
stopped: (name) => console.log(chalk.red('●'), chalk.white(name), chalk.dim('stopped')),
|
|
10
|
+
building: (name) => console.log(chalk.yellow('●'), chalk.white(name), chalk.dim('building')),
|
|
11
|
+
// Deployment output
|
|
12
|
+
step: (msg) => console.log(chalk.dim(' →'), msg),
|
|
13
|
+
command: (cmd) => console.log(chalk.dim(' $'), chalk.cyan(cmd)),
|
|
14
|
+
// Table-style output
|
|
15
|
+
header: (text) => console.log(chalk.bold.white(`\n${text}\n${'-'.repeat(text.length)}`)),
|
|
16
|
+
row: (label, value) => console.log(chalk.dim(label.padEnd(15)), value),
|
|
17
|
+
// Raw output
|
|
18
|
+
dim: (msg) => console.log(chalk.dim(msg)),
|
|
19
|
+
bold: (msg) => console.log(chalk.bold(msg)),
|
|
20
|
+
// Branding
|
|
21
|
+
banner: () => {
|
|
22
|
+
console.log(chalk.yellow.bold('\n ⚡ shyp'), chalk.dim('- zero friction deployment\n'));
|
|
23
|
+
},
|
|
24
|
+
};
|
|
25
|
+
//# sourceMappingURL=logger.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"logger.js","sourceRoot":"","sources":["../../src/utils/logger.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAA;AAEzB,MAAM,CAAC,MAAM,GAAG,GAAG;IACjB,IAAI,EAAE,CAAC,GAAW,EAAE,EAAE,CAAC,OAAO,CAAC,GAAG,CAAC,KAAK,CAAC,IAAI,CAAC,GAAG,CAAC,EAAE,GAAG,CAAC;IACxD,OAAO,EAAE,CAAC,GAAW,EAAE,EAAE,CAAC,OAAO,CAAC,GAAG,CAAC,KAAK,CAAC,KAAK,CAAC,GAAG,CAAC,EAAE,GAAG,CAAC;IAC5D,IAAI,EAAE,CAAC,GAAW,EAAE,EAAE,CAAC,OAAO,CAAC,GAAG,CAAC,KAAK,CAAC,MAAM,CAAC,GAAG,CAAC,EAAE,GAAG,CAAC;IAC1D,KAAK,EAAE,CAAC,GAAW,EAAE,EAAE,CAAC,OAAO,CAAC,GAAG,CAAC,KAAK,CAAC,GAAG,CAAC,GAAG,CAAC,EAAE,GAAG,CAAC;IAExD,oBAAoB;IACpB,OAAO,EAAE,CAAC,IAAY,EAAE,EAAE,CAAC,OAAO,CAAC,GAAG,CAAC,KAAK,CAAC,KAAK,CAAC,GAAG,CAAC,EAAE,KAAK,CAAC,KAAK,CAAC,IAAI,CAAC,EAAE,KAAK,CAAC,GAAG,CAAC,SAAS,CAAC,CAAC;IAC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,EAAE,CAAC,OAAO,CAAC,GAAG,CAAC,KAAK,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;IAEnD,WAAW;IACX,MAAM,EAAE,GAAG,EAAE;QACX,OAAO,CAAC,GAAG,CAAC,KAAK,CAAC,MAAM,CAAC,IAAI,CAAC,YAAY,CAAC,EAAE,KAAK,CAAC,GAAG,CAAC,8BAA8B,CAAC,CAAC,CAAA;IACzF,CAAC;CACF,CAAA"}
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
export declare const SHYP_DIR: string;
|
|
2
|
+
export declare const CONFIG_FILE: string;
|
|
3
|
+
export declare const APPS_DIR: string;
|
|
4
|
+
export declare const ENGINES_DIR: string;
|
|
5
|
+
export declare const SECRETS_DIR: string;
|
|
6
|
+
export declare const TEMPLATES_DIR: string;
|
|
7
|
+
export declare const STATE_DIR: string;
|
|
8
|
+
export declare const PORTS_FILE: string;
|
|
9
|
+
export declare const DEPLOYMENTS_FILE: string;
|
|
10
|
+
export declare const HEALTH_FILE: string;
|
|
11
|
+
export declare const LOG_DIR = "/var/log/shyp";
|
|
12
|
+
export declare const MAIN_LOG: string;
|
|
13
|
+
export declare const WEBHOOK_LOG: string;
|
|
14
|
+
export declare const APPS_LOG_DIR: string;
|
|
15
|
+
export declare const NGINX_AVAILABLE = "/etc/nginx/sites-available";
|
|
16
|
+
export declare const NGINX_ENABLED = "/etc/nginx/sites-enabled";
|
|
17
|
+
export declare const DEFAULT_SSH_KEY: string;
|
|
18
|
+
export declare const DEFAULT_WEBHOOK_PORT = 9000;
|
|
19
|
+
export declare const PORT_RANGES: {
|
|
20
|
+
readonly standard: {
|
|
21
|
+
readonly start: 3001;
|
|
22
|
+
readonly end: 3099;
|
|
23
|
+
};
|
|
24
|
+
readonly games: {
|
|
25
|
+
readonly start: 4000;
|
|
26
|
+
readonly end: 4099;
|
|
27
|
+
};
|
|
28
|
+
readonly special: {
|
|
29
|
+
readonly start: 5000;
|
|
30
|
+
readonly end: 5099;
|
|
31
|
+
};
|
|
32
|
+
readonly wyrt: {
|
|
33
|
+
readonly start: 8000;
|
|
34
|
+
readonly end: 8099;
|
|
35
|
+
};
|
|
36
|
+
};
|
|
37
|
+
//# sourceMappingURL=paths.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"paths.d.ts","sourceRoot":"","sources":["../../src/utils/paths.ts"],"names":[],"mappings":"AAIA,eAAO,MAAM,QAAQ,QAAsC,CAAA;AAG3D,eAAO,MAAM,WAAW,QAAgC,CAAA;AACxD,eAAO,MAAM,QAAQ,QAAyB,CAAA;AAC9C,eAAO,MAAM,WAAW,QAA4B,CAAA;AACpD,eAAO,MAAM,WAAW,QAA4B,CAAA;AACpD,eAAO,MAAM,aAAa,QAA8B,CAAA;AACxD,eAAO,MAAM,SAAS,QAA0B,CAAA;AAGhD,eAAO,MAAM,UAAU,QAAgC,CAAA;AACvD,eAAO,MAAM,gBAAgB,QAAsC,CAAA;AACnE,eAAO,MAAM,WAAW,QAAiC,CAAA;AAGzD,eAAO,MAAM,OAAO,kBAAkB,CAAA;AACtC,eAAO,MAAM,QAAQ,QAA4B,CAAA;AACjD,eAAO,MAAM,WAAW,QAAgC,CAAA;AACxD,eAAO,MAAM,YAAY,QAAwB,CAAA;AAGjD,eAAO,MAAM,eAAe,+BAA+B,CAAA;AAC3D,eAAO,MAAM,aAAa,6BAA6B,CAAA;AAGvD,eAAO,MAAM,eAAe,QAAwC,CAAA;AAGpE,eAAO,MAAM,oBAAoB,OAAO,CAAA;AAGxC,eAAO,MAAM,WAAW;;;;;;;;;;;;;;;;;CAKd,CAAA"}
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import { homedir } from 'os';
|
|
2
|
+
import { join } from 'path';
|
|
3
|
+
// Shyp configuration directory
|
|
4
|
+
export const SHYP_DIR = process.env.SHYP_DIR || '/etc/shyp';
|
|
5
|
+
// Configuration paths
|
|
6
|
+
export const CONFIG_FILE = join(SHYP_DIR, 'config.yaml');
|
|
7
|
+
export const APPS_DIR = join(SHYP_DIR, 'apps');
|
|
8
|
+
export const ENGINES_DIR = join(SHYP_DIR, 'engines');
|
|
9
|
+
export const SECRETS_DIR = join(SHYP_DIR, 'secrets');
|
|
10
|
+
export const TEMPLATES_DIR = join(SHYP_DIR, 'templates');
|
|
11
|
+
export const STATE_DIR = join(SHYP_DIR, 'state');
|
|
12
|
+
// State files
|
|
13
|
+
export const PORTS_FILE = join(STATE_DIR, 'ports.json');
|
|
14
|
+
export const DEPLOYMENTS_FILE = join(STATE_DIR, 'deployments.json');
|
|
15
|
+
export const HEALTH_FILE = join(STATE_DIR, 'health.json');
|
|
16
|
+
// Log paths
|
|
17
|
+
export const LOG_DIR = '/var/log/shyp';
|
|
18
|
+
export const MAIN_LOG = join(LOG_DIR, 'shyp.log');
|
|
19
|
+
export const WEBHOOK_LOG = join(LOG_DIR, 'webhooks.log');
|
|
20
|
+
export const APPS_LOG_DIR = join(LOG_DIR, 'apps');
|
|
21
|
+
// Nginx paths
|
|
22
|
+
export const NGINX_AVAILABLE = '/etc/nginx/sites-available';
|
|
23
|
+
export const NGINX_ENABLED = '/etc/nginx/sites-enabled';
|
|
24
|
+
// Default SSH key
|
|
25
|
+
export const DEFAULT_SSH_KEY = join(homedir(), '.ssh', 'id_ed25519');
|
|
26
|
+
// Webhook server
|
|
27
|
+
export const DEFAULT_WEBHOOK_PORT = 9000;
|
|
28
|
+
// Port ranges
|
|
29
|
+
export const PORT_RANGES = {
|
|
30
|
+
standard: { start: 3001, end: 3099 },
|
|
31
|
+
games: { start: 4000, end: 4099 },
|
|
32
|
+
special: { start: 5000, end: 5099 },
|
|
33
|
+
wyrt: { start: 8000, end: 8099 }, // Reserved for Wyrt WebManager
|
|
34
|
+
};
|
|
35
|
+
//# sourceMappingURL=paths.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"paths.js","sourceRoot":"","sources":["../../src/utils/paths.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,O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cAAc;AACd,MAAM,CAAC,MAAM,eAAe,GAAG,4BAA4B,CAAA;AAC3D,MAAM,CAAC,MAAM,aAAa,GAAG,0BAA0B,CAAA;AAEvD,kBAAkB;AAClB,MAAM,CAAC,MAAM,eAAe,GAAG,IAAI,CAAC,OAAO,EAAE,EAAE,MAAM,EAAE,YAAY,CAAC,CAAA;AAEpE,iBAAiB;AACjB,MAAM,CAAC,MAAM,oBAAoB,GAAG,IAAI,CAAA;AAExC,cAAc;AACd,MAAM,CAAC,MAAM,WAAW,GAAG;IACzB,QAAQ,EAAE,EAAE,KAAK,EAAE,IAAI,EAAE,GAAG,EAAE,IAAI,EAAE;IACpC,KAAK,EAAE,EAAE,KAAK,EAAE,IAAI,EAAE,GAAG,EAAE,IAAI,EAAE;IACjC,OAAO,EAAE,EAAE,KAAK,EAAE,IAAI,EAAE,GAAG,EAAE,IAAI,EAAE;IACnC,IAAI,EAAE,EAAE,KAAK,EAAE,IAAI,EAAE,GAAG,EAAE,IAAI,EAAE,EAAE,+BAA+B;CACzD,CAAA"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"spinner.d.ts","sourceRoot":"","sources":["../../src/utils/spinner.ts"],"names":[],"mappings":"AAAA,OAAY,EAAE,KAAK,GAAG,EAAE,MAAM,KAAK,CAAA;AAEnC,wBAAgB,aAAa,CAAC,IAAI,EAAE,MAAM,GAAG,GAAG,CAK/C;AAED,wBAAsB,WAAW,CAAC,CAAC,EACjC,IAAI,EAAE,MAAM,EACZ,EAAE,EAAE,MAAM,OAAO,CAAC,CAAC,CAAC,GACnB,OAAO,CAAC,CAAC,CAAC,CAUZ"}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import ora from 'ora';
|
|
2
|
+
export function createSpinner(text) {
|
|
3
|
+
return ora({
|
|
4
|
+
text,
|
|
5
|
+
color: 'yellow',
|
|
6
|
+
});
|
|
7
|
+
}
|
|
8
|
+
export async function withSpinner(text, fn) {
|
|
9
|
+
const spinner = createSpinner(text).start();
|
|
10
|
+
try {
|
|
11
|
+
const result = await fn();
|
|
12
|
+
spinner.succeed();
|
|
13
|
+
return result;
|
|
14
|
+
}
|
|
15
|
+
catch (error) {
|
|
16
|
+
spinner.fail();
|
|
17
|
+
throw error;
|
|
18
|
+
}
|
|
19
|
+
}
|
|
20
|
+
//# sourceMappingURL=spinner.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"spinner.js","sourceRoot":"","sources":["../../src/utils/spinner.ts"],"names":[],"mappings":"AAAA,OAAO,GAAiB,MAAM,KAAK,CAAA;AAEnC,MAAM,UAAU,aAAa,CAAC,IAAY;IACxC,OAAO,GAAG,CAAC;QACT,IAAI;QACJ,KAAK,EAAE,QAAQ;KAChB,CAAC,CAAA;AACJ,CAAC;AAED,MAAM,CAAC,KAAK,UAAU,WAAW,CAC/B,IAAY,EACZ,EAAoB;IAEpB,MAAM,OAAO,GAAG,aAAa,CAAC,IAAI,CAAC,CAAC,KAAK,EAAE,CAAA;IAC3C,IAAI,CAAC;QACH,MAAM,MAAM,GAAG,MAAM,EAAE,EAAE,CAAA;QACzB,OAAO,CAAC,OAAO,EAAE,CAAA;QACjB,OAAO,MAAM,CAAA;IACf,CAAC;IAAC,OAAO,KAAK,EAAE,CAAC;QACf,OAAO,CAAC,IAAI,EAAE,CAAA;QACd,MAAM,KAAK,CAAA;IACb,CAAC;AACH,CAAC"}
|
package/package.json
ADDED
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "shyp",
|
|
3
|
+
"version": "0.1.0",
|
|
4
|
+
"description": "Zero friction deployment for Node.js apps",
|
|
5
|
+
"author": "shypd",
|
|
6
|
+
"license": "MIT",
|
|
7
|
+
"type": "module",
|
|
8
|
+
"bin": {
|
|
9
|
+
"shyp": "./dist/cli.js"
|
|
10
|
+
},
|
|
11
|
+
"main": "./dist/index.js",
|
|
12
|
+
"files": [
|
|
13
|
+
"dist"
|
|
14
|
+
],
|
|
15
|
+
"scripts": {
|
|
16
|
+
"build": "tsc",
|
|
17
|
+
"dev": "tsc -w",
|
|
18
|
+
"start": "node dist/cli.js",
|
|
19
|
+
"prepublishOnly": "npm run build"
|
|
20
|
+
},
|
|
21
|
+
"keywords": [
|
|
22
|
+
"deployment",
|
|
23
|
+
"devops",
|
|
24
|
+
"pm2",
|
|
25
|
+
"nginx",
|
|
26
|
+
"vps",
|
|
27
|
+
"deploy",
|
|
28
|
+
"nodejs",
|
|
29
|
+
"automation",
|
|
30
|
+
"AI",
|
|
31
|
+
"zero-friction"
|
|
32
|
+
],
|
|
33
|
+
"repository": {
|
|
34
|
+
"type": "git",
|
|
35
|
+
"url": "git+https://github.com/shypd/shyp.git"
|
|
36
|
+
},
|
|
37
|
+
"bugs": {
|
|
38
|
+
"url": "https://github.com/shypd/shyp/issues"
|
|
39
|
+
},
|
|
40
|
+
"homepage": "https://shyp.now",
|
|
41
|
+
"engines": {
|
|
42
|
+
"node": ">=20.0.0"
|
|
43
|
+
},
|
|
44
|
+
"dependencies": {
|
|
45
|
+
"chalk": "^5.4.1",
|
|
46
|
+
"commander": "^13.0.0",
|
|
47
|
+
"execa": "^9.5.2",
|
|
48
|
+
"express": "^4.21.2",
|
|
49
|
+
"ora": "^8.1.1",
|
|
50
|
+
"yaml": "^2.7.0",
|
|
51
|
+
"zod": "^3.24.1"
|
|
52
|
+
},
|
|
53
|
+
"devDependencies": {
|
|
54
|
+
"@types/express": "^5.0.0",
|
|
55
|
+
"@types/node": "^22.10.5",
|
|
56
|
+
"typescript": "^5.7.2"
|
|
57
|
+
}
|
|
58
|
+
}
|