Last active
November 12, 2017 04:14
-
-
Save adrianvalenz/59cbcfa9f8d0299bdf079eee7ab687d3 to your computer and use it in GitHub Desktop.
Rails secret && database yaml files
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
default: &default | |
adapter: sqlite3 | |
pool: <%= ENV.fetch("RAILS_MAX_THREADS") { 5 } %> | |
timeout: 5000 | |
development: | |
<<: *default | |
database: db/development.sqlite3 | |
# Warning: The database defined as "test" will be erased and | |
# re-generated from your development database when you run "rake". | |
# Do not set this db to the same as development or production. | |
test: | |
<<: *default | |
database: db/test.sqlite3 | |
staging: | |
<<: *default | |
adapter: postgresql | |
host: localhost | |
database: appname_staging | |
username: appname_user | |
password: th3f1r3w1th1n | |
encoding: utf8 | |
production: | |
<<: *default | |
adapter: postgresql | |
host: localhost | |
database: appname_production | |
username: appname_user | |
password: th3f1r3w1th1n | |
encoding: utf8 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# make postgresql database on server | |
sudo su - postgres | |
psql | |
CREATE DATABASE appname_production; | |
CREATE USER appname_user WITH PASSWORD 'th3f1r3w1th1n'; | |
GRANT ALL PRIVILEGES ON DATABASE appname_production TO appname_user; | |
\q | |
exit | |
# generate secret in local project root for production | |
rake secret |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
staging: | |
asd;lfjkasdjlf | |
production: | |
asldfjkas;ldfjkas;ldfjkasjkdf |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment