{"id":24200052,"url":"https://github.com/s4tyendra/simple-server-hosting","last_synced_at":"2025-10-11T07:44:03.110Z","repository":{"id":259007188,"uuid":"876090582","full_name":"S4tyendra/simple-server-hosting","owner":"S4tyendra","description":"Simple Server Hosting is a web-based dashboard for managing and deploying applications on an Ubuntu server. It features automatic setup of virtual environments, Nginx configuration, real-time logs, terminal access, domain management, and easy application management from Git repositories.","archived":false,"fork":false,"pushed_at":"2025-10-04T15:57:24.000Z","size":34,"stargazers_count":3,"open_issues_count":1,"forks_count":0,"subscribers_count":1,"default_branch":"docker","last_synced_at":"2025-10-04T17:39:31.997Z","etag":null,"topics":["application-management","deployment","dns-checking","domain-management","git-repositories","html","management","nginx-configuration","python","python3","real-time-logs","server","terminal-access","ubuntu-server","virtual-environments","web-based-dashboard"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/S4tyendra.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}},"created_at":"2024-10-21T11:38:51.000Z","updated_at":"2025-09-01T18:53:11.000Z","dependencies_parsed_at":"2024-10-21T17:28:47.215Z","dependency_job_id":null,"html_url":"https://github.com/S4tyendra/simple-server-hosting","commit_stats":null,"previous_names":["s4tyendra/simple-server-hosting"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/S4tyendra/simple-server-hosting","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/S4tyendra%2Fsimple-server-hosting","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/S4tyendra%2Fsimple-server-hosting/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/S4tyendra%2Fsimple-server-hosting/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/S4tyendra%2Fsimple-server-hosting/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/S4tyendra","download_url":"https://codeload.github.com/S4tyendra/simple-server-hosting/tar.gz/refs/heads/docker","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/S4tyendra%2Fsimple-server-hosting/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":279006629,"owners_count":26084132,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-10-11T02:00:06.511Z","response_time":55,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"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":["application-management","deployment","dns-checking","domain-management","git-repositories","html","management","nginx-configuration","python","python3","real-time-logs","server","terminal-access","ubuntu-server","virtual-environments","web-based-dashboard"],"created_at":"2025-01-13T20:40:47.743Z","updated_at":"2025-10-11T07:44:03.102Z","avatar_url":"https://github.com/S4tyendra.png","language":"Python","readme":"# 🐳 Docker Manager Dashboard\n\nA slick web-based dashboard for managing Docker containers pulled from GitHub Container Registry (GHCR). Built with Hono + Bun for maximum speed, with automatic Nginx configuration, environment management, and real-time container monitoring.\n\nPerfect for managing your self-hosted infrastructure on IIIT Kota servers (or any Ubuntu/Debian box really).\n\n\u003e\n\u003e [!NOTE]\n\u003e  See [main branch](https://github.com/s4tyendra/simple-server-hosting/tree/main) for non docker and general hosting manager\n\n---\n\u003e [!WARNING]\n\u003e  This repo is highly customized to use with iiitkota servers and infra structure. if you want to use for your apps, please change domain and folder names.\n## ✨ Features\n\n→ **GHCR Integration**: Auto-discover and pull images from `web-iiitkota` organization  \n→ **Docker Compose Automation**: Generate and manage compose files with resource limits  \n→ **Nginx Auto-Config**: Set up reverse proxy mappings with custom domains (`.iiitkota.ac.in`)  \n→ **Environment Management**: Edit `.env` files directly from the UI  \n→ **Real-time Logs**: Stream container logs with live updates  \n→ **Resource Control**: Set CPU/memory limits, restart policies, port mappings  \n→ **Update Detection**: Shows when newer image versions are available  \n→ **Beautiful UI**: Dark/light theme with glassmorphic cards and smooth animations\n\n---\n\n## 📋 Prerequisites\n\n- **OS**: Ubuntu/Debian (tested on Ubuntu Server)\n- **Runtime**: [Bun](https://bun.sh) (for running the app)\n- **Docker**: Docker Engine + Docker Compose v2\n- **Nginx**: For reverse proxy (optional but recommended)\n- **Sudo Access**: Required for Nginx reloads and container management\n\n---\n\n## 🚀 Installation\n\n### 1️⃣ Install Bun\n```bash\ncurl -fsSL https://bun.sh/install | bash\n```\n\n### 2️⃣ Clone the Repo\n```bash\ngit clone https://github.com/s4tyendra/simple-server-hosting.git\ncd simple-server-hosting\ngit checkout docker  # Switch to docker branch\n```\n\n### 3️⃣ Install Dependencies\n```bash\nbun install\n```\n\n### 4️⃣ Set Environment Variables\nCreate a `.env` file or export these:\n\n```bash\nexport GITHUB_PAT=\"ghp_your_github_personal_access_token\"\nexport AUTH_USERNAME=\"admin\"\nexport AUTH_PASSWORD=\"your_secure_password\"\nexport PORT=\"8080\"\n```\n\n**Getting a GitHub PAT:**\n1. Go to GitHub → Settings → Developer Settings → Personal Access Tokens\n2. Generate a new token (classic) with `read:packages` scope\n3. Copy and use it as `GITHUB_PAT`\n\n---\n\n## 🏃 Running the App\n\n### Development Mode\n```bash\nbun run index.ts\n```\n\n### Production Mode (with sudo for Nginx control)\n```bash\nsudo -E bun run index.ts\n# The -E flag preserves environment variables\n```\n\nOr use a process manager like PM2:\n```bash\nsudo pm2 start index.ts --interpreter bun --name docker-manager\n```\n\nAccess at: `http://localhost:8080` (or your configured port)\n\n---\n\n## ⚙️ Nginx Setup (Optional but Recommended)\n\nThe app can automatically manage Nginx configs for your containers. Here's the base setup:\n\n### 1️⃣ Create the main config file\n```bash\nsudo nano /etc/nginx/sites-available/iiit-apis\n```\n\nAdd this base config:\n```nginx\n# This file is managed by Docker Manager\n# Individual server blocks are auto-generated\n\n# Include SSL certificate config\n# (Assuming you have SSL set up with Let's Encrypt or similar)\n```\n\n### 2️⃣ Enable it\n```bash\nsudo ln -s /etc/nginx/sites-available/iiit-apis /etc/nginx/sites-enabled/\nsudo nginx -t\nsudo systemctl reload nginx\n```\n\n### 3️⃣ Give the app write permissions\n```bash\nsudo chown $USER:$USER /etc/nginx/sites-available/iiit-apis\n```\n\nOr run the app with sudo (it needs sudo for `nginx -t` and `systemctl reload nginx` anyway).\n\n---\n\n## 🎯 Usage Guide\n\n### Creating a New Container\n\n1. **Pull/Update Image**: Click \"🔄 Update/Pull\" to fetch the latest image from GHCR\n2. **Configure Settings**: \n   - Set **Host Port** (external) and **Container Port** (internal)\n   - Add **Environment Variables** (format: `KEY=value`)\n   - Set **Resource Limits** (CPU, Memory)\n   - Configure **Restart Policy**\n3. **Optional - Add Domain**: \n   - Enter a subdomain (e.g., `api`) to get `api.iiitkota.ac.in`\n   - Set **Client Max Body Size** for uploads\n4. **Start Container**: Click \"🚀 Start\" to create and run the container\n\n### Managing Running Containers\n\n- **🔄 Restart**: Restart the container\n- **⏹️ Stop**: Stop the container (doesn't remove it)\n- **📄 Logs**: View real-time container logs\n- **🗑️ Remove**: Delete the container (image stays)\n\n### Updating Containers\n\n1. Pull the new image version (it'll show \"update_available\" status)\n2. Open **Environment \u0026 Configuration** section\n3. Click **💾 Save \u0026 Recreate Container**\n4. This stops, removes, and recreates the container with new image + settings\n\n### Editing Nginx Directly\n\nClick **⚡ Nginx** button → Edit the config → **💾 Save, Test \u0026 Reload**\n\nThe app will:\n1. Backup the old config\n2. Write your changes\n3. Run `sudo nginx -t` to test\n4. Reload Nginx if test passes\n5. Restore backup if test fails\n\n---\n\n## 📁 Project Structure\n\n```\n~/.dckr/\n└── env/\n    └── \u003cservice-name\u003e/\n        ├── .env                    # Environment variables\n        ├── config.json             # Resource limits \u0026 settings\n        └── docker-compose.yml      # Auto-generated compose file\n```\n\n---\n\n## 🔐 Security Notes\n\n⚠️ **This app requires sudo access** for:\n- Nginx testing and reloading\n- Docker operations (if not in docker group)\n\n🛡️ Recommendations:\n- Use strong passwords for basic auth\n- Keep `GITHUB_PAT` secure (read-only scope)\n- Run behind a firewall (only expose port 443 publicly)\n- Use SSL/TLS in production (Let's Encrypt)\n- Restrict `~/.dckr/env/` directory permissions\n\n---\n\n## 🐛 Troubleshooting\n\n### \"Permission denied\" when managing containers\n→ Add your user to the docker group:\n```bash\nsudo usermod -aG docker $USER\nnewgrp docker\n```\n\n### Nginx test fails but config looks correct\n→ Check for duplicate `server_name` directives:\n```bash\nsudo nginx -T | grep server_name\n```\n\n### Container won't start\n→ Check logs in the UI or via:\n```bash\ndocker logs \u003ccontainer-name\u003e\n```\n\n### Domain not resolving\n→ Verify DNS A record points to your server IP:\n```bash\ndig +short subdomain.iiitkota.ac.in\n```\n\n---\n\n## 🤝 Contributing\n\nFound a bug? Want a feature? PRs are welcome!\n\n1. Fork the repo\n2. Create your feature branch (`git checkout -b feature/cool-thing`)\n3. Commit changes (`git commit -m 'Add cool thing'`)\n4. Push to branch (`git push origin feature/cool-thing`)\n5. Open a PR\n\n---\n\n## 📝 License\n\nMIT License - do whatever you want with it, I'm not even including License file!\n\n---\n\n## 💬 Support\n\nIssues? Questions? Open an issue on GitHub or reach out at [satya@satyendra.in](mailto:satya@satyendra.in)\n\nBuilt with 💙 for IIIT Kota infrastructure by [@s4tyendra](https://github.com/s4tyendra)\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fs4tyendra%2Fsimple-server-hosting","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fs4tyendra%2Fsimple-server-hosting","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fs4tyendra%2Fsimple-server-hosting/lists"}