A sleek, secure web interface to trigger Python automation scripts with a modern dark theme featuring red accents.
- Authentication: Secure login system with configurable users
- Dashboard: Execute Ansible playbooks, PowerShell scripts, and shell scripts
- Dynamic File Selection: Automatically scans directories for available files
- Log Viewer: Browse and view log files with breadcrumb navigation
- Modern UI: Dark theme with red/burgundy/coral color scheme
- Responsive Design: Mobile-friendly interface using Bootstrap 5
- HTTPS Support: Optional self-signed certificate support
- Activity Logging: Tracks user actions and script executions
- Interactive Help: Hover tooltips for contextual information
- Configurable: JSON-based configuration for easy customization
The application features a modern dark theme with a sophisticated color palette:
- Black Background:
#0a0a0afor the main interface - Burgundy:
#872341for gradients and accents - Red:
#BE3144for primary actions and highlights - Coral:
#E17564for hover states and interactive elements
- Python 3.6+
- Flask
- Existing automation scripts in the specified directories
pip install flaskEnsure you have the following directory structure:
.
├── app.py # Main Flask application
├── config.json # Configuration file (required)
├── templates/ # HTML templates
│ └── pages/
│ ├── login.html
│ ├── dashboard.html
│ ├── logs.html
│ └── config_error.html
├── playbooks/ # Directory containing .yml, .sh, .ps1 files
│ ├── example.yml
│ ├── script.sh
│ └── script.ps1
├── inventory/ # Directory containing .ini files
│ ├── hosts.ini
│ └── production.ini
├── logs/ # Directory for log files (auto-created)
├── run_ansible.py # Ansible wrapper script
├── run_powershell_with_ansible.py # PowerShell wrapper script
└── run_sh_with_ansible.py # Shell script wrapper
Create a config.json file in the same directory as app.py:
{
"secret_key": "your-secret-key-change-this-in-production",
"users": {
"admin": "admin123",
"user1": "password123"
},
"host": "0.0.0.0",
"port": 8443,
"debug": false,
"use_https": false
}Important: Change the secret_key and user passwords before deploying to production!
To enable HTTPS with self-signed certificates:
{
"use_https": true
}Note: When using HTTPS for the first time, you'll see a browser warning about the self-signed certificate. This is normal - click "Advanced" and "Proceed" to continue.
python3 app.py- Set
"use_https": trueinconfig.json - Run the application:
python3 app.pyThe server will start on http://0.0.0.0:8443 (or https:// if HTTPS is enabled)
- Navigate to
http://your-server:8443(orhttps://your-server:8443if HTTPS is enabled) - Login with credentials configured in
config.json - Default: Username:
admin, Password:admin123(change this!)
-
Select Task Type from the dropdown:
- "Run Ansible Playbook" (uses
run_ansible.py) - "Run PowerShell Script" (uses
run_powershell_with_ansible.py) - "Run Shell Script" (uses
run_sh_with_ansible.py)
- "Run Ansible Playbook" (uses
-
Select Target File - automatically filtered based on task type:
.ymlfiles for Ansible.ps1files for PowerShell.shfiles for Shell scripts
-
Select Inventory - shows
.inifiles from the inventory directory -
Configure Options:
- Parallelism (Forks): Set the number of parallel executions (1-10)
- Verbose Output: Toggle verbose logging
-
Click Start Job to execute the command
Tip: Hover over the ? icon in the hero card for helpful information about the dashboard.
- Navigate to the Logs page from the navigation bar
- Use breadcrumb navigation to browse through log directories
- Click ".. (Go Up)" to navigate to parent directories
- Click on any log file to view its content in the right panel
- File dates are displayed in red for easy visibility
- Log files are sorted by newest first
When you click "Start Job", the application runs:
python3 {selected_script_wrapper} --playbooks ./playbooks/{selected_file} --inventory ./inventory/{selected_inventory} --forks {forks} [--verbose]The command is executed in the background using subprocess.Popen() so the web interface remains responsive.
Simply place your files in the appropriate directories:
- Ansible Playbooks:
./playbooks/*.yml - PowerShell Scripts:
./playbooks/*.ps1 - Shell Scripts:
./playbooks/*.sh - Inventory Files:
./inventory/*.ini
The web interface will automatically detect and display them in the dropdowns.
Log files should be written to the ./logs/ directory by your automation scripts. The log viewer will automatically detect and display any files and subdirectories.
- Change default credentials before deploying to production
- Use a strong secret_key in
config.json - Enable HTTPS in production environments
- Firewall: Ensure only authorized IPs can access port 8443
- File permissions: Set appropriate permissions on your script files
- Network security: Consider using a reverse proxy (nginx/Apache) for additional security
- Path traversal protection: The application includes built-in path validation to prevent directory traversal attacks
-
"Configuration Error" page
- Ensure
config.jsonexists in the same directory asapp.py - Verify the JSON syntax is valid
- Check file permissions
- Ensure
-
"Script wrapper not found" error
- Ensure the wrapper scripts exist in the same directory as
app.py - Check file permissions (should be executable)
- Ensure the wrapper scripts exist in the same directory as
-
"Target file not found" error
- Verify your files are in the correct directories
- Check file extensions match the expected types
-
HTTPS Certificate Issues
- Self-signed certificates will show browser warnings - this is normal
- For production, consider using proper SSL certificates (Let's Encrypt)
-
Port Already in Use
- Change the
portinconfig.json - Or stop the service using that port:
sudo netstat -tulpn | grep :8443
- Change the
-
Logs page not loading
- Ensure the
./logs/directory exists - Check directory permissions
- Verify the
templates/pages/logs.htmlfile exists
- Ensure the
For development, enable debug mode in config.json:
{
"debug": true
}This will provide detailed error messages and auto-reload on code changes.
The application uses Jinja2 templates organized in the templates/pages/ directory:
login.html: Authentication page with dark themedashboard.html: Main interface with task execution form and hover tooltipslogs.html: Log browser with breadcrumb navigationconfig_error.html: Error page displayed whenconfig.jsonis missing or invalid
All templates share a consistent dark theme with red accents for a cohesive user experience.
For production deployment, run the application as a systemd service:
- Create a service file:
/etc/systemd/system/simple-automatica.service
[Unit]
Description=simple_Automatica Dashboard
After=network.target
[Service]
Type=simple
User=your-username
WorkingDirectory=/path/to/SimpleAutomatica
ExecStart=/usr/bin/python3 /path/to/SimpleAutomatica/app.py
Restart=always
RestartSec=10
[Install]
WantedBy=multi-user.target- Enable and start the service:
sudo systemctl enable simple-automatica
sudo systemctl start simple-automatica
sudo systemctl status simple-automatica- View logs:
sudo journalctl -u simple-automatica -fAll user actions are logged to ./logs/activity.log:
- Login attempts (successful and failed)
- Task executions
- Errors and exceptions
Script execution output is logged to ./logs/debug_execution.log for troubleshooting.
If you encounter issues:
- Check the console output when running
python3 app.py - Verify all directory paths are correct
- Ensure Python 3 and Flask are properly installed
- Check file permissions on all scripts and directories
- Review
./logs/activity.logfor user action history - Review
./logs/debug_execution.logfor script execution details
This project is licensed under the MIT License.
© 2026 David Zhorzholiani