Configure

Variables

Per resource, on the Variables tab. Add one at a time, or open the raw editor and paste a whole .env (that replaces the entire set). Values are encrypted at rest and masked in the UI.

References — the important part. A value may point at another resource's variable:

DATABASE_URL=${{postgres.DATABASE_URL}}
API_KEY=${{api.SERVICE_TOKEN}}

Pick them from Add Reference rather than typing: the menu lists every variable each other resource exposes. The substitution happens on the host at deploy time, which is how a managed database's generated password can reach your app without anyone copying it.

What a reference can point at, and the save is refused (400 reference, with the fix in the message) when it can't:

  • a database: only the variables it offers — Postgres DATABASE_URL, PGHOST, PGPORT, PGUSER, PGPASSWORD, PGDATABASE, POSTGRES_USER, POSTGRES_PASSWORD, POSTGRES_DB; Redis REDIS_URL, REDIS_HOST, REDIS_PORT, REDIS_PASSWORD.
  • an app or job: only a variable you set on it. Not the ones Ridgeline adds (PORT, RIDGELINE_*, the injected *_URLs). So to share a secret between two services, set it on one (say ROOT_ACCESS_KEY_ID on s3) first, then point the other at ${{s3.ROOT_ACCESS_KEY_ID}}. In one POST /stacks call the order doesn't matter.
  • not another reference. References don't chain: point at what the other variable points at.

A reference that stops resolving later (its variable deleted or renamed, its service renamed or deleted) is marked on the Variables tab and listed in broken by GET …/variables; the app receives the ${{…}} text as is. Every other value reaches your app exactly as typed — a $ is a $, and $OTHER is not expanded.

What the platform sets for you (collapsed under N variables added by Ridgeline, and these win over anything you set with the same name):

variable value
PORT the port your container must listen on
DATABASE_URL the project's PostgreSQL, when there is exactly one
REDIS_URL the project's Redis, when there is exactly one
<NAME>_URL one per database or Redis, always — how an app tells several apart
RIDGELINE_RESOURCE this resource's name
RIDGELINE_DOMAIN its public hostname, if it has one

Saving variables recreates the containers with the new values.

Something wrong or missing here? Tell us and a person will answer.