Skip to content

Commit dfa5623

Browse files
Rub21geohacker
authored andcommitted
Update documentation for email sender and delete unused files
1 parent b42b468 commit dfa5623

File tree

6 files changed

+30
-187
lines changed

6 files changed

+30
-187
lines changed

envs/.env.web.example

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -5,20 +5,21 @@
55
SERVER_URL=127.0.0.1
66
SERVER_PROTOCOL=http
77

8-
# Mailer settings
8+
# Mailer settings for SES - AWS
99
MAILER_ADDRESS=email-smtp.us-east-1.amazonaws.com
1010
MAILER_DOMAIN=osmseed.org
1111
MAILER_USERNAME=...
1212
MAILER_PASSWORD=...
1313
14+
MAILER_PORT=25
1415

15-
# Mailer settings for gmail, you need to enable "IMAP Access" and "Allow less secure apps"
16+
# # Mailer settings for gmail
1617
MAILER_ADDRESS=smtp.gmail.com
17-
MAILER_DOMAIN=localhost
18+
MAILER_DOMAIN=gmail.com
1819
19-
MAILER_PASSWORD=abc
20+
MAILER_PASSWORD=abc...
2021
21-
22+
MAILER_PORT=25
2223

2324
# Nominatim settings
2425
NOMINATIM_URL=nominatim-api

images/web/README.md

Lines changed: 18 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,16 +2,31 @@
22

33
The docker container installs dependencies required for the website, checks out the latest openstreetmap-website code from github and sets up config files.
44

5-
### Configuration
5+
# Configuration
66

77
In order to run this container we need environment variables, these can be found in the following files👇:
88

99
- [.env.web.example](./../../.env.web.example)
1010
- [.env.db.example](./../../.env.db.example)
1111

12-
**Note**: Rename the above files as `.env.web` and `.env.db`
12+
**Note**:
13+
- Rename the above files as `.env.web` and `.env.db`
1314

14-
### Running web container
15+
### Email configuration
16+
17+
For sending email it is necessary to set the required variables, osm-seed has been tested with gmail and SES-AWS providers - SMTP.
18+
- Gmail
19+
- Use or create an existing email account.
20+
- Make sure "IMAP Access" and "Allow less secure apps" are enabled in your account.
21+
22+
- SES AWS
23+
- You have to create verified email or domain in you AWs acount.
24+
- Create an SMTP user, it will give you a user and password.
25+
- You have to activate SES for production, otherwise you can only send email to verified emails.
26+
27+
Find examples oh how to setup the configuration for each provider at [.env.web.example](./../../.env.web.example)
28+
29+
# Running web container
1530

1631
```sh
1732
# Docker compose

images/web/config/action_mailer.rb

Lines changed: 0 additions & 16 deletions
This file was deleted.

images/web/config/application.yml

Lines changed: 0 additions & 143 deletions
This file was deleted.

images/web/config/database.yml

Lines changed: 0 additions & 9 deletions
This file was deleted.

images/web/start.sh

Lines changed: 6 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,7 @@
11
#!/usr/bin/env bash
22
workdir="/var/www"
3-
43
export RAILS_ENV=production
5-
# Because we can not set up many env variable sin build process, we are going to process here!
4+
#### Because we can not set up many env variable in build process, we are going to process here!
65

76
#### SETTING UP THE PRODUCTION DATABASE
87
echo " # Production DB
@@ -25,10 +24,11 @@ sed -i -e 's/smtp_enable_starttls_auto: false/smtp_enable_starttls_auto: true/g'
2524
sed -i -e 's/smtp_authentication: null/smtp_authentication: "login"/g' $workdir/config/settings.yml
2625
sed -i -e 's/smtp_user_name: null/smtp_user_name: "'$MAILER_USERNAME'"/g' $workdir/config/settings.yml
2726
sed -i -e 's/smtp_password: null/smtp_password: "'$MAILER_PASSWORD'"/g' $workdir/config/settings.yml
28-
# sed -i -e 's/smtp_port: 25/smtp_port: '$MAILER_PORT'/g' $workdir/config/settings.yml
29-
sed -i -e 's/email_from: "OpenStreetMap <[email protected]>"/email_from: "'$MAILER_FROM'"/g' $workdir/config/settings.yml
27+
sed -i -e 's/[email protected]/'$MAILER_FROM'/g' $workdir/config/settings.yml
28+
[[ -z "$MAILER_PORT" ]] && MAILER_PORT=25
29+
sed -i -e 's/smtp_port: 25/smtp_port: '$MAILER_PORT'/g' $workdir/config/settings.yml
3030

31-
# Check if DB is already up
31+
#### CHECK IF DB IS ALREADY UP AND START THE APP
3232
flag=true
3333
while "$flag" = true; do
3434
pg_isready -h $POSTGRES_HOST -p 5432 >/dev/null 2>&2 || continue
@@ -39,13 +39,8 @@ while "$flag" = true; do
3939
sleep 2
4040
done &
4141

42-
# Precompile again, to catch the env variables
43-
# rake i18n:js:export assets:precompile --trace
44-
# db:migrate
4542
bundle exec rails db:migrate
46-
# Start the delayed jobs queue worker
47-
# bundle exec rake jobs:work
48-
# Start the app
43+
# Start the delayed jobs queue worker and Start the app
4944
bundle exec rake jobs:work &
5045
apachectl -k start -DFOREGROUND
5146
done

0 commit comments

Comments
 (0)