serverprobe is a powerful command-line interface tool designed to streamline and automate repetitive tasks on servers. This tool currently focuses on Nginx and Laravel configurations, providing easy-to-use commands for setting up web servers and managing basic authentication.
The primary goals of this project are to:
- Simplify the process of setting up Nginx for Laravel applications
- Provide an efficient way to manage basic authentication for Nginx servers
- Reduce human error in server configuration tasks
- Save time for system administrators and developers
- Nginx and Laravel Setup: Quickly configure Nginx for a Laravel application on a new server instance.
- Basic Authentication Management: Add or remove basic authentication for specific domains in Nginx.
- Error Handling: Robust error checking to prevent server misconfigurations.
- Configuration Backups: Automatic backups of Nginx configurations before making changes.
- Telegram Notifications: Optional integration with Telegram for real-time notifications on task completion or errors.
- Clone this repository:
git clone https://github.com/phanithken/server-automation-cli.git
- Navigate to the project directory:
cd server-automation-cli
- Make the scripts executable:
chmod +x *.sh
To set up Nginx for a Laravel application:
./nginx_laravel_setup.sh <domain>
Replace <domain>
with your actual domain name.
To add basic authentication:
./nginx_auth_manager.sh add <domain> <username> <password>
To remove basic authentication:
./nginx_auth_manager.sh remove <domain>
To enable Telegram notifications, set the following environment variables:
export TELEGRAM_BOT_TOKEN="your_bot_token_here"
export TELEGRAM_CHAT_ID="your_chat_id_here"
You can add these to your shell configuration file (e.g., ~/.bashrc
or ~/.zshrc
) for persistence.
The scripts use default paths for Nginx configurations. If your server uses different paths, you may need to modify the scripts accordingly.
Contributions to the Server Automation CLI are welcome! Here's how you can contribute:
- Fork the repository
- Create a new branch (
git checkout -b feature/AmazingFeature
) - Make your changes
- Commit your changes (
git commit -m 'Add some AmazingFeature'
) - Push to the branch (
git push origin feature/AmazingFeature
) - Open a Pull Request
This project is licensed under the MIT License - see the LICENSE file for details.
- Thanks to all contributors who have helped shape this project.
- Special thanks to the Nginx and Laravel communities for their excellent documentation.
These scripts make changes to your server configuration. Always test in a non-production environment first and ensure you have backups before running them on a live server.