___ __ ____ ____ ____ __ ____ __ ____ ____ __ ____ __
/ __)/ \( \( __)( __)( ) ( _ \ / _\ / ___)( __) / _\ ( _ \( )
( (__( O )) D ( ) _) ) _) )( ) _ (/ \\___ \ ) _) / \ ) __/ )(
\___)\__/(____/(____)(__) (__) (____/\_/\_/(____/(____) \_/\_/(__) (__)
-
Ruby 3.2.0
-
Rails 7.0.4.1
-
Use template to create a new repo
-
Open in your IDE
-
Delete credentials.yml.enc
-
run EDITOR="code --wait" bin/rails credentials:edit
- This will create a new master.key and new credentials.yml.enc
-
Put in all environment variables below
- all are needed, use place holders for time being and edit as you go
-
Edit this ReadME for your new project! to get rid of all this un needed information, you can keep the Existing project section if you like
-
master.key already exist
- Obtain master.key *from your team lead if you do not have access
-
Paste the master.key from your team lead/heroku and save
-
run EDITOR="code --wait" bin/rails credentials:edit
- If it opens you are good to go
- If not, your master.key is wrong
- Check with your team lead
- Do not attempt to generate a new master.key
invitation:
url: 'https://urlhere'
twilio:
default_number: '555-555-5555'
account_sid: 'sid_here'
auth_token: 'auth_token'
sendgrid:
default_email: '[email protected]'
domain: 'domain.com'
address: 'smtp.sendgrid.net'
username: 'apikey' #apikey actually is the username to authenticate with api secret token below
password: 'api_token'
sidekiq:
auth_username: 'username'
auth_password: 'password'
workers:
max_threads: #
min_threads: #
swagger:
username: 'username'
password: 'password'
EDITOR="code --wait" bin/rails credentials:edit
If this is a new project use the above command. Copy the above Environment Variables and set appropriately. Make sure the master key generated in master.key is copied over to the project on Heroku, if not Heroku can not decrypt the environment variables. If this is not a new project, before running the above command make sure you have the master key copied from Heroku, and/or speak with your Team Lead to set the project up correctly.
We are using swagger for API Documentaion. By default only the localhost server is setup. Going into swagger_helper to setup the production & staging urls
API documentation is available at /api-docs
and is protected by basic auth. The username and password are set in the environment variables.
You can run the test suite by calling rspec
. This project uses RSpec for controller tests through swagger.
This project comes with Sidekiq and Sidekiq scheduler built-in as gems. Sidekiq leverages Redis, and Redis is provided as a gem. When running the application, you'll need to run Sidekiq alongside the normal Rails server in order for the background processing to work locally.
You may want to look into utilizing something like Foreman to turn on and off all of your services at once. Otherwise, you can start Sidekiq in a new terminal by running bundle exec sidekiq
.
In the root directory there is now a credentials.rb file. Using:
ruby credentials.rb
The file will run allowing you to select an editor to edit rails credentials with.
- You need to have master key already set in the project correctly
- The script will need to be updated to match your credential layout
- Make sure to have options for both VSCode & RubyMine
- This only works on Macs
Nothing on the horizon right now, if you can think of a feature that should be in the baseAPI, speak up! - Lee
11/23 - Whitelisted local host and .ngrok - Lee
03/15/22 - Updated for Rails 7 - Lee
03/15/22 - Added script to easily access credentials - Lee