diff --git a/Gemfile b/Gemfile index c7b1c05..3d891e2 100644 --- a/Gemfile +++ b/Gemfile @@ -5,6 +5,8 @@ gem 'rubocop', '>= 1.0', '< 2.0' ruby '3.1.2' +gem 'sass-rails', '>= 5.0.3' + gem 'cancancan' gem 'jwt' @@ -92,3 +94,5 @@ end gem 'sassc-rails' gem 'active_model_serializers', '~> 0.10.13' + +gem 'psych', '~> 3.3', '>= 3.3.0' \ No newline at end of file diff --git a/Gemfile.lock b/Gemfile.lock index 70e999c..18c112d 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -253,6 +253,8 @@ GEM parser (>= 3.2.1.0) ruby-progressbar (1.13.0) rubyzip (2.3.2) + sass-rails (6.0.0) + sassc-rails (~> 2.1, >= 2.1.1) sassc (2.4.0) ffi (~> 1.9) sassc-rails (2.1.2) @@ -286,7 +288,6 @@ GEM tzinfo (2.0.6) concurrent-ruby (~> 1.0) tzinfo-data (1.2023.4) - tzinfo (>= 1.0.0) unicode-display_width (2.5.0) uniform_notifier (1.16.0) warden (1.2.9) @@ -327,12 +328,13 @@ DEPENDENCIES jwt letter_opener pg (~> 1.1) + psych (~> 3.3, >= 3.3.0) puma (~> 5.0) rails (~> 7.0.4) rails-controller-testing rspec-rails (>= 3.9.0) rubocop (>= 1.0, < 2.0) - sassc-rails + sass-rails (>= 5.0.3) selenium-webdriver shoulda-matchers (~> 5.0) sprockets-rails diff --git a/app/models/user.rb b/app/models/user.rb index 9be66d3..84b4255 100644 --- a/app/models/user.rb +++ b/app/models/user.rb @@ -4,8 +4,7 @@ class User < ApplicationRecord # Include default devise modules. Others available are: # :confirmable, :lockable, :timeoutable, :trackable and :omniauthable devise :database_authenticatable, :registerable, - :recoverable, :rememberable, :validatable, - :confirmable + :recoverable, :rememberable, :validatable has_many :posts, foreign_key: 'author_id' has_many :comments, foreign_key: 'author_id' has_many :likes, foreign_key: 'author_id' diff --git a/bin/render-build.sh b/bin/render-build.sh new file mode 100644 index 0000000..e8834c4 --- /dev/null +++ b/bin/render-build.sh @@ -0,0 +1,7 @@ +#!/usr/bin/env bash +# exit on error +set -o errexit + +bundle install +./bin/rails assets:precompile +./bin/rails assets:clean \ No newline at end of file diff --git a/config/credentials.yml.enc b/config/credentials.yml.enc index 68b3d24..ed6c272 100644 --- a/config/credentials.yml.enc +++ b/config/credentials.yml.enc @@ -1 +1 @@ -YGE9nzPR1Emwc0zZgQbC0g0Xo++SeAn1tCR3unVXA0J2SFnF79CEGyfyAg0S+f9jFWKiRz+DU/cvyO5in7z8Uc9N7NwolURO7S9bYXWQ8pp6s0TAq3DlNcbFRXC+ggItkqPU773bMC9YopGlH5B6G9dveFAR7ULjYETMOzfYYH5MZAx1XF59lvAD2YDVTlLji3siL9psyelAZF7YPEayeVT1ZbnoAnRiZsD0sNta9HGVjqPEzw3u3ubJ6kBQ5kIFX7YMCq4q8NV131Tzv6IRq5XR4JvebU0qJ9vMBYFLaQtCQAhDk5yAOJldumAWMcadrmdWX3eP3GYYkOXPOeP9hw9lacoV6oMFXxnLdLY74QsEaJ0JmjdfjQcviecKQTFCS8ib3LAY9ceoerlww0QgF26r3UcZVq6kw9Hf--onVdoWyrSEwHZ2tl--8IF/q1D/FqOXmShTrbM7fw== \ No newline at end of file +fZJBl7a528fR1BWykT8AM3LD18ZKA1FtrIg9KuYw/KcDFKAjmff3dsorD+vfVVtUY+cNyl3Sl0XJJC0duImB8O6apOTCPnsuDiXPQXL/aeHMCrsKdZ02DVJj1TvCCNMAHN+O0awJWyjzM6mRrcMtnrWY+dUmwm1qp1Zu6S84NjSTtdAQoYeTCTjt6kTiLx2S5xIfAdXUU8tU27LlGPxzSvb0iOCh5Ha9tj7qVUGYlyZ3cdYBIyNKmKn1aUKY0ja3J7rAE6GpNrjHPuo0wxcGWFJI18pgAZ8ZJjUU+3pS406oxz2FFLmuxOhCjpK09DvfxHHM8du6rOZdGLJkHf9fHc48ebkkhNKrz60+RnQoEjvgBoZJ8QqyMTOgzTMCajmZwy7t2KvDbnhRunK6/qj1eHWtO0Sm1W0cUxHS--zL1yMu6ZxRNxnpWq--1mQb7olLAvAxI7nqcs0X+g== \ No newline at end of file diff --git a/config/database.yml b/config/database.yml index cf2f862..84d8691 100644 --- a/config/database.yml +++ b/config/database.yml @@ -24,7 +24,6 @@ default: &default development: <<: *default database: blog_app_development - host: localhost username: postgres password: hamid @@ -61,7 +60,6 @@ development: test: <<: *default database: blog_app_test - host: localhost username: postgres password: hamid diff --git a/config/environments/production.rb b/config/environments/production.rb index a5e563c..3568ef4 100644 --- a/config/environments/production.rb +++ b/config/environments/production.rb @@ -49,6 +49,7 @@ # Force all access to the app over SSL, use Strict-Transport-Security, and use secure cookies. # config.force_ssl = true + config.action_mailer.default_url_options = { host: 'https://blog-app-8pi0.onrender.com/' } # Include generic and useful information about system operation, but avoid logging too much # information to avoid inadvertent exposure of personally identifiable information (PII). diff --git a/db/migrate/20221007101943_add_devise_to_users.rb b/db/migrate/20221007101943_add_devise_to_users.rb index b24d910..efc4689 100644 --- a/db/migrate/20221007101943_add_devise_to_users.rb +++ b/db/migrate/20221007101943_add_devise_to_users.rb @@ -22,10 +22,10 @@ def self.up # t.string :last_sign_in_ip ## Confirmable - t.string :confirmation_token - t.datetime :confirmed_at - t.datetime :confirmation_sent_at - t.string :unconfirmed_email # Only if using reconfirmable + # t.string :confirmation_token + # t.datetime :confirmed_at + # t.datetime :confirmation_sent_at + # t.string :unconfirmed_email # Only if using reconfirmable ## Lockable # t.integer :failed_attempts, default: 0, null: false # Only if lock strategy is :failed_attempts diff --git a/render.yaml b/render.yaml new file mode 100644 index 0000000..edf80a2 --- /dev/null +++ b/render.yaml @@ -0,0 +1,23 @@ +databases: + - name: mysite + databaseName: mysite + user: mysite + plan: free + +services: + - type: web + name: mysite + runtime: ruby + plan: free + buildCommand: "./bin/render-build.sh" + # preDeployCommand: "./bin/rails db:migrate" # preDeployCommand only available on paid instance types + startCommand: "./bin/rails server" + envVars: + - key: DATABASE_URL + fromDatabase: + name: mysite + property: connectionString + - key: RAILS_MASTER_KEY + sync: false + - key: WEB_CONCURRENCY + value: 2 # sensible default \ No newline at end of file