Skip to content

GitLab

  • Menu
Projects Groups Snippets
    • Loading...
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
    • Contribute to GitLab
  • Sign in
  • S snp-best-practices
  • Project information
    • Project information
    • Activity
    • Labels
    • Members
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
  • Issues 1
    • Issues 1
    • List
    • Boards
    • Service Desk
    • Milestones
  • Merge requests 1
    • Merge requests 1
  • Deployments
    • Deployments
    • Releases
  • Monitor
    • Monitor
    • Incidents
  • Packages & Registries
    • Packages & Registries
    • Infrastructure Registry
  • Analytics
    • Analytics
    • Repository
    • Value stream
  • Wiki
    • Wiki
  • Snippets
    • Snippets
  • Activity
  • Graph
  • Create a new issue
  • Commits
  • Issue Boards
Collapse sidebar
  • saltpepper
  • snp-best-practices
  • Issues
  • #4

Closed
Open
Created May 15, 2014 by Ghost User@ghostContributor

Add staging and testing environments to secrets.yml if rails >=4.1

Add staging and testing environments to secrets.yml if rails >=4.1

Example(with figaro):

# Be sure to restart your server when you modify this file.

# Your secret key is used for verifying the integrity of signed cookies.
# If you change this key, all old signed cookies will become invalid!

# Make sure the secret is at least 30 characters and all random,
# no regular words or you'll be exposed to dictionary attacks.
# You can use `rake secret` to generate a secure secret key.

# Make sure the secrets in this file are kept private
# if you're sharing your code publicly.

development:
  secret_key_base: ...

test:
  secret_key_base: ...

# Do not keep production secrets in the repository,
# instead read values from the environment.
testing:
  url: <%= Figaro.env.secret_key_base! if Rails.env.testing? %>

staging:
  url: <%= Figaro.env.secret_key_base! if Rails.env.staging? %>

production:
  url: <%= Figaro.env.secret_key_base! if Rails.env.production? %>

Example(without figaro):

# Be sure to restart your server when you modify this file.

# Your secret key is used for verifying the integrity of signed cookies.
# If you change this key, all old signed cookies will become invalid!

# Make sure the secret is at least 30 characters and all random,
# no regular words or you'll be exposed to dictionary attacks.
# You can use `rake secret` to generate a secure secret key.

# Make sure the secrets in this file are kept private
# if you're sharing your code publicly.

development:
  secret_key_base: 336fe0249b77b7e0c18df45b29418ce3368b4b3a2c9ada26935a8024911584762f68a4fd3d0ad680d1d465235e8169b600a688c2129cf5a9c6fa1e99ad0391d9

test:
  secret_key_base: a448b208708ac203f5c74a4ba87cff287b1734660405d720ba73ed5267d711af88bab0cb3a1a4a5fdfd39c1338a088b5e1637e08d0fecc0da6d5b840b4abbabc

# Do not keep production secrets in the repository,
# instead read values from the environment.
testing:
  secret_key_base: <%= ENV["SECRET_KEY_BASE"] %>

staging:
  secret_key_base: <%= ENV["SECRET_KEY_BASE"] %>

production:
  secret_key_base: <%= ENV["SECRET_KEY_BASE"] %>
Assignee
Assign to
Time tracking