Skip to content

Commit

Permalink
[frontend] Introduces mailcatcher
Browse files Browse the repository at this point in the history
This introduces mailcatcher to the development environment to make debugging
ActiveMailer related things easier.

You can view all mails sent by OBS at http://localhost:1080

Hint: Mails will only be sent if your Configuration.obs_url is set to some url or
your Configuration was created after 2018-02-21
  • Loading branch information
hennevogel committed Feb 23, 2018
1 parent 347110c commit eb82f6c
Show file tree
Hide file tree
Showing 5 changed files with 10 additions and 9 deletions.
1 change: 1 addition & 0 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ services:
- .:/obs
ports:
- "3000:3000"
- "1080:1080"
depends_on:
- db
- cache
Expand Down
1 change: 1 addition & 0 deletions docker-files/base/docker-bootstrap.sh
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ do
phantomjs \
nodejs6 npm6 \
mariadb-client \
sqlite3-devel \
git-core \
ruby2.5-devel cyrus-sasl-devel openldap2-devel libxml2-devel zlib-devel libxslt-devel \
perl-XML-Parser \
Expand Down
2 changes: 1 addition & 1 deletion src/api/Dockerfile.frontend-base
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ RUN for i in ruby gem irb; do ln -s /usr/bin/$i.ruby2.5 /usr/local/bin/$i; done

# foreman, which we only run in docker, needs a different thor version than OBS.
# Installing the gem directly spares us from having to rpm package two different thor versions.
RUN gem.ruby2.5 install --no-format-executable thor:0.19 foreman
RUN gem.ruby2.5 install --no-format-executable thor:0.19 foreman mailcatcher

# We copy the Gemfiles into this intermediate build stage so it's checksum
# changes and all the subsequent stages (a.k.a. the bundle install call below)
Expand Down
1 change: 1 addition & 0 deletions src/api/Procfile
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,4 @@ web: bundle exec rails server
delayed: bundle exec script/delayed_job.api.rb run
clock: bundle exec clockworkd --log-dir=log -l -c config/clock.rb run
search: bundle exec rake ts:rebuild NODETACH=true
mailcatcher: mailcatcher --ip 0.0.0.0 -f --no-quit -v
14 changes: 6 additions & 8 deletions src/api/config/environments/development.rb
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,12 @@
# Do not eager load code on boot.
config.eager_load = false

# see http://guides.rubyonrails.org/action_mailer_basics.html#example-action-mailer-configuration
config.action_mailer.delivery_method = :smtp
# we deliver to mailcatcher https://github.com/sj26/mailcatcher
config.action_mailer.smtp_settings = { address: '127.0.0.1', port: '1025' }
config.action_mailer.raise_delivery_errors = true

# Show full error reports and disable caching
config.consider_all_requests_local = true
config.action_controller.perform_caching = true
Expand All @@ -24,20 +30,12 @@
config.session_store = :mem_cache_store
end

# Don't care if the mailer can't send
config.action_mailer.raise_delivery_errors = false

config.action_mailer.delivery_method = :test

# Print deprecation notices to the Rails logger
config.active_support.deprecation = :log

# Only use best-standards-support built into browsers
config.action_dispatch.best_standards_support = :builtin

config.action_mailer.raise_delivery_errors = false
config.action_mailer.perform_caching = false

# Do not compress assets
config.assets.compress = false

Expand Down

0 comments on commit eb82f6c

Please sign in to comment.