-
-
Notifications
You must be signed in to change notification settings - Fork 58
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'anonaddy:master' into feature-tls-traefik
- Loading branch information
Showing
32 changed files
with
1,162 additions
and
779 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,2 @@ | ||
* @crazy-max | ||
* @crazy-max | ||
examples/nginx/ @eleith |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
# Prerequisites | ||
|
||
Read [self-hosting docs](https://anonaddy.com/self-hosting/) | ||
|
||
## Let's Encrypt | ||
|
||
Generate your certificates and make note of where they are stored. if you use | ||
certbot, they are generally in `/etc/letsencrypt/live`. | ||
|
||
## Generate strong dhparam | ||
|
||
```sh | ||
sudo openssl dhparam -out dhparam.pem 4096 | ||
``` | ||
|
||
## Configure mounts for nginx | ||
|
||
The `docker-compose.yml` may need some adjusting to properly mount your | ||
specific let's encrypt and dhparam certs. | ||
|
||
## Rspamd web ui | ||
|
||
This nginx configuration supports rspamd web ui out of the box. if you choose | ||
to not run rspamd, make sure to remove the `RSPAMD_ENABLE` variable in | ||
`anonaddy.env` and remove the proxy block in `nginx/templates/default.conf.template`. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
TZ=Europe/Paris | ||
PUID=1000 | ||
PGID=1000 | ||
|
||
MEMORY_LIMIT=256M | ||
UPLOAD_MAX_SIZE=16M | ||
OPCACHE_MEM_SIZE=128 | ||
REAL_IP_FROM=0.0.0.0/32 | ||
REAL_IP_HEADER=X-Forwarded-For | ||
LOG_IP_VAR=remote_addr | ||
|
||
APP_KEY=base64:KJ1LX0w15ItOoMWdC+DNW2Bt0Z4sT98zu0XQ8Zfaf9o= | ||
APP_DEBUG=false | ||
APP_URL=http://127.0.0.1:8000 | ||
|
||
ANONADDY_RETURN_PATH=[email protected] | ||
ANONADDY_ADMIN_USERNAME=anonaddy | ||
ANONADDY_ENABLE_REGISTRATION=true | ||
ANONADDY_DOMAIN=example.com | ||
ANONADDY_ALL_DOMAINS=example.com | ||
ANONADDY_HOSTNAME=mail.example.com | ||
ANONADDY_DNS_RESOLVER=127.0.0.1 | ||
ANONADDY_SECRET=lksjflk2u3j4oij2elkru23oi4uj2lkjflsakfjoi23u4 | ||
ANONADDY_LIMIT=200 | ||
ANONADDY_BANDWIDTH_LIMIT=104857600 | ||
ANONADDY_NEW_ALIAS_LIMIT=10 | ||
ANONADDY_ADDITIONAL_USERNAME_LIMIT=3 | ||
|
||
MAIL_FROM_NAME=AnonAddy | ||
MAIL_FROM_ADDRESS=[email protected] | ||
|
||
POSTFIX_DEBUG=false | ||
POSTFIX_SMTPD_TLS=false | ||
POSTFIX_SMTP_TLS=false | ||
|
||
RSPAMD_ENABLE=true | ||
RSPAMD_WEB_PASSWORD=abc |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,58 @@ | ||
version: "3.5" | ||
|
||
services: | ||
db: | ||
image: mariadb:10.5 | ||
container_name: anonaddy_db | ||
command: | ||
- "mysqld" | ||
- "--character-set-server=utf8mb4" | ||
- "--collation-server=utf8mb4_unicode_ci" | ||
volumes: | ||
- "./db:/var/lib/mysql" | ||
environment: | ||
- "MYSQL_ALLOW_EMPTY_PASSWORD=yes" | ||
- "MYSQL_DATABASE" | ||
- "MYSQL_USER" | ||
- "MYSQL_PASSWORD" | ||
restart: always | ||
|
||
redis: | ||
image: redis:4.0-alpine | ||
container_name: anonaddy_redis | ||
restart: always | ||
|
||
anonaddy: | ||
image: anonaddy/anonaddy:latest | ||
container_name: anonaddy | ||
depends_on: | ||
- db | ||
- redis | ||
ports: | ||
- target: 25 | ||
published: 25 | ||
protocol: tcp | ||
volumes: | ||
- "./data:/data" | ||
env_file: | ||
- "./anonaddy.env" | ||
environment: | ||
- "DB_HOST=db" | ||
- "DB_DATABASE=${MYSQL_DATABASE}" | ||
- "DB_USERNAME=${MYSQL_USER}" | ||
- "DB_PASSWORD=${MYSQL_PASSWORD}" | ||
- "REDIS_HOST=redis" | ||
restart: always | ||
|
||
nginx: | ||
image: nginx:1.20.1-alpine | ||
container_name: anonaddy_nginx | ||
restart: unless-stopped | ||
ports: | ||
- '443:443' | ||
volumes: | ||
- /etc/ssl/dhparam.pem:/etc/ssl/dhparam.pem | ||
- ./nginx/templates:/etc/nginx/templates | ||
- /etc/letsencrypt:/etc/letsencrypt | ||
depends_on: | ||
- anonaddy |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,64 @@ | ||
server { | ||
listen 80; | ||
listen [::]:80; | ||
|
||
server_name example.com; | ||
return 301 https://$server_name$request_uri; | ||
} | ||
|
||
server { | ||
listen 443 ssl http2; | ||
listen [::]:443 ssl http2; | ||
server_name example.com; | ||
server_tokens off; | ||
|
||
add_header X-Frame-Options "SAMEORIGIN"; | ||
add_header X-XSS-Protection "1; mode=block"; | ||
add_header X-Content-Type-Options "nosniff"; | ||
add_header Strict-Transport-Security "max-age=63072000; includeSubDomains; preload"; | ||
add_header Content-Security-Policy "default-src 'self'; script-src 'self' 'unsafe-inline' 'unsafe-eval'; img-src 'self' data:; style-src 'self' 'unsafe-inline'; font-src 'self'; object-src 'none'"; | ||
add_header Referrer-Policy "origin-when-cross-origin"; | ||
add_header Expect-CT "enforce, max-age=604800"; | ||
|
||
charset utf-8; | ||
|
||
ssl_certificate /etc/letsencrypt/live/example.com/fullchain.pem; | ||
ssl_certificate_key /etc/letsencrypt/live/example.com/privkey.pem; | ||
ssl_trusted_certificate /etc/letsencrypt/live/example.com/chain.pem; | ||
|
||
ssl_prefer_server_ciphers on; | ||
ssl_session_timeout 5m; | ||
ssl_protocols TLSv1.2 TLSv1.3; | ||
ssl_stapling on; | ||
ssl_stapling_verify on; | ||
ssl_ciphers "ECDHE-ECDSA-AES128-GCM-SHA256:ECDHE-RSA-AES128-GCM-SHA256:ECDHE-ECDSA-AES256-GCM-SHA384:ECDHE-RSA-AES256-GCM-SHA384:ECDHE-ECDSA-CHACHA20-POLY1305:ECDHE-RSA-CHACHA20-POLY1305:DHE-RSA-AES128-GCM-SHA256:DHE-RSA-AES256-GCM-SHA384"; | ||
ssl_ecdh_curve secp384r1; | ||
ssl_session_cache shared:SSL:20m; | ||
ssl_session_tickets off; | ||
ssl_dhparam /etc/ssl/dhparam.pem; | ||
|
||
location = /robots.txt { | ||
add_header Content-Type text/plain; | ||
return 200 "User-agent: *\nDisallow: /\n"; | ||
} | ||
|
||
location /rspamd { | ||
proxy_pass http://anonaddy:11334; | ||
|
||
proxy_set_header Host $host; | ||
proxy_set_header X-Real-IP $remote_addr; | ||
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; | ||
proxy_set_header X-Forwarded-Proto $scheme; | ||
} | ||
|
||
location / { | ||
proxy_pass http://anonaddy:8000; | ||
|
||
proxy_redirect off; | ||
proxy_set_header Host $host; | ||
proxy_set_header X-Real-IP $remote_addr; | ||
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; | ||
proxy_set_header X-Forwarded-Proto $scheme; | ||
proxy_read_timeout 90s; | ||
} | ||
} |
Oops, something went wrong.