Skip to content

Commit

Permalink
Add email catcher to proxy system
Browse files Browse the repository at this point in the history
  • Loading branch information
JackMorganNZ committed May 4, 2022
1 parent 3ac0188 commit 4a60123
Show file tree
Hide file tree
Showing 4 changed files with 28 additions and 4 deletions.
2 changes: 1 addition & 1 deletion LICENSE
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
MIT License

Copyright (c) 2021 University of Canterbury Computer Science Education Research
Copyright (c) 2022 University of Canterbury Computer Science Education Research

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
Expand Down
13 changes: 11 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,13 +1,14 @@
# UCCSER Development Proxy

This proxy is used when working on the following UCCSER websites:
This proxy is required when working on the following UCCSER websites:

- [CS Unplugged](https://github.com/uccser/cs-unplugged)
- [CS Field Guide](https://github.com/uccser/cs-field-guide)
- [codeWOF](https://github.com/uccser/codewof)
- [DTHM for Kaiako](https://github.com/uccser/dthm4kaiako)

This proxy allows multiple systems to run on your development environment simultaneously.
This proxy allows multiple systems to run on your development environment simultaneously under HTTPS.
The proxy also includes a system for catching emails sent by these systems.

# Setup

Expand All @@ -26,8 +27,16 @@ The script will finish with telling you when the certificates expire, where you
To run the proxy, run `docker-compose up -d` in this project directory.
Docker will run the proxy in the background.

> **Tip:** Add an alias to the end of your `.bashrc` file that allows starting the proxy from anywhere.
> For example (you will need to modify the path to the docker compose file for your specific system):
> ```
> alias uc-dev="docker-compose -f ~/Projects/uccser-development-proxy/docker-compose.yml up -d"
> ```
You can view the dashboard of the proxy by opening a browser and going to `proxy.localhost` in your preferred web browser.
You can view the email system by opening a browser and going to `email.localhost` in your preferred web browser.
To view logs of the proxy, run `docker-compose logs -f traefik`.
Do shutdown the proxy, run `docker-compose down`.
Expand Down
2 changes: 1 addition & 1 deletion create-certs.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/bin/bash
mkcert -install
mkdir certs
mkcert -key-file certs/key.pem -cert-file certs/cert.pem proxy.localhost cs-unplugged.localhost *.cs-unplugged.localhost cs-field-guide.localhost *.cs-field-guide.localhost codewof.localhost *.codewof.localhost dthm4kaiako.localhost *.dthm4kaiako.localhost
mkcert -key-file certs/key.pem -cert-file certs/cert.pem proxy.localhost email.localhost cs-unplugged.localhost *.cs-unplugged.localhost cs-field-guide.localhost *.cs-field-guide.localhost codewof.localhost *.codewof.localhost dthm4kaiako.localhost *.dthm4kaiako.localhost
15 changes: 15 additions & 0 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,21 @@ services:
- "traefik.http.routers.traefik.rule=Host(`proxy.localhost`)"
- "traefik.http.routers.traefik.tls=true"

mailhog:
image: mailhog/mailhog:v1.0.1
container_name: uccser-development-email
networks:
- uccser-development-proxy
labels:
# General labels
- "traefik.enable=true"
- "traefik.http.services.mailhog.loadbalancer.server.port=8025"
# HTTPS
- "traefik.http.routers.mailhog.entryPoints=web-secure"
- "traefik.http.routers.mailhog.service=mailhog"
- "traefik.http.routers.mailhog.rule=Host(`email.localhost`)"
- "traefik.http.routers.mailhog.tls=true"

networks:
uccser-development-proxy:
driver: bridge
Expand Down

0 comments on commit 4a60123

Please sign in to comment.