mirror of
https://github.com/MatthewL246/pretendo-docker.git
synced 2026-04-25 08:04:02 -05:00
Switch from MailDev to Mailpit
This commit is contained in:
parent
f0c300abc3
commit
70df1c0aa8
2
.github/compose.ci.yml
vendored
2
.github/compose.ci.yml
vendored
|
|
@ -27,7 +27,7 @@ services:
|
|||
redis-commander:
|
||||
restart: no
|
||||
ports: !reset []
|
||||
maildev:
|
||||
mailpit:
|
||||
restart: no
|
||||
ports: !reset []
|
||||
postgres:
|
||||
|
|
|
|||
19
compose.yml
19
compose.yml
|
|
@ -144,28 +144,23 @@ services:
|
|||
env_file:
|
||||
- ./environment/redis-commander.env
|
||||
|
||||
# TODO: MailDev appears to be unmaintained and has security vulnerabilities.
|
||||
# Find an alternative. MailCatcher doesn't support persistance, and MailHog
|
||||
# also seems unmaintained.
|
||||
maildev:
|
||||
image: maildev/maildev:latest
|
||||
mailpit:
|
||||
image: axllent/mailpit:latest
|
||||
depends_on:
|
||||
- coredns-internal
|
||||
restart: unless-stopped
|
||||
ports:
|
||||
# MailDev web UI
|
||||
# Mailpit web UI
|
||||
- 127.0.0.1:8084:8084
|
||||
volumes:
|
||||
- type: volume
|
||||
source: maildev-mail
|
||||
source: mailpit-mail
|
||||
target: /data
|
||||
networks:
|
||||
internal:
|
||||
dns: 172.20.0.200
|
||||
env_file:
|
||||
- ./environment/maildev.env
|
||||
# We need to set the user to root so that MailDev can write to the volume.
|
||||
user: root
|
||||
- ./environment/mailpit.env
|
||||
|
||||
postgres:
|
||||
image: postgres:alpine
|
||||
|
|
@ -218,7 +213,7 @@ services:
|
|||
- mongodb
|
||||
- minio
|
||||
- redis
|
||||
- maildev
|
||||
- mailpit
|
||||
restart: unless-stopped
|
||||
ports:
|
||||
# Node.js debugger
|
||||
|
|
@ -421,7 +416,7 @@ volumes:
|
|||
mongodb-database:
|
||||
minio-s3-data:
|
||||
redis-data:
|
||||
maildev-mail:
|
||||
mailpit-mail:
|
||||
postgres-database:
|
||||
|
||||
networks:
|
||||
|
|
|
|||
|
|
@ -23,7 +23,7 @@ to authenticate with the servers.
|
|||
| [Mongo Express](https://github.com/mongo-express/mongo-express) | Simple web GUI for MongoDB administration. | Open [127.0.0.1:8082](http://127.0.0.1:8082) in your browser with the container running. |
|
||||
| [MinIO](https://min.io/) | Object store compatable with the AWS S3 API. It is used as file storage and a CDN for the Pretendo servers. Mii images, Juxtaposition screenshots, and more are uploaded here. | Open [127.0.0.1:8083](http://127.0.0.1:8083) in your browser with the container running. |
|
||||
| [Redis](https://redis.io/) | Cache database used by the account server. | No administration necessary. |
|
||||
| [MailDev](https://maildev.github.io/maildev/) | SMTP server used to test sending emails from the account server. Use this to view your PNID email verification code. | Open [127.0.0.1:8084](http://127.0.0.1:8084) in your browser with the container running. |
|
||||
| [Mailpit](https://mailpit.axllent.org/) | SMTP server used to test sending emails from the account server. Use this to view your PNID email verification code. | Open [127.0.0.1:8084](http://127.0.0.1:8084) in your browser with the container running. |
|
||||
| [PostgreSQL](https://www.postgresql.org/) | Secondary database used by Friends and many game servers. | Use Adminer (see below) to view the databases and run SQL scripts. You can also download the [pgAdmin GUI](https://www.pgadmin.org/) and connect to `127.0.0.1:5432` to perform advanced administration tasks. |
|
||||
| [Adminer](https://www.adminer.org/) | Web GUI for database administration, used for Postgres. | Open [127.0.0.1:8085](http://127.0.0.1:8085) in your browser with the container running. |
|
||||
| [Redis Commander](https://joeferner.github.io/redis-commander/) | Web GUI for Redis database administration. | Open [127.0.0.1:8086](http://127.0.0.1:8086) in your browser with the container running. |
|
||||
|
|
|
|||
|
|
@ -10,11 +10,11 @@ PN_ACT_CONFIG_S3_ENDPOINT=http://minio.pretendo.cc
|
|||
PN_ACT_CONFIG_S3_ACCESS_KEY=minio_pretendo
|
||||
PN_ACT_CONFIG_CDN_BASE_URL=http://pretendo-cdn.b-cdn.net
|
||||
PN_ACT_CONFIG_CDN_SUBDOMAIN=cdn
|
||||
PN_ACT_CONFIG_EMAIL_HOST=maildev
|
||||
PN_ACT_CONFIG_EMAIL_HOST=mailpit
|
||||
PN_ACT_CONFIG_EMAIL_PORT=1025
|
||||
PN_ACT_CONFIG_EMAIL_SECURE=false
|
||||
PN_ACT_CONFIG_EMAIL_USERNAME=pretendo_mail
|
||||
PN_ACT_CONFIG_EMAIL_PASSWORD=password
|
||||
PN_ACT_CONFIG_EMAIL_FROM="Jon Pretendo <jon@maildev.pretendo.cc>"
|
||||
PN_ACT_CONFIG_EMAIL_FROM="Jon Pretendo <jon@mail.pretendo.cc>"
|
||||
PN_ACT_CONFIG_GRPC_PORT=5000
|
||||
PN_ACT_CONFIG_SERVER_ENVIRONMENT=prod
|
||||
|
|
|
|||
|
|
@ -1,3 +0,0 @@
|
|||
MAILDEV_SMTP_PORT=1025
|
||||
MAILDEV_WEB_PORT=8084
|
||||
MAILDEV_MAIL_DIRECTORY=/data
|
||||
3
environment/mailpit.env
Normal file
3
environment/mailpit.env
Normal file
|
|
@ -0,0 +1,3 @@
|
|||
MP_SMTP_BIND_ADDR=0.0.0.0:1025
|
||||
MP_UI_BIND_ADDR=0.0.0.0:8084
|
||||
MP_DATABASE=/data/mailpit.db
|
||||
|
|
@ -22,7 +22,7 @@ mkdir -p "$backup_dir"
|
|||
print_info "Backing up to $backup_dir"
|
||||
|
||||
print_info "Starting necessary services..."
|
||||
compose_no_progress up -d mitmproxy-pretendo mongodb postgres minio redis
|
||||
compose_no_progress up -d mitmproxy-pretendo mongodb postgres minio redis mailpit
|
||||
|
||||
print_info "Backing up MongoDB..."
|
||||
run_verbose docker compose exec mongodb rm -rf /tmp/backup
|
||||
|
|
@ -49,4 +49,7 @@ run_verbose compose_no_progress cp redis:/data/dump.rdb "$backup_dir/redis.rdb"
|
|||
print_info "Backing up Mitmproxy..."
|
||||
run_verbose compose_no_progress cp mitmproxy-pretendo:/home/mitmproxy/.mitmproxy "$backup_dir/mitmproxy"
|
||||
|
||||
print_info "Backing up Mailpit..."
|
||||
run_verbose compose_no_progress cp mailpit:/data/mailpit.db "$backup_dir/mailpit.db"
|
||||
|
||||
print_success "Backup completed successfully."
|
||||
|
|
|
|||
|
|
@ -31,7 +31,7 @@ fi
|
|||
print_info "Stopping unnecessary services..."
|
||||
compose_no_progress down
|
||||
print_info "Starting necessary services..."
|
||||
compose_no_progress up -d mitmproxy-pretendo mongodb postgres minio redis
|
||||
compose_no_progress up -d mitmproxy-pretendo mongodb postgres minio redis mailpit
|
||||
|
||||
print_info "Restoring MongoDB..."
|
||||
run_verbose docker compose exec mongodb rm -rf /tmp/backup
|
||||
|
|
@ -61,6 +61,10 @@ print_info "Restoring Mitmproxy..."
|
|||
run_verbose compose_no_progress stop mitmproxy-pretendo
|
||||
run_verbose compose_no_progress cp "$backup_dir/mitmproxy" mitmproxy-pretendo:/home/mitmproxy/.mitmproxy
|
||||
|
||||
print_info "Restoring Mailpit..."
|
||||
run_verbose compose_no_progress stop mailpit
|
||||
run_verbose compose_no_progress cp "$backup_dir/mailpit.db" mailpit:/data/mailpit.db
|
||||
|
||||
# The restored backup might be using different secrets than what are currently in the .env files
|
||||
"$git_base_dir/scripts/setup-environment.sh" --force
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user