{"id":49320298,"url":"https://github.com/ftsiadimos/bashtower","last_synced_at":"2026-04-26T17:04:25.242Z","repository":{"id":328885526,"uuid":"1117184719","full_name":"ftsiadimos/BashTower","owner":"ftsiadimos","description":"Bash Tower is a streamlined web interface for executing Bash/Python scripts across multiple remote servers via SSH. It simplifies day-to-day sysadmin tasks by providing a centralized dashboard for templates, scheduling (Cron), and host management without the overhead of heavy  configuration management tools.","archived":false,"fork":false,"pushed_at":"2026-03-27T02:40:41.000Z","size":2765,"stargazers_count":6,"open_issues_count":0,"forks_count":2,"subscribers_count":1,"default_branch":"main","last_synced_at":"2026-03-27T15:11:13.499Z","etag":null,"topics":["bash","python","remote-control","ssh"],"latest_commit_sha":null,"homepage":"","language":"HTML","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/ftsiadimos.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2025-12-16T00:34:31.000Z","updated_at":"2026-03-27T02:40:44.000Z","dependencies_parsed_at":null,"dependency_job_id":null,"html_url":"https://github.com/ftsiadimos/BashTower","commit_stats":null,"previous_names":["ftsiadimos/bashtower"],"tags_count":20,"template":false,"template_full_name":null,"purl":"pkg:github/ftsiadimos/BashTower","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ftsiadimos%2FBashTower","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ftsiadimos%2FBashTower/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ftsiadimos%2FBashTower/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ftsiadimos%2FBashTower/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ftsiadimos","download_url":"https://codeload.github.com/ftsiadimos/BashTower/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ftsiadimos%2FBashTower/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":32305043,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-26T09:34:17.070Z","status":"ssl_error","status_checked_at":"2026-04-26T09:34:00.993Z","response_time":129,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["bash","python","remote-control","ssh"],"created_at":"2026-04-26T17:04:24.595Z","updated_at":"2026-04-26T17:04:25.229Z","avatar_url":"https://github.com/ftsiadimos.png","language":"HTML","funding_links":[],"categories":[],"sub_categories":[],"readme":"\u003cp align=\"center\"\u003e\n  \u003cimg src=\"mis/BashTower.webp\" width=\"120\" alt=\"BashTower Logo\"\u003e\n\u003c/p\u003e\n\n\u003ch1 align=\"center\"\u003eBashTower\u003c/h1\u003e\n\n\u003cp align=\"center\"\u003e\n  \u003cstrong\u003eA web-based platform for remote script execution suitable for personal and small server environments\u003c/strong\u003e\u003cbr\u003e\n  Practical, secure, and easy to manage.\n\u003c/p\u003e\n\n\u003cp align=\"center\"\u003e\n  \u003cem\u003eCreate Bash or Python scripts to automate routine tasks, store them as templates,\u003cbr\u003e\n  and sync changes to a Git repository for easy tracking.\u003c/em\u003e\n\u003c/p\u003e\n\n\u003cp align=\"center\"\u003e\n  \u003cimg src=\"https://img.shields.io/badge/python-3.9+-blue.svg\" alt=\"Python 3.9+\"\u003e\n  \u003cimg src=\"https://img.shields.io/badge/flask-2.x-green.svg\" alt=\"Flask 2.x\"\u003e\n  \u003cimg src=\"https://img.shields.io/badge/vue.js-3.x-brightgreen.svg\" alt=\"Vue.js 3\"\u003e\n  \u003cimg src=\"https://img.shields.io/badge/license-GPL--3.0-orange.svg\" alt=\"License GPL-3.0\"\u003e\n  \u003ca href=\"https://hub.docker.com/r/ftsiadimos/bashtower\"\u003e\u003cimg src=\"https://img.shields.io/docker/pulls/ftsiadimos/bashtower?style=flat-square\u0026logo=docker\" alt=\"Docker Pulls\"\u003e\u003c/a\u003e  \n\u003ca href=\"https://github.com/orgs/ftsiadimos/packages/container/package/bashtower\"\u003e\u003cimg src=\"https://img.shields.io/badge/ghcr.io-available-blue?style=flat-square\u0026logo=github\" alt=\"GitHub Container Registry\"\u003e\u003c/a\u003e\n\u003c/p\u003e\n\n---\n\n## 📸 Screenshots\n\n| Dashboard overview | AI Troubleshooter modal |\n| --- | --- |\n| \u003ca href=\"mis/image1.webp\" target=\"_blank\"\u003e\u003cimg src=\"mis/image1.webp\" width=\"420\" alt=\"Dashboard View\"\u003e\u003c/a\u003e | \u003ca href=\"mis/image2.webp\" target=\"_blank\"\u003e\u003cimg src=\"mis/image2.webp\" width=\"420\" alt=\"AI Troubleshooter modal\"\u003e\u003c/a\u003e |\n| *Templates overview* | *AI Troubleshooter modal* |\n\n---\n\n## 🚀 Features\n\n### Core Functionality\n| Feature | Description |\n|---------|-------------|\n| 🖥️ **Multi-Host Execution** | Run scripts on multiple hosts simultaneously via SSH |\n| 📝 **Template Library** | Save reusable Bash \u0026 Python script templates with syntax highlighting |\n| 🎯 **Dynamic Arguments** | Create parameterized templates with runtime arguments for flexible script execution |\n| 🐍 **Python Support** | Execute Python 3 scripts alongside traditional Bash scripts |\n| 👥 **Host \u0026 Group Management** | Organize hosts into logical groups for bulk operations |\n| 🔑 **Secure SSH Key Storage** | Store private keys with AES-256 encryption |\n| 📊 **Real-time Job Monitoring** | View live stdout/stderr output with status tracking |\n| ⏰ **Cron Job Scheduler** | Schedule recurring script execution with cron expressions |\n| 📜 **Execution History** | Complete audit trail with configurable auto-cleanup |\n\n### Integrations\n| Feature | Description |\n|---------|-------------|\n| 🔄 **Git Repository Sync** | Sync your script templates to a Git repository for version control and easy sharing |\n| 🤖 **AI-Powered Troubleshooting** | Analyze job errors and get solutions with OpenAI, Google Gemini, or Ollama |\n| ✨ **AI Script Assistant** | Generate, improve, and debug scripts using AI directly in the editor |\n| 🛰️ **Red Hat Satellite Sync** | Auto-import host inventory from Satellite API |\n\n### Full Backup (Git) 🔁\nBashTower can create a **full backup** of your instance and store it in a Git repository. The backup is written to a dedicated `backup` branch and includes:\n\n- Templates (scripts in `scripts/`), plus a `bashtower_backup.json` manifest and a `README.md` with statistics\n- Hosts and Host Groups\n- Cron jobs (with template and key mapping)\n- SSH keys (private keys are excluded by default; can be included if you opt in)\n- Users (password hashes excluded by default; can be included if you opt in)\n- Application settings (AI config, `auth_disabled`, `cron_history_limit`); API keys included only when sensitive data option is enabled\n\nSecurity note: sensitive data (SSH private keys, user passwords, API keys, Satellite passwords) are **excluded by default**. Enable the **Include Sensitive Data** option in the UI to include them (only do this for private repositories you fully control).\n\nYou can also restore a full backup from the `backup` branch via the Git Sync UI. When restoring you may choose to overwrite existing data (be cautious; this can modify current hosts, templates, cron jobs, SSH keys and users).\n\n### User Experience\n| Feature | Description |\n|---------|-------------|\n| 🎨 **Modern UI** | Clean, responsive interface with Tailwind CSS |\n| 🔐 **User Authentication** | Multi-user support with admin roles |\n| 📱 **Mobile Friendly** | Responsive design works on any device |\n| 🐳 **Docker Ready** | One-command deployment with Docker |\n\n---\n\n## 📋 Table of Contents\n\n- [Quick Start](#-quick-start)\n- [Installation](#-installation)\n- [Configuration](#-configuration)\n- [Usage Guide](#-usage-guide)\n- [API Reference](#-api-reference)\n- [Architecture](#-architecture)\n- [Contributing](#-contributing)\n- [License](#-license)\n\n---\n\n## ⚡ Quick Start\n\n### Using Docker (Recommended)\n\n#### Docker Hub\n\n```bash\n# pull and run from Docker Hub\ndocker run -d \\\n  --name bashtower \\\n  -p 1008:1008 \\\n  -v bashtower_data:/app/instance \\\n  ftsiadimos/bashtower\n\n# access at http://localhost:1008\n```\n\n#### GitHub Container Registry (GHCR)\n\n```bash\n# pull and run from GHCR\ndocker run -d \\\n  --name bashtower \\\n  -p 1008:1008 \\\n  -v bashtower_data:/app/instance \\\n  ghcr.io/ftsiadimos/bashtower:latest\n\n# access at http://localhost:1008\n```\n\n\u003e **Note:** both the Docker Hub and GHCR images are built from the **same codebase** and are published/synced at the same time. You can safely use either registry interchangeably.\n\n\n\u003e ⚠️ **Default Login:**  \n\u003e **Username:** `admin`  \n\u003e **Password:** `admin`  \n\u003e  \n\u003e **Important:** You will be prompted to change the password on first login.  \n\u003e  \n\n\n### Using Docker Compose\n\n```yaml\nversion: '3.8'\nservices:\n  bashtower:\n  # You can use either image from Docker Hub or GitHub Container Registry (GHCR):\n  # image: ftsiadimos/bashtower\n  # or\n  # image: ghcr.io/ftsiadimos/bashtower:latest\n    image: ftsiadimos/bashtower\n    container_name: bashtower\n    ports:\n      - \"1008:1008\"\n    volumes:\n      - ./instance:/app/instance\n    restart: unless-stopped\n```\n\n```bash\ndocker-compose up -d\n```\n\n---\n\n## 📦 Installation\n\n### Prerequisites\n\n- Python 3.9+ (for local installation)\n- Docker Engine (for containerized deployment)\n- SSH access to target hosts\n\n\n### Option 1: Local Installation\n\n```bash\n# Clone the repository\ngit clone https://github.com/ftsiadimos/BashTower.git\ncd BashTower\n\n# Create virtual environment\npython -m venv venv\nsource venv/bin/activate  # On Windows: venv\\Scripts\\activate\n\n# Install dependencies\npip install -r requirements.txt\n\n# Run the application\nflask run --host=0.0.0.0 --port=1008\n```\n\n### Option 2: Development Setup\n\n```bash\n# Clone and setup\ngit clone https://github.com/ftsiadimos/BashTower.git\ncd BashTower\npython -m venv venv\nsource venv/bin/activate\npip install -r requirements.txt\n\n# Run in debug mode\nFLASK_DEBUG=1 flask run --host=0.0.0.0 --port=5000\n```\n\n---\n\n## ⚙️ Configuration\n\n### Environment Variables\n\n| Variable | Description | Default |\n|----------|-------------|---------|\n| \\`FLASK_SECRET_KEY\\` | Flask session secret key | Auto-generated |\n| \\`BASHTOWER_SECRET_KEY\\` | Encryption key for SSH keys \u0026 API keys | Built-in default |\n| \\`DATABASE_URL\\` | Database connection string | \\`sqlite:///instance/bashtower.db\\` |\n\n### Security Recommendations\n\nFor production deployments:\n\n```bash\n# Generate secure keys\nexport FLASK_SECRET_KEY=\\$(python -c \"import secrets; print(secrets.token_hex(32))\")\nexport BASHTOWER_SECRET_KEY=\\$(python -c \"from cryptography.fernet import Fernet; print(Fernet.generate_key().decode())\")\n```\n\n---\n\n## 📖 Usage Guide\n\n### 1. Initial Setup\n\n1. **Access the UI** at \\`http://localhost:1008\\`\n2. **Create an admin account** on first login\n3. **Add SSH Keys** in the Keys section (RSA, Ed25519, or ECDSA)\n4. **Add Hosts** with their connection details\n\n### 2. Managing Hosts\n\n```\nHosts → Add Host\n├── Name: friendly display name\n├── Hostname: IP address or FQDN\n├── Username: SSH user\n└── Port: SSH port (default: 22)\n```\n\n**Host Groups**: Organize hosts into groups for bulk operations (e.g., \"Web Servers\", \"Databases\")\n\n### 3. Creating Templates\n\nNavigate to **Templates** and create reusable scripts:\n\n**Basic Bash Script Example:**\n```bash\n#!/bin/bash\necho \"System Info for \\$(hostname)\"\necho \"==========================\"\nuname -a\ndf -h\nfree -m\n```\n\n**Dynamic Script with Arguments:**\n```bash\n#!/bin/bash\necho \"Server: {{server_name}}\"\necho \"Environment: {{environment}}\"\necho \"Testing port {{port}}...\"\nnc -z localhost {{port}} \u0026\u0026 echo \"Port {{port}} is open\" || echo \"Port {{port}} is closed\"\n```\n\n**Python Script Example:**\n```python\n#!/usr/bin/env python3\nimport platform\nimport psutil\n\nprint(f\"System: {platform.system()}\")\nprint(f\"CPU Usage: {psutil.cpu_percent()}%\")\nprint(f\"Memory: {psutil.virtual_memory().percent}%\")\n```\n\n**Creating Dynamic Templates:**\n1. Click **\"Add Argument\"** to define script parameters\n2. Configure each argument:\n   - **Variable Name**: Used as `{{variable_name}}` in your script\n   - **Label**: User-friendly display name\n   - **Type**: text, password, number, or select\n   - **Required**: Whether the argument is mandatory\n   - **Default Value**: Pre-filled value for convenience\n   - **Description**: Help text for users\n3. Use `{{argument_name}}` placeholders anywhere in your script\n4. Arguments will be prompted for when executing the template\n\n### 4. Running Scripts\n\n1. Go to **Dashboard**\n2. Select a **Template** (with Bash/Python indicator)\n3. **Fill in Script Arguments** (if the template has dynamic parameters)\n4. Choose **Target**: Host Groups or Individual Hosts\n5. Select an **SSH Key**\n6. Click **Launch Script**\n7. Monitor real-time output in the terminal view\n\n**Script Arguments**: Templates with dynamic arguments will display an arguments section where you can:\n- Fill in required parameters (marked with *)\n- Override default values\n- See descriptions for each argument\n- Use different values for different environments\n\n### 5. Scheduling Cron Jobs\n\n1. Navigate to **Cron Jobs**\n2. Click **Create Cron Job**\n3. Configure:\n   - **Name**: Job identifier\n   - **Template**: Script to run\n   - **Schedule**: Cron expression (e.g., \\`0 2 * * *\\` for daily at 2 AM)\n   - **Targets**: Hosts or groups\n   - **SSH Key**: Authentication key\n4. Enable and save\n\n**Common Cron Expressions:**\n| Expression | Schedule |\n|------------|----------|\n| \\`* * * * *\\` | Every minute |\n| \\`0 * * * *\\` | Every hour |\n| \\`0 0 * * *\\` | Daily at midnight |\n| \\`0 2 * * *\\` | Daily at 2:00 AM |\n| \\`0 0 * * 0\\` | Weekly on Sunday |\n| \\`0 0 1 * *\\` | Monthly on the 1st |\n\n### 6. AI Integration (Optional)\n\nConfigure AI in **Settings** for:\n\n- **Error Analysis**: Get intelligent troubleshooting suggestions\n- **Script Generation**: Describe what you need, AI writes the script\n\n**Supported Providers:**\n- OpenAI (GPT-3.5, GPT-4)\n- Google Gemini\n- Ollama (self-hosted, free)\n\n### 7. Red Hat Satellite Sync\n\nIf you have a Satellite instance:\n\n1. Go to **Satellite** page\n2. Enter Satellite URL and credentials\n3. Click **Sync Hosts**\n4. Hosts are automatically imported with their details\n\n---\n\n## 🔌 API Reference\n\nBashTower provides a RESTful API for automation:\n\n### Authentication\n```bash\nPOST /api/auth/login\nContent-Type: application/json\n\n{\"username\": \"admin\", \"password\": \"secret\"}\n```\n\n### Templates\n```bash\n# List all templates\nGET /api/templates\n\n# Create template with arguments\nPOST /api/templates\n{\n  \"name\": \"My Dynamic Script\", \n  \"script\": \"#!/bin/bash\\necho \\\"Hello {{name}}!\\\"\\necho \\\"Environment: {{env}}\\\"\", \n  \"script_type\": \"bash\",\n  \"arguments\": \"[{\\\"name\\\":\\\"name\\\",\\\"label\\\":\\\"Your Name\\\",\\\"type\\\":\\\"text\\\",\\\"required\\\":true},{\\\"name\\\":\\\"env\\\",\\\"label\\\":\\\"Environment\\\",\\\"type\\\":\\\"text\\\",\\\"default_value\\\":\\\"production\\\"}]\"\n}\n\n# Run template with arguments\nPOST /api/run\n{\n  \"template_id\": 1, \n  \"host_ids\": [1, 2], \n  \"key_id\": 1,\n  \"arguments\": {\"name\": \"John\", \"env\": \"staging\"}\n}\n```\n\n### Hosts\n```bash\n# List hosts\nGET /api/hosts\n\n# Create host\nPOST /api/hosts\n{\"name\": \"Server1\", \"hostname\": \"192.168.1.10\", \"username\": \"root\", \"port\": 22}\n```\n\n### Jobs\n```bash\n# Get job history\nGET /api/jobs\n\n# Get job details\nGET /api/jobs/{id}\n```\n\n---\n\n## 🏗️ Architecture\n\n```\n┌─────────────────────────────────────────────────────────────┐\n│                        Browser                              │\n│                   (Vue.js 3 + Tailwind)                     │\n└─────────────────────────┬───────────────────────────────────┘\n                          │ HTTP/REST\n                          ▼\n┌─────────────────────────────────────────────────────────────┐\n│                    Flask Application                        │\n│  ┌─────────────┐  ┌─────────────┐  ┌─────────────────────┐  │\n│  │   Routes    │  │  Services   │  │    APScheduler      │  │\n│  │  /api/*     │  │  SSH Exec   │  │   (Cron Jobs)       │  │\n│  └─────────────┘  └─────────────┘  └─────────────────────┘  │\n│                          │                                  │\n│  ┌───────────────────────────────────────────────────────┐  │\n│  │              SQLAlchemy ORM                           │  │\n│  │         (SQLite / PostgreSQL)                         │  │\n│  └───────────────────────────────────────────────────────┘  │\n└─────────────────────────┬───────────────────────────────────┘\n                          │ SSH (Paramiko)\n                          ▼\n┌─────────────────────────────────────────────────────────────┐\n│                     Remote Hosts                            │\n│         (Linux servers, VMs, containers, etc.)              │\n└─────────────────────────────────────────────────────────────┘\n```\n\n### Tech Stack\n\n| Layer | Technology |\n|-------|------------|\n| Frontend | Vue.js 3, Tailwind CSS, Font Awesome |\n| Backend | Flask 2.x, SQLAlchemy, APScheduler |\n| SSH | Paramiko |\n| Database | SQLite (default), PostgreSQL (optional) |\n| Encryption | Cryptography (Fernet/AES-256) |\n| Container | Docker, Gunicorn |\n\n---\n\n## 🤝 Contributing\n\nContributions are welcome! Here's how to get started:\n\n1. **Fork** the repository\n2. **Create** a feature branch\n   ```bash\n   git checkout -b feat/amazing-feature\n   ```\n3. **Make** your changes\n4. **Test** your changes\n   ```bash\n   pytest\n   flake8 .\n   ```\n5. **Commit** with a clear message\n   ```bash\n   git commit -m \"feat: add amazing feature\"\n   ```\n6. **Push** and open a Pull Request\n\n### Development Guidelines\n\n- Follow PEP 8 for Python code\n- Use meaningful commit messages (conventional commits preferred)\n- Add tests for new features\n- Update documentation as needed\n\n---\n\n## 📄 License\n\nThis project is licensed under the **GPL-3.0 License** - see the [LICENSE](LICENSE) file for details.\n\n---\n\n## 🙏 Acknowledgments\n\n- [Flask](https://flask.palletsprojects.com/) - Web framework\n- [Vue.js](https://vuejs.org/) - Frontend framework\n- [Tailwind CSS](https://tailwindcss.com/) - CSS framework\n- [Paramiko](https://www.paramiko.org/) - SSH library\n- [APScheduler](https://apscheduler.readthedocs.io/) - Job scheduling\n\n---\n\n\u003cp align=\"center\"\u003e\n  Made with ❤️ by \u003ca href=\"https://github.com/ftsiadimos\"\u003eftsiadimos\u003c/a\u003e\n\u003c/p\u003e\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fftsiadimos%2Fbashtower","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fftsiadimos%2Fbashtower","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fftsiadimos%2Fbashtower/lists"}