Skip to content
This repository has been archived by the owner on Dec 26, 2022. It is now read-only.

🔧 Setup credentials (development & production) #185

Merged
merged 1 commit into from
Sep 3, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -42,3 +42,8 @@
!/app/assets/builds/.keep

/node_modules

# CREDENTIALS
/config/credentials/development.key
/config/credentials/development.yml.enc
/config/credentials/production.key
3 changes: 3 additions & 0 deletions bin/setup
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,9 @@ FileUtils.chdir APP_ROOT do
puts "\n== Recreating database =="
system! "bin/rails db:reset"

puts "\n== Creating development credentials =="
system! "bin/setup_dev_credentials"

puts "\n== Removing old logs and tempfiles =="
system! "bin/rails log:clear tmp:clear"

Expand Down
36 changes: 36 additions & 0 deletions bin/setup_dev_credentials
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
#!/bin/bash

if [[ -f "config/credentials/development.yml.enc" ]]
then
echo "Development credentials already exists on your filesystem."
echo "If you want to recreate development credentials, remove config/credentials/development.yml.enc file"
exit
fi

CONTENT="secret_key_base: $(rake secret)

# TO IMPORT DATA FROM NINTENDO WEBSITE. (REQUIRED)
# You can get the credentials by investigating the network requests on Nintendo's Official website.
# nintendo_app_id: <FILL HERE>
# nintendo_app_key: <FILL HERE>

# TO ENABLE SENTRY (Error tracking & performance monitoring). (OPTIONAL)
# sentry_dsn: <FILL HERE>

# TO ENABLE PLAUSBLE (Privacy-friendly analytics). (OPTIONAL)
# plausible_api_key: <FILL HERE>

# TO ENABLE SIGN IN WITH TWITTER. (OPTIONAL)
# twitter_app_id: <FILL HERE>
# twitter_app_secret: <FILL HERE>

# TO ENABLE SIGN IN WITH DISCORD. (OPTIONAL)
# discord_app_id: <FILL HERE>
# discord_app_secret: <FILL HERE>
"

EDITOR="echo \"$CONTENT\" > " rails credentials:edit --environment development

echo "ATTENTION:"
echo "Don't forget to fill nintendo_app_id and nintendo_app_key variables by running \`rails credentials:edit --environment development\`."
echo "You can get the these credentials by investigating the network requests on Nintendo's Official website."
1 change: 0 additions & 1 deletion config/credentials.yml.enc

This file was deleted.

1 change: 1 addition & 0 deletions config/credentials/production.yml.enc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
iaKYCiDOPCcVV/LY5VZp6Imz32eCeomBpmftjTnvgn6uue2r02BX9o1TTtQSrFOH8b2oooWCtSeHnH5x7bDwY3Je03zy/4w4wmdXILJzarw7nsax0lwulETZOfAAYP+uMtgJtwxkVMB1cOL5FZ/OtChFLawOXlJXvfAXQjHGlrmSD0nFfKnTJEpWAxpaaZja7o46c7GrVQlASrGMmkPk0WAQU/2ojVyeS+thvIPdWcESC+0KA1OL+qzNxxWHejtCOI27enWAMtiNYiFSwETn4+VvDsTQE8hz/vOG0ItOnQXvFXtcKjoCnPI41SYtnuZPG4mTD2VliZ1EhQD4t8lR/Zwdjtd7/R7NKEoRZyZjix0jqlRu2+rjoGPrLw88qlqV0gAoF8GEK2e9+v/y+sWRw0S8U6JcVuvb3+ytA3bYHWARApwaiC+pORsb6ajTeU0QnX/hhdywM58FUNP1cUdImhBUyIVTGWhvMDLiOOeuuaSNaob6BYplz7CMmyd37mT8QHfxqyLoY29k4TIUbzNXvYJcWFdZntHs3AtNkGCTNcjHxMHATKVafkFyuFtKLVaNwZpcmsaDmGgtNb3dUOwoQ9P2tDhm1uv6C0SsuVr377IhC1/El3yF73k+mB4EBnyszV4L1o2D9oCY9/LcAjqQNTx6MmR+Us2W6Mpy4LA/7l/gBJ+pK7iD0HR98A9gXbf2DHIQvLcy5ewT6xf9SX39rZWrVougkAWUWtMk2TG7P4Eq3Llsam5pGaR5lO877cM2ySr4q0vN7yjAvcmOWskKdqMfMBihNY/thuOvH8/M/a8C6S8AhtvPS5criv1QmfblS8tPRfIw+TAnn3/ZsG+fX0u6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