feat: ops-agent Fastify service met SSE, whitelist en systemd-unit
- ops-agent/: Node.js Fastify+TypeScript service
- GET /agent/v1/health
- POST /agent/v1/exec → SSE stream (stdout/stderr/exit events)
- Whitelist geladen uit /etc/ops-agent/commands.yml bij opstart
- Auth via Bearer shared secret (/etc/ops-agent/secret, mode 0640)
- Vier standaard commando's: docker_ps, git_status, systemctl_status,
caddy_show_config
- deploy/ops-agent/ops-agent.service: systemd-unit (User=ops-agent,
Restart=on-failure, StandardOutput=journal)
- deploy/ops-agent/setup.sh: aanmaken system-user, build, deploy,
systemctl enable --now ops-agent
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
parent
ad9cde6fb7
commit
4bccbf28f3
12 changed files with 1030 additions and 0 deletions
20
ops-agent/package.json
Normal file
20
ops-agent/package.json
Normal file
|
|
@ -0,0 +1,20 @@
|
|||
{
|
||||
"name": "ops-agent",
|
||||
"version": "0.1.0",
|
||||
"private": true,
|
||||
"scripts": {
|
||||
"build": "tsc",
|
||||
"start": "node dist/index.js",
|
||||
"dev": "ts-node --esm src/index.ts"
|
||||
},
|
||||
"dependencies": {
|
||||
"@fastify/cors": "^10.0.1",
|
||||
"fastify": "^5.3.2",
|
||||
"js-yaml": "^4.1.0"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@types/js-yaml": "^4.0.9",
|
||||
"@types/node": "^22.15.3",
|
||||
"typescript": "^5.8.3"
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue