5050cloud

Variables reference

The variables 5050cloud provides to every replica, their Railway aliases, the reference syntax and the variables that change settings.

Provided variables

VariableValue
PORTThe target port (default 8080)
FIFTY_PUBLIC_DOMAINThe service's first public domain
FIFTY_PRIVATE_DOMAIN<name>.internal
FIFTY_PROJECT_ID, FIFTY_PROJECT_NAMEThe project
FIFTY_ENVIRONMENT_ID, FIFTY_ENVIRONMENT_NAMEThe environment
FIFTY_SERVICE_ID, FIFTY_SERVICE_NAMEThe service
FIFTY_DEPLOYMENT_IDThe deployment
FIFTY_SNAPSHOT_IDThe deployment id, used as a build snapshot id
FIFTY_REPLICA_IDThis replica
FIFTY_REPLICA_REGION, FIFTY_HOSTThe host this replica runs on
FIFTY_PROCESSESProcesses per replica
FIFTY_GIT_COMMIT_SHA, FIFTY_GIT_BRANCH, FIFTY_GIT_REPO_OWNER, FIFTY_GIT_REPO_NAME, FIFTY_GIT_COMMIT_MESSAGE, FIFTY_GIT_AUTHORThe commit, for GitHub sources
FIFTY_VOLUME_NAME, FIFTY_VOLUME_MOUNT_PATHThe volume, when there is one
FIFTY_TCP_PROXY_DOMAIN, FIFTY_TCP_PROXY_PORT, FIFTY_TCP_APPLICATION_PORTThe TCP proxy, when there is one

With Railway aliases on (the default), the same set is also provided as RAILWAY_* (for example RAILWAY_PUBLIC_DOMAIN), plus RAILWAY_ENVIRONMENT with the environment name. Your own variables win over provided ones.

Not provided

Railway's OTEL_* tracing variables. To send traces to your own collector, set OTEL_EXPORTER_OTLP_ENDPOINT and the related variables yourself, for example as shared variables.

Reference syntax

SyntaxMeaning
${{NAME}}Same service
${{shared.NAME}}Shared variable of the environment
${{Service Name.NAME}}Another service in the environment, by name (case-sensitive, spaces allowed)

Resolution is recursive (up to 10 levels) with cycle detection. Unknown targets resolve to an empty string with a warning.

Template functions

FunctionResult
${{secret(len)}}Random string of len characters from A-Za-z0-9
${{secret(len, "alphabet")}}Random string from the given characters
${{randomInt(min, max)}}Random integer

They are evaluated once, when the value is first saved.

Variables that change settings

When the matching setting is empty, these override it: RAILWAY_DOCKERFILE_PATH, RAILWAY_RUN_UID, RAILWAY_SHM_SIZE_BYTES, RAILWAY_HEALTHCHECK_TIMEOUT_SEC, RAILWAY_DEPLOYMENT_OVERLAP_SECONDS, RAILWAY_DEPLOYMENT_DRAINING_SECONDS, NO_CACHE, RAILPACK_* and NIXPACKS_* build hints, and the FIFTY_ equivalents.

Masking

Values of variables whose names contain SECRET, TOKEN, PASSWORD, PASSWD, PASS, KEY, PRIVATE, CREDENTIAL, DSN or AUTH, sealed variables, and passwords inside URL values are replaced by dots in build and deploy logs when they are at least 6 characters long.

View as Markdown · Edit this page