tenseleyflow/shithub / 7f1eb93

Browse files

Add MailHog service + dev-email make targets + auth env example

Authored by mfwolffe <wolffemf@dukes.jmu.edu>
SHA
7f1eb93c5814560803e1000e2939a4c41b687b03
Parents
642c924
Tree
5118601

3 changed files

StatusFile+-
M .env.example 14 0
M Makefile 7 0
M docker-compose.yml 11 0
.env.examplemodified
@@ -29,3 +29,17 @@ SHITHUB_STORAGE__S3__SECRET_ACCESS_KEY=shithub-dev-secret-please-change
2929
 SHITHUB_STORAGE__S3__BUCKET=shithub-dev
3030
 SHITHUB_STORAGE__S3__USE_SSL=false
3131
 SHITHUB_STORAGE__S3__FORCE_PATH_STYLE=true
32
+
33
+# ----- auth (S05) -----
34
+# Set false in dev for fast iteration; keep true in prod.
35
+SHITHUB_AUTH__REQUIRE_EMAIL_VERIFICATION=false
36
+# Used for the link in transactional emails — set to your public origin in prod.
37
+SHITHUB_AUTH__BASE_URL=http://127.0.0.1:8080
38
+SHITHUB_AUTH__SITE_NAME=shithub
39
+SHITHUB_AUTH__EMAIL_FROM=shithub <noreply@shithub.local>
40
+# stdout (default in dev), smtp (MailHog), or postmark.
41
+SHITHUB_AUTH__EMAIL_BACKEND=stdout
42
+# When email_backend=smtp:
43
+SHITHUB_AUTH__SMTP__ADDR=127.0.0.1:1025
44
+# When email_backend=postmark:
45
+# SHITHUB_AUTH__POSTMARK__SERVER_TOKEN=...
Makefilemodified
@@ -101,6 +101,13 @@ dev-storage-reset: ## Drop the MinIO volume and re-seed.
101101
 storage-check: build ## Run shithubd storage check against the configured backend.
102102
 	./bin/shithubd storage check
103103
 
104
+dev-email: ## Bring up MailHog for local email capture (S05).
105
+	docker compose up -d mailhog
106
+	@echo "MailHog SMTP: 127.0.0.1:1025  web UI: http://127.0.0.1:8025"
107
+
108
+dev-email-down: ## Stop MailHog.
109
+	docker compose stop mailhog
110
+
104111
 migrate-up: ## Apply all pending migrations.
105112
 	./bin/shithubd migrate up
106113
 
docker-compose.ymlmodified
@@ -60,6 +60,17 @@ services:
6060
       retries: 10
6161
       start_period: 10s
6262
 
63
+  # Local SMTP catcher (S05). The shithub auth flow writes signup /
64
+  # password-reset emails here when SHITHUB_AUTH__EMAIL_BACKEND=smtp.
65
+  # Web UI: http://127.0.0.1:8025
66
+  mailhog:
67
+    image: mailhog/mailhog:latest
68
+    container_name: shithub-mailhog
69
+    restart: unless-stopped
70
+    ports:
71
+      - "127.0.0.1:1025:1025" # SMTP
72
+      - "127.0.0.1:8025:8025" # web UI
73
+
6374
   # One-shot init: creates the shithub-dev bucket via mc.
6475
   minio-init:
6576
     image: minio/mc:latest