Initial quic.video support.

This commit is contained in:
Luke Curley 2022-07-06 21:28:16 -07:00
parent abe33e5615
commit d0a19d1375
6 changed files with 72 additions and 1 deletions

19
client/Dockerfile Normal file
View File

@ -0,0 +1,19 @@
FROM ubuntu
# Install dependencies
RUN apt-get update && apt-get install -y nginx certbot python3-certbot-nginx
# Contains the final certificates created by certbot
VOLUME /etc/letsencrypt
# Application configuration for our site
COPY nginx/quic.video.conf /etc/nginx/conf.d/quic.video.conf
# The script to init and run nginx
COPY nginx/run.sh /run/warp-client
# Copy over the web contents
COPY dist/* /var/www/quic.video
# Run the shell script
CMD /run/warp-client

View File

@ -0,0 +1,6 @@
server {
listen 80;
listen [::]:80;
server_name quic.video;
root /var/www/quic.video;
}

9
client/nginx/run.sh Executable file
View File

@ -0,0 +1,9 @@
#!/bin/bash
set -euxo pipefail
# Try to generate a certificate that expires in 90 days.
# This will listen on port 80 and serve a challenge file, proving we own the domain.
certbot --nginx --email kixelated@gmail.com -d quic.video --agree-tos
# The certbot nginx plugin will automatically append the certs to the configuration.
nginx

View File

@ -2,6 +2,7 @@
"source": "src/index.html", "source": "src/index.html",
"scripts": { "scripts": {
"serve": "parcel serve --https --host localhost.warp.demo --port 4444", "serve": "parcel serve --https --host localhost.warp.demo --port 4444",
"prebuild": "rm -rf dist",
"build": "parcel build", "build": "parcel build",
"check": "tsc --noEmit" "check": "tsc --noEmit"
}, },

36
server/Dockerfile Normal file
View File

@ -0,0 +1,36 @@
# build image #
FROM golang:1.18 AS build
WORKDIR /src
# Don't use the Go proxy because it's blocked on my laptop (lul)
ENV GOPRIVATE=*
# Copy over the files.
COPY . .
# Run the unit tests.
RUN go test -race ./...
# Run go vet
RUN go vet ./...
# Make sure go fmt was run.
# If this fails, you should configure your editor to run `gofmt` on save.
RUN test -z $(go fmt ./...)
# Install the binary.
RUN go install -v ./warp-server
# Final image
FROM ubuntu:22.04
# Install root certs for HTTPS
RUN apt-get update && \
apt-get install -y --no-install-recommends ca-certificates
# Copy the binary from the build image
COPY --from=build /go/bin /usr/local/bin
# Copy over our pre-encoded media.
COPY media /media

View File

@ -116,7 +116,7 @@ func (s *Session) handleStream(ctx context.Context, stream *webtransport.Receive
} }
if msg.Throttle != nil { if msg.Throttle != nil {
s.setThrottle(msg.Throttle) //s.setThrottle(msg.Throttle)
} }
} }
} }