generated from security-union/yew-actix-template
-
Notifications
You must be signed in to change notification settings - Fork 127
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* DATABASE_URL instead of PG_URL * helm charts for deploying rustlemania * Deployed to kubernetes cluster successfully * cargo fmt * Deployed ssl * Update audio encoder * Adding some docs for helm deploy * use wss * do not install clippy * whatever * add default * override * remove default config * trying with lower quality audio to try reduce latency --------- Co-authored-by: Griffin Obeid <[email protected]>
- Loading branch information
1 parent
f6ff054
commit 5c07def
Showing
42 changed files
with
760 additions
and
37 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 |
---|---|---|
@@ -0,0 +1,2 @@ | ||
**/target | ||
**/dist |
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,24 @@ | ||
FROM rust:1.70-slim-bullseye as development | ||
|
||
RUN apt-get --yes update && apt-get --yes install curl git pkg-config libssl-dev | ||
RUN curl https://github.com/amacneil/dbmate/releases/download/v2.4.0/dbmate-linux-amd64 -L -o /usr/bin/dbmate && chmod +x /usr/bin/dbmate | ||
RUN cargo install cargo-watch | ||
RUN rustup component add clippy-preview | ||
RUN rustup component add rustfmt | ||
|
||
FROM development as build | ||
|
||
COPY . /app | ||
WORKDIR /app/actix-api | ||
RUN cargo build --release | ||
|
||
FROM debian:bullseye-slim as production | ||
|
||
COPY --from=build /usr/bin/dbmate /usr/bin/dbmate | ||
COPY --from=build /app/actix-api/target/release/actix-api /usr/bin/actix-api | ||
COPY --from=build /app/actix-api/startup.sh /usr/bin/startup.sh | ||
COPY --from=build /app/dbmate /app/dbmate | ||
|
||
STOPSIGNAL SIGINT | ||
|
||
CMD [ "startup.sh" ] |
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 @@ | ||
FROM --platform=linux/amd64 rust:1.65-slim-bullseye as development | ||
|
||
RUN rustup default nightly-2022-10-21 | ||
RUN apt-get --yes update && apt-get --yes install git pkg-config libssl-dev | ||
RUN cargo install wasm-bindgen-cli --version 0.2.78 | ||
RUN cargo install trunk --version 0.16.0 | ||
RUN rustup target add wasm32-unknown-unknown | ||
|
||
FROM --platform=linux/amd64 development as build | ||
|
||
# TODO - this is a hack to get around the fact that the yew-ui crate is not bundled with the backend | ||
ENV ENABLE_OAUTH=false | ||
ENV LOGIN_URL="" | ||
ENV ACTIX_UI_BACKEND_URL="wss://api.rustlemania.com" | ||
WORKDIR /app | ||
COPY . . | ||
WORKDIR /app/yew-ui | ||
|
||
RUN trunk build --release | ||
|
||
FROM --platform=linux/amd64 nginx:1.21.5-alpine as production | ||
|
||
COPY nginx.conf /etc/nginx/nginx.conf | ||
|
||
COPY --from=build /app/yew-ui/dist /usr/share/nginx/html |
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,3 @@ | ||
#!/bin/bash -e | ||
/app/dbmate/startup.sh | ||
actix-api |
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,4 +1,4 @@ | ||
#!/bin/bash | ||
#!/bin/bash -e | ||
pushd /app/dbmate | ||
dbmate wait | ||
dbmate up | ||
|
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 |
---|---|---|
|
@@ -35,7 +35,6 @@ Cargoes: | |
- ${{ Envs.HOME }}/.cargo/registry:/usr/local/cargo/registry | ||
Env: | ||
- ACTIX_HOST=api.zoom.rs | ||
- ACTIX_PORT=8080 | ||
- ACTIX_UI_BACKEND_URL=ws://api.zoom.rs | ||
- TRUNK_SERVE_PORT=8081 | ||
- ENABLE_OAUTH=false | ||
|
@@ -72,7 +71,6 @@ Cargoes: | |
- OAUTH_CLIENT_SECRET=${{Envs.OAUTH_CLIENT_SECRET}} | ||
- OAUTH_REDIRECT_URL=http://api.zoom.rs/login/callback | ||
- RUST_LOG=debug | ||
- PG_URL=postgres://postgres:[email protected]:5432/actix-api-db?sslmode=disable | ||
- NATS_URL=nats.zoom.rs | ||
- DATABASE_URL=postgres://postgres:[email protected]:5432/actix-api-db?sslmode=disable | ||
|
||
|
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,3 @@ | ||
charts | ||
issuer.yaml | ||
secret.yaml |
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,10 @@ | ||
# Deploying with helm to kubernetes | ||
|
||
1. Create a cluster | ||
1. Deploy ingress-nginx | ||
1. Setup DNS records with the ingress-nginx external IP | ||
1. Deploy internal nats and postgres | ||
1. Deploy rustlemania without SSL | ||
1. Deploy cert-manager | ||
1. Create a cert-manager issuer | ||
1. Upgrade rustlemania to include SSL |
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,6 @@ | ||
dependencies: | ||
- name: cert-manager | ||
repository: https://charts.jetstack.io | ||
version: v1.12.2 | ||
digest: sha256:e6bf98d4441b0fd59de1af1d0699137396520bfe1f50f36d092a676ce6395c26 | ||
generated: "2023-06-16T16:31:58.732255816-04:00" |
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,8 @@ | ||
apiVersion: v2 | ||
name: rustlemania-cert-manager | ||
version: 1.0.0 | ||
|
||
dependencies: | ||
- name: cert-manager | ||
version: 1.12.2 | ||
repository: https://charts.jetstack.io |
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,2 @@ | ||
cert-manager: | ||
installCRDs: true |
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,6 @@ | ||
dependencies: | ||
- name: ingress-nginx | ||
repository: https://kubernetes.github.io/ingress-nginx | ||
version: 4.7.0 | ||
digest: sha256:6dfa18d4071adbb07799d25c0612b2406666d72df9b7006c498ad0c6737f20e1 | ||
generated: "2023-06-16T16:28:45.72699788-04:00" |
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,8 @@ | ||
apiVersion: v2 | ||
name: rustlemania-ingress-nginx | ||
version: 1.0.0 | ||
|
||
dependencies: | ||
- name: ingress-nginx | ||
version: 4.7.0 | ||
repository: https://kubernetes.github.io/ingress-nginx |
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,6 @@ | ||
dependencies: | ||
- name: nats | ||
repository: https://nats-io.github.io/k8s/helm/charts/ | ||
version: 0.19.15 | ||
digest: sha256:068e4c9258b50decadb4bc245b16a7036613591d64f1138fa7715c2af09aec1b | ||
generated: "2023-06-16T15:39:38.310776778-04:00" |
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,8 @@ | ||
apiVersion: v2 | ||
name: rustlemania-nats | ||
version: 0.1.0 | ||
|
||
dependencies: | ||
- name: nats | ||
version: 0.19.15 | ||
repository: https://nats-io.github.io/k8s/helm/charts/ |
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,8 @@ | ||
nats: | ||
nats: | ||
natsbox: | ||
enabled: true | ||
cluster: | ||
enabled: true | ||
replicas: 5 | ||
noAdvertise: true |
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,6 @@ | ||
dependencies: | ||
- name: postgresql | ||
repository: https://charts.bitnami.com/bitnami | ||
version: 12.5.7 | ||
digest: sha256:b81e4b8537abfe5f8a5fbbd93ee3eb9b7396eb145d52bf717e1c81f286260993 | ||
generated: "2023-06-16T15:46:17.792158524-04:00" |
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,8 @@ | ||
apiVersion: v2 | ||
name: rustlemania-postgres | ||
version: 1.0.0 | ||
|
||
dependencies: | ||
- name: postgresql | ||
version: 12.5.7 | ||
repository: https://charts.bitnami.com/bitnami |
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,3 @@ | ||
postgresql: | ||
auth: | ||
existingSecret: rustlemania |
Oops, something went wrong.