Open Source Platform for DTC, B2B Commerce, Marketplaces & Omnichannel. REST APIs, TypeScript SDKs, and production-ready Next.js storefront. Self-host it. Own your data. No vendor lock-in. Zero platform fees.
Ruby b2b-commercee-commerceecommerceecommerce-apiecommerce-frameworkecommerce-platformheadlessheadless-commerceheadless-ecommercemarketplacemulti-tenantmulti-vendormulti-vendor-ecommerceopen-sourcespree-commerce
Renamed RAILS_HOST to SPREE_HOST in the deployment guides (#14760)
Damian Legawiece7a812cf5e97
diff --git a/docs/developer/deployment/aws.mdx b/docs/developer/deployment/aws.mdxindex 855b55a6c0..a94c3c04ec 100644--- a/docs/developer/deployment/aws.mdx+++ b/docs/developer/deployment/aws.mdx@@ -54,7 +54,7 @@ services:ACTIVE_RECORD_ENCRYPTION_PRIMARY_KEY: ...ACTIVE_RECORD_ENCRYPTION_DETERMINISTIC_KEY: ...ACTIVE_RECORD_ENCRYPTION_KEY_DERIVATION_SALT: ...- RAILS_HOST: store.example.com+ SPREE_HOST: store.example.com# Uploads to S3 (recommended) — see /developer/deployment/assets# AWS_REGION: eu-west-1# AWS_BUCKET: my-store-uploadsdiff --git a/docs/developer/deployment/cdn.mdx b/docs/developer/deployment/cdn.mdxindex 5fa365f3cf..fca95b7fcb 100644--- a/docs/developer/deployment/cdn.mdx+++ b/docs/developer/deployment/cdn.mdx@@ -50,4 +50,4 @@ The setup above caches on your primary domain and needs no extra configuration.CDN_HOST=cdn.example.com```-Static asset URLs and image/attachment URLs (including those in API responses) will then use this host instead of [`RAILS_HOST`](/developer/deployment/environment_variables#urls-and-hosts). Host only, no protocol — URLs keep the scheme of your primary host.\ No newline at end of file+Static asset URLs and image/attachment URLs (including those in API responses) will then use this host instead of [`SPREE_HOST`](/developer/deployment/environment_variables#urls-and-hosts). Host only, no protocol — URLs keep the scheme of your primary host.\ No newline at end of filediff --git a/docs/developer/deployment/docker.mdx b/docs/developer/deployment/docker.mdxindex fdc7b67ff1..b94b726383 100644--- a/docs/developer/deployment/docker.mdx+++ b/docs/developer/deployment/docker.mdx@@ -63,7 +63,7 @@ services:RAILS_ASSUME_SSL: "false"# Public host used in generated URLs (images/attachments in API# responses, email links) — set to your domain or IP in production.- RAILS_HOST: localhost:3000+ SPREE_HOST: localhost:3000ports:- "3000:3000"healthcheck:@@ -102,7 +102,7 @@ Background jobs run inside the web container by default. When job load deservesACTIVE_RECORD_ENCRYPTION_PRIMARY_KEY: change-meACTIVE_RECORD_ENCRYPTION_DETERMINISTIC_KEY: change-meACTIVE_RECORD_ENCRYPTION_KEY_DERIVATION_SALT: change-me- RAILS_HOST: localhost:3000+ SPREE_HOST: localhost:3000command: bin/jobs```@@ -113,7 +113,7 @@ Background jobs run inside the web container by default. When job load deserves| `DATABASE_URL` | PostgreSQL connection URL | `postgres://user:pass@host:5432/spree` || `SECRET_KEY_BASE` | Secret key for session encryption | Generate with `bin/rails secret` || `ACTIVE_RECORD_ENCRYPTION_PRIMARY_KEY`, `ACTIVE_RECORD_ENCRYPTION_DETERMINISTIC_KEY`, `ACTIVE_RECORD_ENCRYPTION_KEY_DERIVATION_SALT` | Keys Spree encrypts secrets at rest with — see [Active Record encryption](/developer/deployment/environment_variables#active-record-encryption). Never change them once data is encrypted | Generate with `spree encryption init --print` or `bin/rails db:encryption:init` |-| `RAILS_HOST` | Public host used in generated URLs — image/attachment URLs in API responses, email links | `store.example.com` |+| `SPREE_HOST` | Public host used in generated URLs — image/attachment URLs in API responses, email links | `store.example.com` || `SOLID_QUEUE_IN_PUMA` | Run background jobs inside the web container (default `true`); set `false` when running a dedicated worker | `true` |See [Environment Variables](/developer/deployment/environment_variables) for the full list.diff --git a/docs/developer/deployment/environment_variables.mdx b/docs/developer/deployment/environment_variables.mdxindex 587d276475..a1f020768b 100644--- a/docs/developer/deployment/environment_variables.mdx+++ b/docs/developer/deployment/environment_variables.mdx@@ -14,7 +14,7 @@ These two variables are all a production deployment strictly needs:| `DATABASE_URL` | Database connection URL — see [Database Configuration](/developer/deployment/database) | `postgres://user:pass@localhost:5432/spree` || `SECRET_KEY_BASE` | Secret used to encrypt sessions and cookies. Generate with `openssl rand -hex 64` | `2fad5c0b79d25e4765d3018d8c740f8c3a665f0e5c...` |-You'll almost always want to set [`RAILS_HOST`](#urls-and-hosts) too — without it, generated URLs point at `localhost`, and the three [Active Record encryption](#active-record-encryption) keys — without them, secrets Spree stores are kept in plain text.+You'll almost always want to set [`SPREE_HOST`](#urls-and-hosts) too — without it, generated URLs point at `localhost`, and the three [Active Record encryption](#active-record-encryption) keys — without them, secrets Spree stores are kept in plain text.## Active Record encryption@@ -73,16 +73,20 @@ Apps created from an older `spree-starter` also need `config/application.rb` to## URLs and Hosts-`RAILS_HOST` is the canonical public host of your deployment. URLs Spree generates outside a request context use it — links in emails, webhook payloads, and image/attachment URLs in API responses (for the latter, `CDN_HOST` takes precedence when set).+`SPREE_HOST` is the canonical public host of your deployment. URLs Spree generates outside a request context use it — links in emails, webhook payloads, and image/attachment URLs in API responses (for the latter, `CDN_HOST` takes precedence when set).++<Note>+ This setting used to be called `RAILS_HOST`. That name still works, so an existing deployment needs no change — `SPREE_HOST` wins when both are set.+</Note><Warning>-When neither `RAILS_HOST` nor `CDN_HOST` is configured, image and attachment URLs fall back to the store's URL setting, which is `localhost` on a fresh install — API responses will contain `https://localhost/...` URLs.+When neither `SPREE_HOST` nor `CDN_HOST` is configured, image and attachment URLs fall back to the store's URL setting, which is `localhost` on a fresh install — API responses will contain `https://localhost/...` URLs.</Warning>| Variable | Default | Description || --- | --- | --- |-| `RAILS_HOST` | — | Public host, optionally with a port — e.g. `store.example.com` or `203.0.113.7:8080`. Host only, no protocol. On [Render](/developer/deployment/render), falls back to the platform-provided `RENDER_EXTERNAL_HOSTNAME`. |-| `CDN_HOST` | — | Optional host for serving static assets and images, e.g. a CDN distribution in front of your app — see [CDN](/developer/deployment/cdn). Host only, no protocol. Falls back to `RAILS_HOST`. |+| `SPREE_HOST` | — | Public host, optionally with a port — e.g. `store.example.com` or `203.0.113.7:8080`. Host only, no protocol. On [Render](/developer/deployment/render), falls back to the platform-provided `RENDER_EXTERNAL_HOSTNAME`. |+| `CDN_HOST` | — | Optional host for serving static assets and images, e.g. a CDN distribution in front of your app — see [CDN](/developer/deployment/cdn). Host only, no protocol. Falls back to `SPREE_HOST`. |Generated URLs use `https` unless both `RAILS_FORCE_SSL` and `RAILS_ASSUME_SSL` are set to `false` (see [SSL](#ssl)).@@ -122,7 +126,7 @@ Spree works with any SMTP provider (Resend, Postmark, Mailgun, SendGrid, Amazon| `SMTP_PASSWORD` | — | SMTP auth password || `SMTP_FROM_ADDRESS` | — | Default "from" email address |-Links in emails use the host configured via [`RAILS_HOST`](#urls-and-hosts).+Links in emails use the host configured via [`SPREE_HOST`](#urls-and-hosts).## Applicationdiff --git a/docs/developer/deployment/render.mdx b/docs/developer/deployment/render.mdxindex 8278a81f0d..9ef8e47065 100644--- a/docs/developer/deployment/render.mdx+++ b/docs/developer/deployment/render.mdx@@ -41,7 +41,7 @@ The `/jobs` dashboard uses HTTP Basic auth: user `jobs`, with a password the BluRender sets `DATABASE_URL`, `SECRET_KEY_BASE` and the three [Active Record encryption](/developer/deployment/environment_variables#active-record-encryption) keys automatically from the Blueprint. Copy the encryption keys from the **Environment** tab into your secret manager as a backup — never change them once data is encrypted. For additional configuration (SMTP, file storage, Sentry, etc.), see [Environment Variables](/developer/deployment/environment_variables).-Generated URLs (images and attachments in API responses, email links) automatically use Render's `RENDER_EXTERNAL_HOSTNAME` (`<your-app-name>.onrender.com`). When you attach a custom domain, set [`RAILS_HOST`](/developer/deployment/environment_variables#urls-and-hosts) to it — it takes precedence.+Generated URLs (images and attachments in API responses, email links) automatically use Render's `RENDER_EXTERNAL_HOSTNAME` (`<your-app-name>.onrender.com`). When you attach a custom domain, set [`SPREE_HOST`](/developer/deployment/environment_variables#urls-and-hosts) to it — it takes precedence.## Scaling Out