Configure letter opener to read emails via web UI
This commit is contained in:
parent
b0124fbd26
commit
3b0765e628
1
Gemfile
1
Gemfile
@ -35,6 +35,7 @@ end
|
|||||||
group :development do
|
group :development do
|
||||||
gem 'rubocop'
|
gem 'rubocop'
|
||||||
gem 'web-console'
|
gem 'web-console'
|
||||||
|
gem 'letter_opener_web'
|
||||||
end
|
end
|
||||||
|
|
||||||
gem 'chroma'
|
gem 'chroma'
|
||||||
|
13
Gemfile.lock
13
Gemfile.lock
@ -88,6 +88,8 @@ GEM
|
|||||||
bootsnap (1.18.4)
|
bootsnap (1.18.4)
|
||||||
msgpack (~> 1.2)
|
msgpack (~> 1.2)
|
||||||
builder (3.3.0)
|
builder (3.3.0)
|
||||||
|
childprocess (5.1.0)
|
||||||
|
logger (~> 1.5)
|
||||||
chroma (0.2.0)
|
chroma (0.2.0)
|
||||||
coderay (1.1.3)
|
coderay (1.1.3)
|
||||||
concurrent-ruby (1.3.4)
|
concurrent-ruby (1.3.4)
|
||||||
@ -150,6 +152,16 @@ GEM
|
|||||||
jsonapi-serializable (0.3.1)
|
jsonapi-serializable (0.3.1)
|
||||||
jsonapi-renderer (~> 0.2.0)
|
jsonapi-renderer (~> 0.2.0)
|
||||||
language_server-protocol (3.17.0.3)
|
language_server-protocol (3.17.0.3)
|
||||||
|
launchy (3.0.1)
|
||||||
|
addressable (~> 2.8)
|
||||||
|
childprocess (~> 5.0)
|
||||||
|
letter_opener (1.10.0)
|
||||||
|
launchy (>= 2.2, < 4)
|
||||||
|
letter_opener_web (3.0.0)
|
||||||
|
actionmailer (>= 6.1)
|
||||||
|
letter_opener (~> 1.9)
|
||||||
|
railties (>= 6.1)
|
||||||
|
rexml
|
||||||
license_finder (7.2.1)
|
license_finder (7.2.1)
|
||||||
bundler
|
bundler
|
||||||
csv (~> 3.2)
|
csv (~> 3.2)
|
||||||
@ -386,6 +398,7 @@ DEPENDENCIES
|
|||||||
importmap-rails
|
importmap-rails
|
||||||
jbuilder
|
jbuilder
|
||||||
jsonapi-rails
|
jsonapi-rails
|
||||||
|
letter_opener_web
|
||||||
license_finder
|
license_finder
|
||||||
money
|
money
|
||||||
pg (~> 1.1)
|
pg (~> 1.1)
|
||||||
|
@ -31,7 +31,7 @@ class ApplicationController < ActionController::Base
|
|||||||
|
|
||||||
def development_swagger?
|
def development_swagger?
|
||||||
Rails.env.test? ||
|
Rails.env.test? ||
|
||||||
Rails.env.development? && request.headers['referer'].include?('/api-docs/index.html')
|
Rails.env.development? && request.headers['referer']&.include?('/api-docs/index.html')
|
||||||
end
|
end
|
||||||
|
|
||||||
def set_csrf_cookie
|
def set_csrf_cookie
|
||||||
|
@ -5,7 +5,10 @@ class Users::ConfirmationsController < Devise::ConfirmationsController
|
|||||||
def show
|
def show
|
||||||
super do |resource|
|
super do |resource|
|
||||||
if resource.errors.empty?
|
if resource.errors.empty?
|
||||||
render json: resource, status: :ok
|
respond_to do |format|
|
||||||
|
format.json { render json: resource, status: :ok }
|
||||||
|
format.any { redirect_to root_path }
|
||||||
|
end
|
||||||
else
|
else
|
||||||
render json: {
|
render json: {
|
||||||
message: 'Record invalid',
|
message: 'Record invalid',
|
||||||
|
@ -28,10 +28,10 @@ module VNS
|
|||||||
@best_solution = @initial_solution
|
@best_solution = @initial_solution
|
||||||
@best_score = @target_function.call(@best_solution)
|
@best_score = @target_function.call(@best_solution)
|
||||||
|
|
||||||
puts "Initial score: #{@best_score.to_f}"
|
# puts "Initial score: #{@best_score.to_f}"
|
||||||
|
|
||||||
self.class.sequence(@perturbations).each do |perturbation|
|
self.class.sequence(@perturbations).each do |perturbation|
|
||||||
puts "Running perturbation: #{perturbation.name}"
|
# puts "Running perturbation: #{perturbation.name}"
|
||||||
optimize(perturbation.new(@best_solution))
|
optimize(perturbation.new(@best_solution))
|
||||||
end
|
end
|
||||||
|
|
||||||
@ -48,7 +48,7 @@ module VNS
|
|||||||
@best_solution = alternative_solution.deep_dup
|
@best_solution = alternative_solution.deep_dup
|
||||||
@best_score = score
|
@best_score = score
|
||||||
|
|
||||||
puts "New lowest score: #{@best_score.to_f}"
|
# puts "New lowest score: #{@best_score.to_f}"
|
||||||
|
|
||||||
return optimize(perturbation.class.new(@best_solution))
|
return optimize(perturbation.class.new(@best_solution))
|
||||||
end
|
end
|
||||||
|
@ -40,10 +40,10 @@ Rails.application.configure do
|
|||||||
|
|
||||||
# Don't care if the mailer can't send.
|
# Don't care if the mailer can't send.
|
||||||
config.action_mailer.raise_delivery_errors = false
|
config.action_mailer.raise_delivery_errors = false
|
||||||
|
|
||||||
config.action_mailer.perform_caching = false
|
config.action_mailer.perform_caching = false
|
||||||
|
config.action_mailer.default_url_options = { host: 'libre-wedding-planner.app.localhost/api' }
|
||||||
config.action_mailer.default_url_options = { host: 'libre-wedding-planner.app.localhost' }
|
config.action_mailer.delivery_method = :letter_opener_web
|
||||||
|
config.action_mailer.perform_deliveries = true
|
||||||
|
|
||||||
# Print deprecation notices to the Rails logger.
|
# Print deprecation notices to the Rails logger.
|
||||||
config.active_support.deprecation = :log
|
config.active_support.deprecation = :log
|
||||||
|
@ -1,6 +1,7 @@
|
|||||||
# Copyright (C) 2024 Manuel Bustillo
|
# Copyright (C) 2024 Manuel Bustillo
|
||||||
|
|
||||||
Rails.application.routes.draw do
|
Rails.application.routes.draw do
|
||||||
|
mount LetterOpenerWeb::Engine, at: "/letter_opener" if Rails.env.development?
|
||||||
devise_for :users, skip: [:registration, :session, :confirmation]
|
devise_for :users, skip: [:registration, :session, :confirmation]
|
||||||
devise_scope :user do
|
devise_scope :user do
|
||||||
post 'users', to: 'users/registrations#create'
|
post 'users', to: 'users/registrations#create'
|
||||||
@ -23,4 +24,6 @@ Rails.application.routes.draw do
|
|||||||
resources :tables_arrangements, only: %i[index show]
|
resources :tables_arrangements, only: %i[index show]
|
||||||
|
|
||||||
get 'up' => 'rails/health#show', as: :rails_health_check
|
get 'up' => 'rails/health#show', as: :rails_health_check
|
||||||
|
|
||||||
|
root to: redirect('/dashboard')
|
||||||
end
|
end
|
||||||
|
@ -7,6 +7,11 @@ server {
|
|||||||
proxy_set_header Host $http_host;
|
proxy_set_header Host $http_host;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
location /letter_opener/ {
|
||||||
|
proxy_pass http://backend:3000/letter_opener/;
|
||||||
|
proxy_set_header Host $http_host;
|
||||||
|
}
|
||||||
|
|
||||||
location / {
|
location / {
|
||||||
proxy_pass http://frontend:3000;
|
proxy_pass http://frontend:3000;
|
||||||
proxy_set_header Host $http_host;
|
proxy_set_header Host $http_host;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user