mcp-ssh-manager 3.8.4 → 3.8.6
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/CHANGELOG.md +96 -0
- package/README.md +18 -10
- package/cli/lib/menu.sh +2 -2
- package/docs/ALIASES_AND_HOOKS.md +54 -25
- package/docs/SECURITY_MODES.md +33 -3
- package/package.json +6 -3
- package/profiles/default.json +6 -4
- package/scripts/setup-hooks.sh +16 -7
- package/server.json +2 -2
- package/src/backup-manager.js +92 -62
- package/src/command-aliases.js +9 -6
- package/src/config-paths.js +12 -0
- package/src/database-manager.js +202 -40
- package/src/deploy-helper.js +15 -7
- package/src/health-monitor.js +20 -11
- package/src/hooks-system.js +298 -57
- package/src/index.js +59 -27
- package/src/logger.js +49 -17
- package/src/policy.js +46 -25
- package/src/profile-loader.js +18 -12
- package/src/server-aliases.js +9 -6
- package/src/shell-quote.js +54 -0
- package/src/shell-segments.js +189 -0
- package/src/ssh-key-manager.js +123 -76
- package/src/ssh-manager.js +17 -41
- package/src/user-state.js +60 -0
- package/.hooks-config.json +0 -131
package/.hooks-config.json
DELETED
|
@@ -1,131 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"pre-deploy": {
|
|
3
|
-
"enabled": true,
|
|
4
|
-
"description": "Run before any deployment",
|
|
5
|
-
"actions": [
|
|
6
|
-
{
|
|
7
|
-
"type": "validation",
|
|
8
|
-
"name": "check-git-status",
|
|
9
|
-
"command": "git status --porcelain",
|
|
10
|
-
"expectEmpty": true,
|
|
11
|
-
"errorMessage": "Uncommitted changes detected. Please commit or stash changes before deployment."
|
|
12
|
-
},
|
|
13
|
-
{
|
|
14
|
-
"type": "validation",
|
|
15
|
-
"name": "run-tests",
|
|
16
|
-
"command": "npm test 2>/dev/null || echo \"No tests configured\"",
|
|
17
|
-
"optional": true
|
|
18
|
-
}
|
|
19
|
-
]
|
|
20
|
-
},
|
|
21
|
-
"post-deploy": {
|
|
22
|
-
"enabled": true,
|
|
23
|
-
"description": "Run after successful deployment",
|
|
24
|
-
"actions": [
|
|
25
|
-
{
|
|
26
|
-
"type": "notification",
|
|
27
|
-
"name": "log-deployment",
|
|
28
|
-
"command": "echo \"[$(date)] Deployment completed to {server}\" >> deployments.log"
|
|
29
|
-
},
|
|
30
|
-
{
|
|
31
|
-
"type": "notification",
|
|
32
|
-
"name": "notify-slack",
|
|
33
|
-
"command": "curl -X POST -H \"Content-Type: application/json\" -d \"{{\\\"text\\\":\\\"Deployment to {server} completed\\\"}}\" $SLACK_WEBHOOK_URL 2>/dev/null || true",
|
|
34
|
-
"optional": true,
|
|
35
|
-
"requiresEnv": [
|
|
36
|
-
"SLACK_WEBHOOK_URL"
|
|
37
|
-
]
|
|
38
|
-
}
|
|
39
|
-
]
|
|
40
|
-
},
|
|
41
|
-
"on-error": {
|
|
42
|
-
"enabled": true,
|
|
43
|
-
"description": "Run when an error occurs",
|
|
44
|
-
"actions": [
|
|
45
|
-
{
|
|
46
|
-
"type": "notification",
|
|
47
|
-
"name": "log-error",
|
|
48
|
-
"command": "echo \"[$(date)] Error on {server}: {error}\" >> errors.log"
|
|
49
|
-
},
|
|
50
|
-
{
|
|
51
|
-
"type": "recovery",
|
|
52
|
-
"name": "attempt-recovery",
|
|
53
|
-
"remoteCommand": "bench restart && bench clear-cache",
|
|
54
|
-
"server": "{server}",
|
|
55
|
-
"optional": true
|
|
56
|
-
}
|
|
57
|
-
]
|
|
58
|
-
},
|
|
59
|
-
"pre-bench-update": {
|
|
60
|
-
"enabled": true,
|
|
61
|
-
"description": "Run before bench update",
|
|
62
|
-
"actions": [
|
|
63
|
-
{
|
|
64
|
-
"type": "backup",
|
|
65
|
-
"name": "backup-database",
|
|
66
|
-
"remoteCommand": "bench --site all backup --with-files",
|
|
67
|
-
"server": "{server}"
|
|
68
|
-
},
|
|
69
|
-
{
|
|
70
|
-
"type": "validation",
|
|
71
|
-
"name": "check-disk-space",
|
|
72
|
-
"remoteCommand": "df -h | grep -E \"/$|/home\" | awk '{print $5}' | sed 's/%//' | awk '{if($1 > 80) exit 1}'",
|
|
73
|
-
"server": "{server}",
|
|
74
|
-
"errorMessage": "Insufficient disk space (>80% used)"
|
|
75
|
-
}
|
|
76
|
-
]
|
|
77
|
-
},
|
|
78
|
-
"post-bench-update": {
|
|
79
|
-
"enabled": true,
|
|
80
|
-
"description": "Run after bench update",
|
|
81
|
-
"actions": [
|
|
82
|
-
{
|
|
83
|
-
"type": "verification",
|
|
84
|
-
"name": "check-services",
|
|
85
|
-
"remoteCommand": "supervisorctl status | grep -E \"RUNNING|STOPPED\"",
|
|
86
|
-
"server": "{server}"
|
|
87
|
-
},
|
|
88
|
-
{
|
|
89
|
-
"type": "verification",
|
|
90
|
-
"name": "check-site-status",
|
|
91
|
-
"remoteCommand": "bench --site all doctor",
|
|
92
|
-
"server": "{server}"
|
|
93
|
-
}
|
|
94
|
-
]
|
|
95
|
-
},
|
|
96
|
-
"pre-connect": {
|
|
97
|
-
"enabled": false,
|
|
98
|
-
"description": "Run before connecting to a server",
|
|
99
|
-
"actions": [
|
|
100
|
-
{
|
|
101
|
-
"type": "validation",
|
|
102
|
-
"name": "check-vpn",
|
|
103
|
-
"command": "ping -c 1 -W 2 10.0.0.1 > /dev/null 2>&1",
|
|
104
|
-
"errorMessage": "VPN not connected",
|
|
105
|
-
"optional": true
|
|
106
|
-
}
|
|
107
|
-
]
|
|
108
|
-
},
|
|
109
|
-
"post-connect": {
|
|
110
|
-
"enabled": false,
|
|
111
|
-
"description": "Run after successful connection",
|
|
112
|
-
"actions": [
|
|
113
|
-
{
|
|
114
|
-
"type": "notification",
|
|
115
|
-
"name": "log-connection",
|
|
116
|
-
"command": "echo \"[$(date)] Connected to {server}\" >> connections.log"
|
|
117
|
-
}
|
|
118
|
-
]
|
|
119
|
-
},
|
|
120
|
-
"context-test": {
|
|
121
|
-
"enabled": true,
|
|
122
|
-
"description": "Context replacement test",
|
|
123
|
-
"actions": [
|
|
124
|
-
{
|
|
125
|
-
"type": "notification",
|
|
126
|
-
"name": "use-context",
|
|
127
|
-
"command": "echo \"Server: {server}, Error: {error}\" > /tmp/mcp-ssh-manager-context-test.txt"
|
|
128
|
-
}
|
|
129
|
-
]
|
|
130
|
-
}
|
|
131
|
-
}
|