core/backend/modules/services
enzo 5836f2201a feat: add Services and Logs modules (systemctl + journalctl via SSH)
Backend:
- modules/services: list, status, start/stop/restart systemctl services
  with pct exec support for LXC targets
- modules/logs: journalctl unit listing + WebSocket live streaming
  (direct SSH connection, journalctl -f, graceful teardown on WS close)
- migrations/003: seed services and logs modules in DB
- main.go: register services.New() and logs.New() in module loader

Frontend:
- services.html: target selector, search/filter, services table with
  active state indicators and start/stop/restart buttons
- logs.html: target + unit selectors, live follow toggle, scrollable
  terminal output with 3000-line cap
- app.js: servicePage() and logsPage() Alpine components + navItems
- locales: services and logs i18n keys (fr + en)
- pages.css: services table, state dots, logs output styles

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-22 02:03:55 +01:00
..
README.md feat: initialisation complète du CORE ProxmoxPanel 2026-03-20 21:08:53 +01:00
services.go feat: add Services and Logs modules (systemctl + journalctl via SSH) 2026-03-22 02:03:55 +01:00

Module — Services

Type: Optional (disabled by default)

Manage systemd services on the Proxmox host and LXC containers. Check status, start, stop, and restart services directly from the web interface.

Planned Features

  • List systemd services with current status (active/inactive/failed)
  • Start, stop, restart, reload actions
  • View service logs (last N lines via journalctl -u <service>)
  • Filter by status or name
  • LXC service management via pct exec

Planned API Endpoints

Method Path Auth Description
GET /api/services JWT List services and their status
POST /api/services/{name}/start JWT+Admin Start a service
POST /api/services/{name}/stop JWT+Admin Stop a service
POST /api/services/{name}/restart JWT+Admin Restart a service
POST /api/services/{name}/reload JWT+Admin Reload a service
GET /api/services/{name}/logs JWT Last 100 log lines

Query parameter: host=<optional> to target a specific LXC.

How It Works

Commands are executed over SSH using systemctl:

systemctl status nginx
systemctl restart nginx
journalctl -u nginx -n 100 --no-pager

For LXC containers:

pct exec <vmid> -- systemctl restart nginx

Status

This module is currently a stub. The UI view is implemented (shows a "module not enabled" placeholder). Full implementation is planned for a future release.

Requirements

  • SSH access with sufficient privileges to run systemctl commands
  • systemd on the target host/containers

License

MIT — see LICENSE