Checklists

Ruby on Rails implementation checklist

This checklist outlines the technical requirements for deploying a Rails 8 application to production, specifically focusing on Kamal deployment, Hotwire patterns, and the Solid suite for background processing.

Progress0 / 25 complete (0%)

Environment & Configuration

0/5
  • Master Key Management

    critical

    Verify RAILS_MASTER_KEY is present in the production environment and not committed to version control.

  • Force SSL

    critical

    Set config.force_ssl = true in production.rb to ensure all traffic is encrypted and HSTS is enabled.

  • Canonical Host Redirection

    recommended

    Configure middleware or load balancer to redirect non-www to www (or vice versa) to prevent session fragmentation.

  • Logger Configuration

    recommended

    Set config.log_level to :info and use ActiveSupport::TaggedLogging to include request IDs in logs.

  • Secret Key Base

    critical

    Ensure SECRET_KEY_BASE is generated uniquely for production to secure cookie-based sessions.

Database & Background Jobs

0/5
  • Connection Pool Sizing

    critical

    Match the database pool size in database.yml to the sum of RAILS_MAX_THREADS and the concurrency level of background workers.

  • Solid Queue Configuration

    critical

    Verify that config.active_job.queue_adapter is set to :solid_queue and the database has the required schema migrations.

  • Database Backups

    critical

    Confirm automated daily snapshots and WAL-G or similar point-in-time recovery is active for the production database.

  • Prepared Statements

    recommended

    Disable prepared statements in database.yml if using a connection pooler like PgBouncer in transaction mode.

  • Solid Cache Setup

    recommended

    Verify config.cache_store is set to :solid_cache_store and the dedicated cache table is indexed.

Deployment with Kamal

0/5
  • Health Check Endpoint

    critical

    Ensure the /up endpoint returns a 200 OK and is correctly referenced in the deploy.yml healthcheck section.

  • Registry Authentication

    critical

    Verify KAMAL_REGISTRY_PASSWORD is set in the local .env file and the deployer has push access to the Docker registry.

  • Asset Precompilation

    critical

    Confirm the Dockerfile includes 'RUN bundle exec rails assets:precompile' and all build arguments for CSS/JS are passed.

  • Multi-arch Builds

    recommended

    Configure buildx in deploy.yml if the deployment target architecture (e.g., ARM64) differs from the CI/CD runner.

  • Remote Environment Variables

    recommended

    Use the 'env: clear' and 'env: secret' blocks in deploy.yml to separate public config from sensitive credentials.

Security & Rate Limiting

0/5
  • Rack Attack Implementation

    critical

    Configure the rack-attack gem to throttle login attempts by IP and prevent brute-force attacks on /users/sign_in.

  • Content Security Policy (CSP)

    recommended

    Define a strict CSP in initializers/content_security_policy.rb to prevent XSS, specifically allowing Stimulus and Turbo origins.

  • Dependency Audit

    critical

    Run 'bundle audit' and 'npm audit' to identify and patch known vulnerabilities in gems and node modules.

  • Permission Policy

    optional

    Configure the Permissions-Policy header to disable unused browser features like camera, microphone, and geolocation.

  • Secure Cookies

    critical

    Ensure config.ssl_options = { hsts: true, subdomains: true } is active to prevent session hijacking.

Monitoring & Resilience

0/5
  • Error Tracking Integration

    critical

    Install and verify an error reporting client (Sentry, Honeybadger, or AppSignal) for the production environment.

  • Log Aggregation

    recommended

    Verify that Docker logs are being forwarded to a centralized logging service for post-deployment analysis.

  • Uptime Monitoring

    critical

    Configure an external service to ping the /up endpoint every 60 seconds and alert on failure.

  • Memory Usage Profiling

    recommended

    Set up jemalloc in the Dockerfile to reduce memory fragmentation and prevent OOM kills on small VPS instances.

  • Disk Space Alerts

    recommended

    Ensure monitoring is in place for the host machine's disk space, specifically for Docker image pruning and database growth.