Skip to content

Commit

Permalink
Merge pull request #574 from memeLab/update-local-smtp
Browse files Browse the repository at this point in the history
Update local smtp
  • Loading branch information
pablodiegoss authored Oct 26, 2024
2 parents 8b012b4 + c2bab27 commit 7cc6bef
Show file tree
Hide file tree
Showing 6 changed files with 123 additions and 7 deletions.
4 changes: 2 additions & 2 deletions .envs/.example
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ POSTGRES_USER=jandig
POSTGRES_PASSWORD=secret

# Email server variables
SMTP_SERVER=smtp.gmail.com
SMTP_PORT=587
SMTP_SERVER=mailpit
SMTP_PORT=1025
JANDIG_EMAIL=local_jandig@jandig.com
JANDIG_EMAIL_PASSWORD=local_password
24 changes: 21 additions & 3 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,8 @@ services:
condition: service_started
createbuckets:
condition: service_started
mailpit:
condition: service_started
postgres:
condition: service_healthy
command: /jandig/run.sh
Expand Down Expand Up @@ -49,15 +51,15 @@ services:
volumes:
- media_data:/storage
env_file:
- .envs/.env
- .envs/.example
command: server /storage --console-address ":9001"

createbuckets:
image: minio/mc:RELEASE.2022-09-16T09-16-47Z
depends_on:
- storage
env_file:
- .envs/.env
- .envs/.example
entrypoint: >
/bin/sh -c "
until (/usr/bin/mc config host add myminio $${MINIO_S3_ENDPOINT_URL} $${MINIO_ROOT_USER} $${MINIO_ROOT_PASSWORD}) do echo '...waiting...' && sleep 1; done;
Expand All @@ -68,7 +70,23 @@ services:
/usr/bin/mc admin policy set myminio readwrite user=$${MINIO_USER_ACCESS_KEY};
exit 0;
"
mailpit:
image: axllent/mailpit
volumes:
- mailpit_data:/data
- ./etc/mailpit/:/self_signed/
ports:
- 8025:8025
- 1025:1025
environment:
MP_MAX_MESSAGES: 5000
MP_DATABASE: /data/mailpit.db
MP_SMTP_AUTH_ACCEPT_ANY: 1
MP_SMTP_AUTH_ALLOW_INSECURE: 1
MP_SMTP_TLS_CERT: /self_signed/mailpit_cert.pem
MP_SMTP_TLS_KEY: /self_signed/mailpit_key.pem

volumes:
postgres_data:
media_data:
media_data:
mailpit_data:
10 changes: 10 additions & 0 deletions etc/mailpit/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
# Mailpit configuration:
Reference: https://mailpit.axllent.org/docs/configuration/certificates/

The following command will generate a self-signed certificate and key (both needed for Mailpit) which is valid for 10 years:

```
openssl req -x509 -newkey rsa:4096 \
-nodes -keyout mailpit_key.pem -out mailpit_cert.pem \
-sha256 -days 3650
```
33 changes: 33 additions & 0 deletions etc/mailpit/mailpit_cert.pem
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
-----BEGIN CERTIFICATE-----
MIIFsTCCA5mgAwIBAgIUEdY/Ljoa1qs4Wk+7iWlpAokmkzQwDQYJKoZIhvcNAQEL
BQAwaDELMAkGA1UEBhMCQlIxEjAQBgNVBAgMCVNhbyBQYXVsbzESMBAGA1UEBwwJ
U2FvIFBhdWxvMQ8wDQYDVQQKDAZKYW5kaWcxDDAKBgNVBAsMA0FSdDESMBAGA1UE
AwwJbG9jYWxob3N0MB4XDTI0MTAyNjE2MDYwNFoXDTM0MTAyNDE2MDYwNFowaDEL
MAkGA1UEBhMCQlIxEjAQBgNVBAgMCVNhbyBQYXVsbzESMBAGA1UEBwwJU2FvIFBh
dWxvMQ8wDQYDVQQKDAZKYW5kaWcxDDAKBgNVBAsMA0FSdDESMBAGA1UEAwwJbG9j
YWxob3N0MIICIjANBgkqhkiG9w0BAQEFAAOCAg8AMIICCgKCAgEAvZ2euy9sDkUI
DuUEc9WDIBKsPUl8JuW1dk7F0+H3uq+B8RSHqmh8F+FYn0c4tU55h6/Pq7DdSaMv
AVnnKr7lny+IWnEtmBLv6igzql/ce7N3f+025dP6x/4Gd29TVKx4faTQTDxHF2PK
rINl1uPF82wqii2QL5oBSNEmR0ASEsPjjLLFd35QjAdO4pSKj5UV4fUMGRo1M4y+
2Wq3szp31SNGfsS3yxT2A7Rp+VvYf2NuW3ajivvga8iL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DoyIANAdDiHvO+Bukcx5K/bPUsure7F0XdjtjKPYpRjN1pWW9HTC
ESa/jBvEab0Glb4ngqrcKHs6TvLA2OxiUKpwVNO6TkU93P+/lEWalIyn2BRgKV69
Qias+xfiU1CiuflP6zkzTq5JWbaI0qENBfzUT1sJSSI6LfEAMafSWKL2BcBsLT7a
cGLldaUHc8Vqm9fAFVq0p6+zxFkm
-----END CERTIFICATE-----
52 changes: 52 additions & 0 deletions etc/mailpit/mailpit_key.pem
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
-----BEGIN PRIVATE KEY-----
MIIJQgIBADANBgkqhkiG9w0BAQEFAASCCSwwggkoAgEAAoICAQC9nZ67L2wORQgO
5QRz1YMgEqw9SXwm5bV2TsXT4fe6r4HxFIeqaHwX4VifRzi1TnmHr8+rsN1Joy8B
WecqvuWfL4hacS2YEu/qKDOqX9x7s3d/7Tbl0/rH/gZ3b1NUrHh9pNBMPEcXY8qs
g2XW48XzbCqKLZAvmgFI0SZHQBISw+OMssV3flCMB07ilIqPlRXh9QwZGjUzjL7Z
arezOnfVI0Z+xLfLFPYDtGn5W9h/Y25bdqOK++BryIvHnYEDpe0EKHq3jGcl9xXl
d6LchhswVCXx9y8wzXu9rvDagAhsq0xXyd31xZdpHG9agTF3OBePOwQkXC/+B4xq
yf0FVoca5H6+VsFqFiX0YDGksRbs6Db1LId8oqAYCabq02Z6Cub9LrCLPBTkj5fP
TfqEYUQbKxrY11TZbNwFdSvPimyRVcxqqYKjSs/ZvviYapTSmkB8j/CqxAp5Rl/H
X7RJM7iv1PGXOyWsPmLh4YHbU/BHx1XZcdQJYaPNEPOmIzqGdiBedPwM3VMs8Pyn
DUJkLvdOqg5Tl2fdSz+twE1YCncZvT+AfK+xRsrJPNfxSDU2rVd+sPtb0KOBNy/O
wnc4vgW/EV4B4/BxlBOP9B2CuxCITDVs2yYJ/jgprGXHqu9VMJNmMkudyhfRUmgO
QmrzePns9Gi5A2AfktR8fj2wIm2jIwIDAQABAoICA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PHLAk2Qq/PSOxj15xLijLSSIR
p+311tdNzikExQpj9nqyw6NHMaEtV6f6Z1kux+XANe9xS7OkxiPLKLks2pV5hmnS
dQHadVDNwYSgAT4HMXFow/wg6Fh9kcJDJkImPy+R10IWuBAlgwcfGuKMG0Gb6mzW
amvfzW+vn9EGIALuT6YG2TpAKKES6ykfqHrbADPhQ/Q4ggWnn+05arFiQq5I4Qsm
d4AgAbGPCq2WZ7kxKCVgOJv1EbmDrVFvu0fDSaIJyaMgIaGYyQZwARd4NHZBiXCS
hFvkWRZjMYs0AR0xU827vN7rn5Mfpw==
-----END PRIVATE KEY-----
7 changes: 5 additions & 2 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
[tool.poetry]
package-mode = false
name="Jandig"
version="1.5.0"
description="AR Platform"
authors=["Check Github"]

[tool.poetry.dependencies]
python = "^3.10"
Expand Down Expand Up @@ -27,7 +30,7 @@ djangorestframework = "^3.13.1"
drf-nested-routers = "^0.93.4"
django-htmx = "^1.18.0"

[tool.poetry.dev-dependencies]
[tool.poetry.group.dev.dependencies]
playwright = "^1.41.2"
pytest = "^7.2.0"
pytest-xdist = "^3.0.2"
Expand Down

0 comments on commit 7cc6bef

Please sign in to comment.