Skip to content

Commit

Permalink
email 500 error to user removed, added remote logs, moved smtp pass t…
Browse files Browse the repository at this point in the history
…o credentials, status page moved
  • Loading branch information
baldarn committed Aug 23, 2024
1 parent 33957da commit d0b98e5
Show file tree
Hide file tree
Showing 8 changed files with 30 additions and 9 deletions.
2 changes: 2 additions & 0 deletions Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,8 @@ gem 'pg', '~> 1.5.7'
gem 'puma', '>= 5.0'

# Metrics
gem 'logtail-rails', '~> 0.2.7'

gem 'yabeda'
gem 'yabeda-prometheus'
gem 'yabeda-puma-plugin'
Expand Down
13 changes: 13 additions & 0 deletions Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -212,6 +212,17 @@ GEM
rails
language_server-protocol (3.17.0.3)
logger (1.6.0)
logtail (0.1.13)
msgpack (~> 1.0)
logtail-rack (0.2.5)
logtail (~> 0.1)
rack (>= 1.2, < 4.0)
logtail-rails (0.2.7)
actionpack (>= 5.0.0)
activerecord (>= 5.0.0)
logtail (~> 0.1)
logtail-rack (~> 0.1)
railties (>= 5.0.0)
loofah (2.22.0)
crass (~> 1.0.2)
nokogiri (>= 1.12.0)
Expand All @@ -231,6 +242,7 @@ GEM
rails (>= 7.1)
stimulus-rails
turbo-rails
msgpack (1.7.2)
net-imap (0.4.14)
date
net-protocol
Expand Down Expand Up @@ -468,6 +480,7 @@ DEPENDENCIES
kamal
kaminari
kaminari-i18n
logtail-rails (~> 0.2.7)
mission_control-jobs (~> 0.3.1)
pg (~> 1.5.7)
puma (>= 5.0)
Expand Down
2 changes: 1 addition & 1 deletion app/views/application/_footer.erb
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
<% if ENV['APP_VERSION'].present? %>
<span class="ms-1">v<%= ENV['APP_VERSION'] %></span>
<% end %>
<a href="https://opengas.betteruptime.com" class="link-info link-offset-2 ms-1">
<a href="https://status.opengas.eu" class="link-info link-offset-2 ms-1">
Status
</a>
</div>
Expand Down
7 changes: 7 additions & 0 deletions config/application.rb
Original file line number Diff line number Diff line change
Expand Up @@ -28,5 +28,12 @@ class Application < Rails::Application

config.i18n.default_locale = :it
config.hosts = []
if Rails.env.production?
config.logger = Logtail::Logger.create_default_logger(
Rails.application.credentials.dig(
:vector, :rails_logs_token
)
)
end
end
end
2 changes: 1 addition & 1 deletion config/credentials.yml.enc
Original file line number Diff line number Diff line change
@@ -1 +1 @@
7oy95ugAD40HGsmY8yhQEecWvJNpzytpCPMNSYHKO3X31Ykveauj4LEWMN9uhiJ6+1pJxahIO6iFiO7eP6AQBaBMcSfw0daPRfhJnm0X6+IekEw4Fl538W1hOntvw4fQkPqNP4eJMpTgTuH1LrMOFOOvgAVxlgouL9ybl7ZzFdYo8PfIjM7QjODTbHgPKU8orPgm/raFpIHcQFTd1EP1XUdXemnvzxJrGX7d1WWwrl4U70rM3N6HfH/G+OycFTlixGpKr+QiRtm4FpGtJSltQZDAGXk6jOZxjDHQA59WhHsz0lE68+cHRUqz7XUN6MkRAnZXRd1mYDI6LYQmRUgk3vJPtWkNpJnvGH8/Gn7wNuhTkWBlXnb0FUW3nkXKWi4iKIT4wsHOzJU7jA3HpxocRyKijRuWN6YPOGsyWdtgWGmiK7lEYV1A2Ug4LFHxjGmIrUXMYwNBJUvzJ2UCrKabqzs2ic8z5zrOZWqkazrZSwpZBPC3Zs9CQGEC861TJPW6S/xAkigmr9tYRGN3SZ4xYCVxMV91tMkzjco8qPOPJ9blNQ==--acgKvtBV5WCvw07y--cnaqYfJ0+foy95l8r2lIQQ==
/K5V6jf8psjxWALA9phkzER3c/3aszNe6tfG8eCGSGFulMESSC6T3k6gQsGQvvQHzVv1u7KsNoGjd86ZW3shpWR5IaPPGF/HKqxhHgyZZF8dVrMRyOlhI/VaNCIWOIhXgq2uTZiw+4LWBaqKF+ecCpZxAdFZhBx8DMmXGfoPi2yXuF6zsL+zVnxsgsSTe1zhArFsSI119g1nGOa2DgKU1ScMh1o7viVtTOjtfb+zJ/g7RBHs3xXdOAR0Fy4g/JghwcwfeYbHH0PaWzN38bUFTijMpCAqoeD8+71iKIchTF8v6Q0Lg3X6cItOS57258WlvnpIzfW8N7mTZjiXz9MiqRTehW56aLzS1q5L+RqRIw3tNI0rc3NsDpLNIvT6l+SOFEwWhr/9tABWz+Z/+EcgPPl8PJZUwJuSar43kIHch0NEZIkq1ABa25t2W3qiOHJZJui5g0sGFhQA8F8cFfr+/hvjSvmMpnMQLnNZGeML7zpsKkaQZcAauaBqso1oltigY28ax7VCwd+a0lO2MiBXUde82LT4aOK0PavpSsaeM/KINIlfxL/+QL6AleyDYj5sFAKxtz9w1vXymGYwNZp8oC1BtVwQlelrsZq9Orlz/RhomF15J/pNrItkKz1mcvfwaqv4JsXTNxGiFDtNIo4d4aV7rbzdaqKLwZEpz8JwUzI+CbOX--CI1brbTk84ZXJ19+--KSyG1pYUx1cb6+LPcrsX6A==
7 changes: 3 additions & 4 deletions config/deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,6 @@ env:
secret:
- RAILS_MASTER_KEY
- POSTGRES_PASSWORD
- SMTP_PASSWORD
- APP_VERSION

# Use a different ssh user than root
Expand Down Expand Up @@ -93,9 +92,9 @@ traefik:
api.insecure: true
entryPoints.web.address: ":80"
entryPoints.websecure.address: ":443"
entryPoints.web.http.redirections.entryPoint.to: websecure
entryPoints.web.http.redirections.entryPoint.scheme: https
entryPoints.web.http.redirections.entrypoint.permanent: true
# entryPoints.web.http.redirections.entryPoint.to: websecure
# entryPoints.web.http.redirections.entryPoint.scheme: https
# entryPoints.web.http.redirections.entrypoint.permanent: true
certificatesResolvers.letsencrypt.acme.email: "[email protected]"
certificatesResolvers.letsencrypt.acme.storage: "/letsencrypt/acme.json"
certificatesResolvers.letsencrypt.acme.httpchallenge: true
Expand Down
4 changes: 2 additions & 2 deletions config/environments/production.rb
Original file line number Diff line number Diff line change
Expand Up @@ -82,13 +82,13 @@

# Ignore bad email addresses and do not raise email delivery errors.
# Set this to true and configure the email server for immediate delivery to raise delivery errors.
# config.action_mailer.raise_delivery_errors = false
config.action_mailer.raise_delivery_errors = false

config.action_mailer.smtp_settings = {
address: ENV.fetch('SMTP_ADDRESS', 'smtp.ionos.it'),
port: ENV.fetch('SMTP_PORT', 587),
user_name: ENV.fetch('SMTP_USERNAME', '[email protected]'),
password: ENV.fetch('SMTP_PASSWORD', 'password'),
password: Rails.application.credentials.dig(:smtp, :password),
authentication: 'plain',
enable_starttls: true
}
Expand Down
2 changes: 1 addition & 1 deletion config/initializers/devise.rb
Original file line number Diff line number Diff line change
Expand Up @@ -183,7 +183,7 @@
# Email regex used to validate email formats. It simply asserts that
# one (and only one) @ exists in the given string. This is mainly
# to give user feedback and not to assert the e-mail validity.
config.email_regexp = /\A[^@\s]+@[^@\s]+\z/
config.email_regexp = URI::MailTo::EMAIL_REGEXP

# ==> Configuration for :timeoutable
# The time you want to timeout the user session without activity. After this
Expand Down

0 comments on commit d0b98e5

Please sign in to comment.