2.4 KiB
Server Management Tool
This is a simple Go application designed to manage your servers, providing functionalities to list, wake up (Wake-on-LAN), shut down, and reboot them. It offers both a command-line interface (CLI) and a web-based interface for convenient management.
Features
- Server Dashboard: A responsive table view displaying all servers with real-time status, IP, and MAC addresses.
- Web Terminal: Integrated xterm.js terminal for direct SSH access to your servers from the browser.
- Manage Power:
- Wake-on-LAN: Send magic packets to wake up offline servers.
- Shutdown/Reboot: Gracefully restart or power off servers via SSH.
- Status Monitoring: Reliable active health checks (ICMP ping) compatible with macOS and Linux.
- Server Management: Add, edit, or remove servers directly from the UI.
- MAC Address Lookup: Automatically discover MAC addresses for local servers.
Prerequisites
Getting Started (Local)
-
Clone the repository:
git clone git@git.hnrx.net:hnrx/manage-servers.git cd manage-servers -
Run the application:
go run . serveThe application will automatically create a configuration file (
servers.yamlused by Viper) if one doesn't exist. Access the web interface athttp://localhost:8080.
Getting Started (Docker)
The project uses standard Docker Hub images (golang:latest and alpine:latest).
-
Build the image:
docker build -t manage-servers:latest . -
Run the container:
For Wake-on-LAN to broadcast correctly, the container must run in host networking mode:
docker run -d \ --name manage-servers \ --network host \ manage-servers:latestNote: Port mapping (
-p 8080:8080) is not required when using--network hostas the container shares the host's networking stack.
Configuration
Servers can be managed entirely through the web UI ("Register Server" button).
Under the hood, the application persists configuration to config.yaml or servers.json depending on the environment.
Required Fields for Full Functionality
- Wake-on-LAN: Requires valid
MAC Address. - Shutdown/Reboot: Requires
SSH UserandSSH Password. - Terminal: Requires
SSH UserandSSH Password.