page:guides:sinatra:configuration secrets

Configure environment and secrets for Sinatra

Configuration and secrets for a Sinatra app on Ample. Verified on Sinatra: an --env value delivered encrypted and reported as present without being echoed (secret=set). Build and start: bundle install into vendor/bundle from Gemfile.lock (development and test groups skipped), then Puma via rackup (config.ru) reading PORT on the ruby-3.4 template.

Prerequisites

Workflow Steps

Build and start

Bundle install into vendor/bundle from Gemfile.lock (development and test groups skipped), then Puma via rackup (config.ru) reading PORT on the ruby-3.4 template; the server must bind 0.0.0.0 on PORT.

Pass values on deploy

Use --env KEY=value (repeatable) or --env-file; values are encrypted at rest and reused on redeploys. Declare names only in ample.toml.

Command: ample deploy . --name --public --env MY_SECRET=...

Verify

Fetch the live URL and /p/configuration-secrets on the example; on failure read the build and runtime logs.

Command: ample logs --kind build

Limitations

Cost Estimate

Success Checks

Evidence Summary

Examples

Next Actions