bundle install
rails db:drop db:create db:migrate db:seed
rails sFiles ≥4GB are uploaded via API proxy with background S3 multipart upload. Upload progress tracking requires Rails.cache:
- Production: Uses
:memory_storeby default (progress tracking works) - Development: Uses
:null_storeby default (no progress tracking, shows "Validating upload..." instead)- To see progress in development, change
config.cache_storeto:memory_storeinconfig/environments/development.rb
- To see progress in development, change
Master Key is in my notes. Ask me for it.
To edit credentials:
EDITOR="code --wait" bin/rails credentials:edit
- Go to DigitalOcean and create a new App
- Select the GitHub repo and the branch to deploy (usually main)
- Add a PostgeSQL database
- Add the Rails RAILS_MASTER_KEY environment variable with the content from config/master.key
- Deploy and wait for the build to finish (everytime you push to main, it will deploy automatically)
If you start the app for the first time you need to create a user. Go to the app in DigitalOcean and click on the console. Then run:
bin/rails c
password = SecureRandom.hex(10)
AdminUser.create(email: '[email protected]', password: password, password_confirmation: password)
AdminUser.create(email: '[email protected]', password: password, password_confirmation: password)
puts "User created with password: #{password}"