VHS (Virtual Host System) is a backup system for network devices, designed to automatically save configurations and related data to a remote Git repository. This system is an essential tool for network administrators, helping them to maintain a history of device configurations and simplifying the process of restoring previous settings in case of failures or misconfigurations.
- Automatically saves configurations of network devices to a Git repository
- Supports periodic pushes to the remote repository
- Deprecates old configuration files after a specified time period
- Redacts sensitive data from the saved configurations
- Provides an example client to interact with network devices over SSH
- Implements a simple and efficient server using the Twirp framework
- Golang 1.16 or higher
- Git command-line tool installed and configured
- Clone the VHS repository:
git clone https://github.com/metajar/vhs.git
- Change the working directory to the
vhs
folder:
cd vhs
- Build the server binary:
go build -o vhs-server ./server
- Build the example client binary:
go build -o vhs-client ./client
-
Update the server configuration in the
server.go
file with your Git repository URL and branch name. -
Run the server:
./vhs-server
The server will be accessible at http://localhost:8080
.
-
Update the client configuration in the
client.go
file with the IP address, username, and password for the network device you want to backup. -
Run the example client:
./vhs-client
The client will connect to the network device, execute a set of commands to retrieve the device's configuration, and send the configuration to the VHS server.
You can customize VHS by modifying the server or client code to support different types of network devices or additional features. You can also create your own client applications using the provided VhsServiceProtobufClient
API.
Contributions are welcome! Please open an issue or submit a pull request for any bugs, improvements, or feature requests.
VHS is licensed under the MIT License.