Use environment variables to embed information in your application
■ Information that you do not want to leak can be used in the application ■ Improved security ■ Can be used for various APIs
■ Mac OS catalina ■ Ruby on Rails (5.2.4.2) ■ Virtual Box:6.1 ■ Vagrant: 2.2.7
application.Gemfile
gem 'dotenv-rails'
mac.terminal
bundle install
In the application.env
#google omniauth 2.For 0
GOOGLE_APP_ID='xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx'
GOOGLE_APP_SECRET='xxxxxxxxxxxxxxxxxxxxxxxxxx'
#Deployment settings
DB_USERNAME='xxxxxxxx'
DB_PASSWORD="xxxxxxxxx"
DB_HOST="xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"
DB_DATABASE="xxxxxxxxxx"
#Mail function implementation
USER_NAME="txxxxxxxxxxxx"
USER_PASSWORD="xxxxxxxxxxx"
that's all After that, increase the code depending on the service or application you want to use.
Recommended Posts