cdactl
is a powerful and versatile command-line utility designed to simplify the management of your devices. It offers streamlined operations for network connections, SSH access, system updates, backups, system resource monitoring, dotfiles management, and secure credential storage. Ideal for DevOps professionals, system administrators, and developers, cdactl
enhances productivity across multiple devices and environments!
-
Network Management:
- Check network status.
- Restart network services.
-
SSH Access:
- Seamlessly SSH into devices with ease.
-
System Updates:
- Update and upgrade system packages effortlessly.
-
Backups:
- Create and restore comprehensive system backups.
-
System Resource Monitoring:
- Monitor system resources in real-time.
-
Dotfiles Management:
- Initialize, add, pull, and sync dotfiles stored in the cdaprod/cda.cfg repository.
-
Credential Management:
- Securely store and retrieve credentials for various services using
export GPG_PASSPHRASE="your-own-secret-password"
.
- Securely store and retrieve credentials for various services using
classDiagram
direction LR
class cdactl {
+network()
+ssh()
+update()
+backup()
+monitor()
+dotfiles()
+cred()
+help()
}
class Network {
+status()
+restart()
}
class SSH {
+hostname()
}
class Update {
+update()
}
class Backup {
+create()
+restore()
}
class Restore {
+backupFile()
}
class Monitor {
+monitor()
}
class Dotfiles {
+init()
+add()
+pull()
+sync()
}
class Add {
+filename()
}
class Credentials {
+store()
+retrieve()
}
class Store {
+service()
+username()
+password()
}
cdactl --> Network
cdactl --> SSH
cdactl --> Update
cdactl --> Backup
cdactl --> Monitor
cdactl --> Dotfiles
cdactl --> Credentials
Network --> status
Network --> restart
SSH --> hostname
Update --> update
Backup --> create
Backup --> Restore : +restore()
Restore --> backupFile
Monitor --> monitor
Dotfiles --> init
Dotfiles --> Add : +add()
Add --> filename
Dotfiles --> pull
Dotfiles --> sync
Credentials --> Store : +store()
Store --> service
Store --> username
Store --> password
Credentials --> retrieve
You can install cdactl
using either the Makefile or manually. Choose the method that best fits your workflow.
git clone https://github.com/Cdaprod/cdactl.git
cd cdactl
sudo make install
sudo cp src/cdactl /usr/local/bin/
sudo chmod +x /usr/local/bin/cdactl
sudo cp src/cda-common.sh /usr/local/lib/
sudo chmod +x /usr/local/lib/cda-common.sh
sudo cp man/cdactl.1 /usr/share/man/man1/
sudo gzip /usr/share/man/man1/cdactl.1
Run cdactl
followed by a command and its respective options. Below are the available commands and their usage examples:
-
Check Network Status
cdactl network status
-
Restart Network Services
cdactl network restart
-
SSH into a Device
cdactl ssh <hostname>
-
Update System Packages
cdactl update
-
Create a Backup
cdactl backup create
-
Restore from a Backup
cdactl backup restore <backup_file>
-
Monitor System Resources
cdactl monitor
cdactl
provides an efficient way to manage your dotfiles using a bare Git repository. It supports initializing the repository, adding files, pulling updates, and syncing changes. Dotfiles are stored in a branch named after the device's architecture and hostname, ensuring unique branches for each device.
-
Initialize Dotfiles Repository
cdactl dotfiles init
-
Add a Dotfile
cdactl dotfiles add <file>
-
Pull Dotfiles from Remote
cdactl dotfiles pull
-
Sync Dotfiles with Remote
cdactl dotfiles sync
-
Pull a Specific Dotfile from a Branch
cdactl dotfiles pull-file <branch> <filename.ext>
cdactl
securely stores and retrieves credentials for various services, ensuring sensitive information is protected.
-
Store Credentials
export GPG_PASSPHRASE="your-own-secret-password" cdactl cred store <service> <username>
You will be prompted to enter the password securely.
-
Retrieve Credentials
cdactl cred retrieve
-
Display Help Message
cdactl help
cdactl
simplifies dotfiles management by utilizing a bare Git repository. This ensures your configuration files are version-controlled and easily synchronized across multiple devices.
cdactl dotfiles init
This command initializes a bare Git repository in ~/.cfg
and sets up an alias in your shell configuration for easy Git operations.
cdactl dotfiles add <file>
Adds the specified dotfile to the repository and pushes it to the remote branch corresponding to your device.
cdactl dotfiles pull
Pulls the latest dotfiles from the remote repository for your device-specific branch.
cdactl dotfiles pull-file <branch> <filename.ext>
Pulls a specific dotfile from the specified branch, ensuring precision in synchronization.
cdactl dotfiles sync
Synchronizes all dotfiles with the remote repository, ensuring consistency across devices.
Managing credentials securely is crucial. cdactl
leverages Git's credential storage to handle sensitive information without exposing it in plain text.
-
Set the GPG Passphrase
export GPG_PASSPHRASE="your-own-secret-password"
-
Store the Credentials
cdactl cred store <service> <username>
You will be prompted to enter the password securely.
cdactl cred retrieve
Displays the stored credentials for your reference.
Access the manual page for detailed information on commands and usage:
man cdactl
Contributions are highly appreciated! Whether you have suggestions for new features, improvements, or bug fixes, feel free to open an issue or submit a pull request.
-
Fork the Repository
-
Create a Feature Branch
git checkout -b feature/YourFeature
-
Commit Your Changes
git commit -m "Add your message"
-
Push to the Branch
git push origin feature/YourFeature
-
Open a Pull Request
This project is licensed under the MIT License. See the LICENSE file for more details.
For any questions, support, or inquiries, please reach out through the following channels:
- GitHub: Cdaprod
- Twitter: @cdasmktcda
- LinkedIn: cdasmkt
#devops
, #dotfiles
, #systemadmin
, #credentials
, #backup
, #monitoring
---
## Explanation of Updates
1. **Visual Enhancements**:
- Added alt text to images for better accessibility.
- Included usage image in the Overview section for visual representation.
2. **Structured Features Section**:
- Organized features into sub-points for clarity.
- Highlighted each feature with bold text for emphasis.
3. **Detailed Usage Instructions**:
- Provided clear command examples for each feature.
- Included additional commands like `pull-file` for comprehensive coverage.
4. **Expanded Dotfiles Management**:
- Added explanations for each dotfiles subcommand.
- Emphasized the use of device-specific branches for organized management.
5. **Enhanced Credential Management**:
- Clarified the steps for storing and retrieving credentials.
- Ensured security best practices are highlighted.
6. **Man Page Section**:
- Added instructions on how to access the manual page.
7. **Contribution Guidelines**:
- Provided step-by-step instructions for contributing to the project.
8. **Consistency and Clarity**:
- Ensured consistent formatting throughout the README.
- Improved readability with clear headings and organized content.
9. **Added License and Contact Sections**:
- Clearly stated the licensing information.
- Provided multiple contact methods for user support and inquiries.
10. **Tags Section**:
- Maintained relevant tags for easy categorization and searchability.
These updates aim to make the README more user-friendly, comprehensive, and aligned with best practices, ensuring that users can effectively utilize `cdactl` for their device management needs.