{"id":34948688,"url":"https://github.com/boringcache/services","last_synced_at":"2026-05-22T15:39:46.037Z","repository":{"id":325990005,"uuid":"1103310644","full_name":"boringcache/services","owner":"boringcache","description":"Deploy infrastructure services (Memcached, Redis, HAProxy, Nginx) to servers with Ruby and SSH","archived":false,"fork":false,"pushed_at":"2025-11-24T17:50:48.000Z","size":27,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2025-11-28T06:16:04.296Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Ruby","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/boringcache.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":"CONTRIBUTING.md","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-11-24T17:46:46.000Z","updated_at":"2025-11-24T17:50:51.000Z","dependencies_parsed_at":"2025-11-29T01:01:07.184Z","dependency_job_id":null,"html_url":"https://github.com/boringcache/services","commit_stats":null,"previous_names":["boringcache/services"],"tags_count":null,"template":false,"template_full_name":null,"purl":"pkg:github/boringcache/services","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/boringcache%2Fservices","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/boringcache%2Fservices/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/boringcache%2Fservices/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/boringcache%2Fservices/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/boringcache","download_url":"https://codeload.github.com/boringcache/services/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/boringcache%2Fservices/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":33349860,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-21T12:23:38.849Z","status":"online","status_checked_at":"2026-05-22T02:00:06.671Z","response_time":265,"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":[],"created_at":"2025-12-26T20:57:13.371Z","updated_at":"2026-05-22T15:39:46.032Z","avatar_url":"https://github.com/boringcache.png","language":"Ruby","funding_links":[],"categories":[],"sub_categories":[],"readme":"# BoringServices\n\nDeploy infrastructure services (Memcached, Redis, HAProxy, Nginx) to servers with Ruby and SSH. No Ansible, no Python, no Kubernetes.\n\nWorks standalone with any Ruby application or integrates seamlessly with Rails.\n\n## Features\n\n- **Memcached** - In-memory caching with configurable parameters\n- **Redis** - Key-value store and cache\n- **HAProxy** - Load balancer with SSL/TLS support\n- **Nginx** - Web server and reverse proxy\n- **Simple Configuration** - YAML files with environment support\n- **Flexible Overrides** - Custom config templates or parameter overrides\n- **Secret Management** - Environment variables or command execution\n- **SSH Deployment** - Direct deployment to Ubuntu servers\n- **Health Checks** - Monitor service status across hosts\n- **VPN Support** - Optional private_ip field for VPN/WireGuard deployments\n- **Rails Integration** - Generators, rake tasks, and seamless integration\n- **Standalone Support** - Works with any Ruby application\n\n## Quick Start\n\n### Standalone\n\n```bash\ngem install boring_services\nboringservices setup\nboringservices status\n\n# Target a different config/environment\nBORING_SERVICES_CONFIG=config/services.staging.yml \\\nBORING_SERVICES_ENV=staging boringservices setup\n```\n\n### Rails Integration\n\n```ruby\n# Gemfile\ngem 'boring_services'\n```\n\n```bash\n# Generate config\nrails generate boring_services:install\n\n# Deploy services\nrails boring_services:setup\n\n# Deploy using a different config/environment\nBORING_SERVICES_CONFIG=config/services.staging.yml BORING_SERVICES_ENV=staging \\\n  rails boring_services:setup\n\n# Check health\nrails boring_services:health\n```\n\n## Configuration\n\nCreate `config/services.yml`:\n\n```yaml\nproduction:\n  user: ubuntu\n  ssh_key: ~/.ssh/id_rsa\n  forward_agent: true\n  use_ssh_agent: false\n  ssh_auth_methods:\n    - publickey\n\n  services:\n    - name: memcached\n      enabled: true\n      hosts:\n        - host: 10.8.0.20\n          label: cache-a\n        - host: 10.8.0.21\n          label: cache-b\n      port: 11211\n      memory_mb: 256\n\n    - name: redis\n      enabled: true\n      host: 10.8.0.22\n      port: 6379\n      memory_mb: 1024\n\n    - name: haproxy\n      enabled: true\n      hosts:\n        - 10.8.0.30\n      port: 80\n      stats_port: 8404\n      backends:\n        - host: 10.8.0.10\n          port: 3000\n        - host: 10.8.0.11\n          port: 3000\n\n  secrets:\n    redis_password: $REDIS_PASSWORD\n```\n\nUse `host:` for a single target or `hosts:` for multiple VMs. When using `hosts`, each entry can be a simple hostname/IP or a hash with per-host overrides (e.g., `label`, `port`, or `memory_mb`).\n\n### Service Options\n\n#### Memcached\n\n**Basic Configuration:**\n\n```yaml\n- name: memcached\n  enabled: true\n  hosts:\n    - 10.8.0.20\n  port: 11211         # Default: 11211\n  memory_mb: 256      # Memory allocation in MB\n```\n\n**With Custom Parameters:**\n\n```yaml\n- name: memcached\n  enabled: true\n  host: 10.8.0.20\n  port: 11211\n  memory_mb: 512\n  custom_params:\n    listen_address: 0.0.0.0      # Default: 0.0.0.0\n    max_connections: 2048         # Default: 1024\n    max_item_size: 2m             # Optional: max item size\n    verbosity: 2                  # Optional: 0-3 for debug output\n```\n\n**With Custom Config Template:**\n\n```yaml\n- name: memcached\n  enabled: true\n  host: 10.8.0.20\n  custom_config_template: config/memcached.custom.conf  # Path to custom config file\n```\n\n#### Redis\n\n```yaml\n- name: redis\n  enabled: true\n  hosts:\n    - 10.8.0.21\n  port: 6379          # Default: 6379\n  memory_mb: 512      # Memory allocation\n```\n\nOptional password protection via secrets:\n\n```yaml\nsecrets:\n  redis_password: $REDIS_PASSWORD\n```\n\n#### HAProxy\n\n**Basic HTTP Load Balancer:**\n\n```yaml\n- name: haproxy\n  enabled: true\n  host: 10.8.0.30\n  port: 80            # Frontend port\n  stats_port: 8404    # Stats dashboard port\n  backends:\n    - host: 10.8.0.10\n      port: 3000\n    - host: 10.8.0.11\n      port: 3000\n```\n\n**HTTPS with SSL Termination:**\n\n```yaml\n- name: haproxy\n  enabled: true\n  host: 34.123.78.90\n  port: 80                # Redirects to HTTPS\n  https_port: 443         # SSL/TLS port\n  stats_port: 8404\n  ssl: true\n  ssl_cert: $(op read \"op://MyVault/haproxy-ssl/certificate\")\n  ssl_key: $(op read \"op://MyVault/haproxy-ssl/private_key\")\n  backends:\n    - host: 192.168.1.10\n      port: 3000\n    - host: 192.168.1.11\n      port: 3000\n```\n\n**With Custom Parameters:**\n\n```yaml\n- name: haproxy\n  enabled: true\n  host: 10.8.0.30\n  port: 80\n  stats_port: 8404\n  custom_params:\n    timeout_connect: 10000        # Default: 5000ms\n    timeout_client: 60000          # Default: 50000ms\n    timeout_server: 60000          # Default: 50000ms\n    balance: leastconn             # Default: roundrobin\n    health_check_path: /healthz    # Default: /health\n    ssl_ciphers: CUSTOM_CIPHERS    # Custom SSL cipher suite\n    ssl_options: no-sslv3          # Custom SSL options\n  backends:\n    - host: 10.8.0.10\n      port: 3000\n```\n\n**With Custom Config Template:**\n\n```yaml\n- name: haproxy\n  enabled: true\n  host: 10.8.0.30\n  custom_config_template: config/haproxy.custom.cfg  # Path to custom HAProxy config\n  # Note: When using custom template, most other options are ignored\n```\n\n**SSL Certificate Options:**\n\n```yaml\n# Option 1: 1Password CLI\nssl_cert: $(op read \"op://MyVault/haproxy-ssl/certificate\")\nssl_key: $(op read \"op://MyVault/haproxy-ssl/private_key\")\n\n# Option 2: Environment variables\nssl_cert: $HAPROXY_SSL_CERT\nssl_key: $HAPROXY_SSL_KEY\n\n# Option 3: Rails credentials (Rails only)\nssl_cert: $(rails credentials:show | yq .haproxy.ssl.cert)\nssl_key: $(rails credentials:show | yq .haproxy.ssl.key)\n\n# Option 4: Local files\nssl_cert: $(cat /path/to/cert.pem)\nssl_key: $(cat /path/to/key.pem)\n```\n\n**HAProxy Features:**\n- ✅ **Config Validation** - Automatically validates HAProxy config before applying\n- ✅ **SSL/TLS Support** - Automatic HTTPS setup with certificate management\n- ✅ **Self-Signed Fallback** - Generates self-signed cert if none provided\n- ✅ **HTTP → HTTPS Redirect** - Automatic redirect when SSL is enabled\n- ✅ **Health Checks** - Configurable health check endpoint (default: GET /health)\n- ✅ **Stats Dashboard** - Access at `http://your-host:8404/`\n- ✅ **Custom Overrides** - Override timeouts, balance algorithms, SSL ciphers\n- ✅ **Custom Templates** - Bring your own HAProxy config file\n\n#### Nginx\n\n```yaml\n- name: nginx\n  enabled: true\n  hosts:\n    - 10.8.0.40\n  port: 80\n  ssl: true           # Enable HTTPS on port 443\n  backends:\n    - host: 10.8.0.10\n      port: 3000\n```\n\n## CLI Commands\n\n### Install Services\n\n```bash\nboringservices install\n\nboringservices install redis\n\nboringservices install -e staging\n```\n\n### Check Status\n\n```bash\nboringservices status\n\nboringservices status -e production\n```\n\n### Restart Services\n\n```bash\nboringservices restart redis\n\nboringservices restart haproxy -e staging\n```\n\n### Uninstall Services\n\n```bash\nboringservices uninstall memcached\n```\n\n## Rails Integration\n\nAdd to your `Gemfile`:\n\n```ruby\ngem 'boring_services'\n```\n\nGenerate configuration:\n\n```bash\nrails generate boring_services:install\n# Creates config/services.yml\n\nrails boring_services:setup\n# Deploys all enabled services\n```\n\nUse services in your Rails app:\n\n```ruby\nRails.application.configure do\n  # Connect to Memcached\n  config.cache_store = :mem_cache_store, '10.8.0.20:11211', '10.8.0.21:11211'\n\n  # Connect to Redis for sessions\n  config.session_store :redis_store,\n    servers: ['redis://10.8.0.22:6379/0/session'],\n    expire_after: 90.minutes\nend\n```\n\n**Available Rake Tasks:**\n\n```bash\nrails boring_services:setup      # Deploy all services\nrails boring_services:health     # Check service health\nrails boring_services:status     # Show service status\nrails boring_services:restart    # Restart all services\n```\n\n## Secrets Management\n\nUse environment variables or command execution:\n\n```yaml\nsecrets:\n  # Option 1: Environment variable\n  redis_password: $REDIS_PASSWORD\n\n  # Option 2: 1Password CLI\n  redis_password: $(op read \"op://MyVault/redis/password\")\n\n  # Option 3: Rails credentials (Rails only)\n  redis_password: $(rails credentials:show | yq .redis.password)\n\n  # Option 4: File-based secrets\n  redis_password: $(cat .secrets/redis_password)\n```\n\n## VPN/Private Network Support\n\nBoringServices supports deploying services over VPN or private networks (e.g., WireGuard, Tailscale):\n\n- **Public IPs** (`host`) for SSH deployment access\n- **Private IPs** (`private_ip`) for service communication\n- Services listen on all interfaces (0.0.0.0) by default\n- Accessible via private network IPs\n- No public exposure of services\n\n**Example with Private IPs:**\n\n```yaml\nservices:\n  - name: redis\n    host: 18.234.67.89        # ← Public IP for SSH deployment\n    private_ip: 10.8.0.32     # ← Private VPN IP for connections\n    label: us-east-1\n    port: 6379\n    memory_mb: 1024\n\n  - name: memcached\n    host: 51.15.214.103       # ← Public IP for SSH\n    private_ip: 10.8.0.61     # ← Private VPN IP\n    label: cache-eu\n    port: 11211\n    memory_mb: 256\n```\n\nYour application connects via the private IP:\n\n```ruby\n# Ruby/Rails app\nRedis.new(url: 'redis://10.8.0.32:6379')\n\n# Memcached\nDalli::Client.new('10.8.0.61:11211')\n```\n\nThe `private_ip` field is optional and purely for documentation - use it to track which IPs your application should connect to.\n\n## Health Monitoring\n\n```bash\nboringservices status\n```\n\nOutput:\n\n```\nmemcached: healthy\n  ✓ 10.8.0.20: running\n  ✓ 10.8.0.21: running\n\nredis: healthy\n  ✓ 10.8.0.22: running\n\nhaproxy: healthy\n  ✓ 10.8.0.30: running\n```\n\n## Requirements\n\n- Ruby 3.0+\n- Ubuntu 20.04+ servers (Debian-based distributions)\n- SSH key-based authentication\n- Optional: VPN solution (WireGuard, Tailscale, etc.) for private networking\n\n## Installation\n\n**Standalone Ruby:**\n\n```bash\ngem install boring_services\n```\n\n**With Bundler:**\n\n```ruby\n# Gemfile\ngem 'boring_services'\n```\n\nThen run:\n\n```bash\nbundle install\n```\n\n**For Rails projects**, the gem will automatically integrate with Rails and provide generators and rake tasks.\n\n## License\n\nMIT\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fboringcache%2Fservices","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fboringcache%2Fservices","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fboringcache%2Fservices/lists"}