fully working with e-mail support

This commit is contained in:
knoflook 2022-09-30 17:16:26 +02:00
parent 45fbf25a19
commit e4c18a4826
Signed by: knoflook
GPG Key ID: D6A1D0E8FC4FEF1C
3 changed files with 34 additions and 72 deletions

View File

@ -1,12 +1,27 @@
TYPE=karrot
DOMAIN=karrot.example.com
LETS_ENCRYPT_ENV=production
# account id for maxmind (for GeoIP)
MAXMIND_ACCOUNT_ID=
# License key for maxmind
MAXMIND_LICENSE_KEY=
SITE_NAME=karrot dev
SITE_LOGO=https://user-images.githubusercontent.com/31616/36565633-517373a4-1821-11e8-9948-5bf6887c667e.png
# postal,smtp,console
EMAIL_BACKEND=console
# only set those when using SMTP
#EMAIL_FROM=
# SMTP USER and EMAIL_FROM are usually the same
#SMTP_USER=
#SMTP_PASSWORD=
#SMTP_HOST=
#SMTP_USE_SLL=
#SMTP_USE_TLS=TRUE
#SMTP_PORT=587
SECRET_DB_PASSWORD_VERSION=v1
SITE_URL=https://${DOMAIN}
LETS_ENCRYPT_ENV=production

View File

@ -12,9 +12,10 @@ services:
- DOMAIN
healthcheck:
test: ["CMD", "curl", "-f", "http://localhost/api/bootstrap"]
interval: 30s
interval: 15s
timeout: 3s
retries: 30
retries: 2
start_period: 45s
networks:
- internal
- proxy
@ -46,8 +47,17 @@ services:
environment:
- MAXMIND_ACCOUNT_ID
- MAXMIND_LICENSE_KEY
- EMAIL_BACKEND=console
- SITE_URL=http://localhost:8000
- EMAIL_BACKEND
- EMAIL_FROM
- SMTP_USER
- SMTP_PASSWORD
- SMTP_HOST
- SMTP_USE_SLL
- SMTP_USE_TLS
- SMTP_PORT
- SITE_URL
- SITE_NAME
- SITE_LOGO
- LISTEN_HOST=0.0.0.0
- LISTEN_SERVER=uvicorn
- SECRET_KEY=foobar
@ -61,9 +71,10 @@ services:
- REDIS_DB=0
healthcheck:
test: ["CMD", "curl", "-f", "http://localhost:8000/api/"]
interval: 30s
interval: 15s
timeout: 3s
retries: 90
retries: 2
start_period: 45s
command: >
sh -c "
echo 'EditionIDs GeoLite2-City GeoLite2-Country' > /etc/GeoIP.conf &&
@ -87,7 +98,7 @@ services:
networks:
- internal
environment:
- SITE_URL=http://localhost:8000
- SITE_URL
- LISTEN_HOST=0.0.0.0
- LISTEN_SERVER=uvicorn
- SECRET_KEY=foobar

View File

@ -1,64 +0,0 @@
map $http_upgrade $connection_upgrade {
default upgrade;
'' close;
}
server {
listen 80;
server_name web;
root /usr/share/nginx/html;
location / {
try_files $uri /index.html;
if_modified_since off;
expires off;
etag off;
# TODO: csp headers
}
location /css {
expires max;
}
location /js {
expires max;
}
location /img {
expires max;
}
location /fonts {
expires max;
}
# /app/uploads
location /media/ {
alias /app/uploads/;
expires max;
}
location /community_proxy/ {
proxy_pass https://community.foodsaving.world/;
}
location ^\/(api(\-auth)?|docs|silk)\/ {
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $remote_addr;
proxy_set_header X-Forwarded-Proto $scheme;
# this port is whatever port 80 is mapped to outside the container
proxy_set_header Host $host:8080;
proxy_pass http://app:8000;
proxy_redirect off;
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection $connection_upgrade;
proxy_set_header Sec-WebSocket-Extensions $http_sec_websocket_extensions;
proxy_set_header Sec-WebSocket-Key $http_sec_websocket_key;
proxy_set_header Sec-WebSocket-Protocol $http_sec_websocket_protocol;
proxy_set_header Sec-WebSocket-Version $http_sec_websocket_version;
}
}