Skip to content

Commit

Permalink
feat: TLS acceptor with SNI resolver (#471)
Browse files Browse the repository at this point in the history
  • Loading branch information
brokad authored Nov 18, 2022
1 parent 74aeb46 commit 3bd6f0f
Show file tree
Hide file tree
Showing 13 changed files with 879 additions and 239 deletions.
42 changes: 36 additions & 6 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 4 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -40,21 +40,24 @@ APPS_FQDN=shuttleapp.rs
DB_FQDN=db.shuttle.rs
CONTAINER_REGISTRY=public.ecr.aws/shuttle
DD_ENV=production
# make sure we only ever go to production with `--tls=enable`
USE_TLS=enable
else
DOCKER_COMPOSE_FILES=-f docker-compose.yml -f docker-compose.dev.yml
STACK=shuttle-dev
APPS_FQDN=unstable.shuttleapp.rs
DB_FQDN=db.unstable.shuttle.rs
CONTAINER_REGISTRY=public.ecr.aws/shuttle-dev
DD_ENV=unstable
USE_TLS?=disable
endif

POSTGRES_EXTRA_PATH?=./extras/postgres
POSTGRES_TAG?=14

RUST_LOG?=debug

DOCKER_COMPOSE_ENV=STACK=$(STACK) BACKEND_TAG=$(TAG) PROVISIONER_TAG=$(TAG) POSTGRES_TAG=${POSTGRES_TAG} APPS_FQDN=$(APPS_FQDN) DB_FQDN=$(DB_FQDN) POSTGRES_PASSWORD=$(POSTGRES_PASSWORD) RUST_LOG=$(RUST_LOG) CONTAINER_REGISTRY=$(CONTAINER_REGISTRY) MONGO_INITDB_ROOT_USERNAME=$(MONGO_INITDB_ROOT_USERNAME) MONGO_INITDB_ROOT_PASSWORD=$(MONGO_INITDB_ROOT_PASSWORD) DD_ENV=$(DD_ENV)
DOCKER_COMPOSE_ENV=STACK=$(STACK) BACKEND_TAG=$(TAG) PROVISIONER_TAG=$(TAG) POSTGRES_TAG=${POSTGRES_TAG} APPS_FQDN=$(APPS_FQDN) DB_FQDN=$(DB_FQDN) POSTGRES_PASSWORD=$(POSTGRES_PASSWORD) RUST_LOG=$(RUST_LOG) CONTAINER_REGISTRY=$(CONTAINER_REGISTRY) MONGO_INITDB_ROOT_USERNAME=$(MONGO_INITDB_ROOT_USERNAME) MONGO_INITDB_ROOT_PASSWORD=$(MONGO_INITDB_ROOT_PASSWORD) DD_ENV=$(DD_ENV) USE_TLS=$(USE_TLS)

.PHONY: images clean src up down deploy shuttle-% postgres docker-compose.rendered.yml test bump-% deploy-examples publish publish-% --validate-version

Expand Down
5 changes: 4 additions & 1 deletion docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ services:
depends_on:
- provisioner
ports:
- 7999:7999
- 8000:8000
- 8001:8001
deploy:
Expand Down Expand Up @@ -42,16 +43,18 @@ services:
environment:
- RUST_LOG=${RUST_LOG}
command:
- "--state=/var/lib/shuttle/gateway.sqlite"
- "--state=/var/lib/shuttle"
- "start"
- "--control=0.0.0.0:8001"
- "--user=0.0.0.0:8000"
- "--bouncer=0.0.0.0:7999"
- "--image=${CONTAINER_REGISTRY}/deployer:${BACKEND_TAG}"
- "--prefix=shuttle_"
- "--network-name=${STACK}_user-net"
- "--docker-host=/var/run/docker.sock"
- "--provisioner-host=provisioner"
- "--proxy-fqdn=${APPS_FQDN}"
- "--use-tls=${USE_TLS}"
healthcheck:
test: ["CMD", "curl", "-f", "http://localhost:8001"]
interval: 1m
Expand Down
8 changes: 8 additions & 0 deletions gateway/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,20 @@ publish = false
[dependencies]
acme2 = "0.5.1"
async-trait = "0.1.52"

axum = { version = "0.5.8", features = [ "headers" ] }
axum-server = { version = "0.4.4", features = [ "tls-rustls" ] }
rustls = { version = "0.20.6" }
rustls-pemfile = { version = "1.0.1" }
pem = "1.1.0"

base64 = "0.13"
bollard = "0.13"
chrono = "0.4"
clap = { version = "4.0.0", features = [ "derive" ] }

fqdn = "0.2.2"

futures = "0.3.21"
http = "0.2.8"
hyper = { version = "0.14.19", features = [ "stream" ] }
Expand Down
Loading

0 comments on commit 3bd6f0f

Please sign in to comment.