From 7ec019fda61d9907429270e2d874170c25957b51 Mon Sep 17 00:00:00 2001 From: Absurdon Date: Mon, 14 Oct 2019 22:26:43 +0200 Subject: [PATCH] Fixing Password Rest * Reverting 'forgot' view back to a form * Adding smtp configuration for production * Adding postfix image to docker-compose --- .dockerignore | 3 +++ .gitignore | 3 +++ app/views/users/forgot.html.erb | 19 +++++++++++++++++-- config/environments/production.rb | 9 +++++++-- docker-compose.yml | 10 ++++++++++ 5 files changed, 40 insertions(+), 4 deletions(-) diff --git a/.dockerignore b/.dockerignore index 1585cd9..d642227 100644 --- a/.dockerignore +++ b/.dockerignore @@ -1,2 +1,5 @@ Dockerfile db_data +dkim +log/* +public/* \ No newline at end of file diff --git a/.gitignore b/.gitignore index 30f40f0..556dd07 100644 --- a/.gitignore +++ b/.gitignore @@ -18,6 +18,9 @@ db_data/* !db_data/.placeholder +# ignore dkim keys +dkim + # OS X .DS_Store diff --git a/app/views/users/forgot.html.erb b/app/views/users/forgot.html.erb index 2071200..1d81503 100644 --- a/app/views/users/forgot.html.erb +++ b/app/views/users/forgot.html.erb @@ -1,7 +1,22 @@

Password Recovery

-

We are currently unable to send automated emails!

-

Please see the guide here on instructions on requesting a password reset.

+

If you do not receive your new password by email, please see the guide here.

+ + <%= form_tag({ controller: 'users', action: 'forgot' }, { class: 'square' }) do %> +
+ <%= label_tag :username %> + <%= text_field_tag :username %> +
+ +
+ <%= label_tag :email %> + <%= text_field_tag :email %> +
+ +
+ <%= submit_tag "Recover password" %> +
+ <% end %>

Special characters have been removed from nicks.
You may need to diff --git a/config/environments/production.rb b/config/environments/production.rb index 692d211..39197c9 100644 --- a/config/environments/production.rb +++ b/config/environments/production.rb @@ -48,8 +48,13 @@ Ensl::Application.configure do # Disable delivery errors, bad email addresses will be ignored # config.action_mailer.raise_delivery_errors = false - # Use sendmail - config.action_mailer.delivery_method = :sendmail + # Use smtp-Server + config.action_mailer.delivery_method = :smtp + config.action_mailer.smtp_settings = { + address: 'smtp', + domain: 'ensl.org' + } + config.action_mailer.raise_delivery_errors = true # Enable threaded mode diff --git a/docker-compose.yml b/docker-compose.yml index dcc24a7..c0e10fb 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -5,11 +5,13 @@ services: image: ensl/ensl.org:latest volumes: - "../public:/var/www/public" + - "../logs:/var/www/log" ports: - "4000:4000" depends_on: - db - memcached + - smtp # - redis db: image: mariadb:latest @@ -26,5 +28,13 @@ services: # - MYSQL_ROOT_HOST memcached: image: memcached:latest + smtp: + image: mwader/postfix-relay:latest + restart: always + volumes: + - "../dkim:/etc/opendkim/keys" + environment: + - POSTFIX_myhostname=ensl.org + - OPENDKIM_DOMAINS=ensl.org #redis: # image: redis