diff --git a/.gitignore b/.gitignore index 7bdcaac..6a4c413 100644 --- a/.gitignore +++ b/.gitignore @@ -42,3 +42,8 @@ !/app/assets/builds/.keep /node_modules + +# CREDENTIALS +/config/credentials/development.key +/config/credentials/development.yml.enc +/config/credentials/production.key diff --git a/bin/setup b/bin/setup index d9d15d2..f2e7d2f 100755 --- a/bin/setup +++ b/bin/setup @@ -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" diff --git a/bin/setup_dev_credentials b/bin/setup_dev_credentials new file mode 100755 index 0000000..effc6dc --- /dev/null +++ b/bin/setup_dev_credentials @@ -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: +# nintendo_app_key: + +# TO ENABLE SENTRY (Error tracking & performance monitoring). (OPTIONAL) +# sentry_dsn: + +# TO ENABLE PLAUSBLE (Privacy-friendly analytics). (OPTIONAL) +# plausible_api_key: + +# TO ENABLE SIGN IN WITH TWITTER. (OPTIONAL) +# twitter_app_id: +# twitter_app_secret: + +# TO ENABLE SIGN IN WITH DISCORD. (OPTIONAL) +# discord_app_id: +# discord_app_secret: +" + +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." diff --git a/config/credentials.yml.enc b/config/credentials.yml.enc deleted file mode 100644 index fa546a3..0000000 --- a/config/credentials.yml.en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v+yLQ2npqK2yOLnLN+wTyT0wo0a8YCVfhKTFCNcgcJmkoGw4xwDbTYp9cbHG8clJgJofEIQ0rXg4xssrCTsILR/VlTECnV1yoyiA9nj53xFP6CUp0qzI9PkIu75Vn2h49kVBqmzEbJToh1SsSmRWGo5dXvjerwR8D2QZFEHP30E37hJPpy+hE0kv8J/EYNVPM5lNhgJ6ehI/kmHQFz+TlnpoD207tcec--xzbbQKIdkd0RgBjv--loxoAu0+esTG/bkaoNxw/g== \ No newline at end of file diff --git a/config/credentials/production.yml.enc b/config/credentials/production.yml.enc new file mode 100644 index 0000000..793e218 --- /dev/null +++ b/config/credentials/production.yml.enc @@ -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+pK7iD0HR98A9gXbf2DHIQvLcy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