Fix docker-compose so it uses the right cert hex.

This commit is contained in:
Luke Curley 2023-05-18 12:05:38 -07:00
parent 4675c27179
commit 16abb2d6dc
5 changed files with 21 additions and 14 deletions

View File

@ -1,13 +1,12 @@
# Use ubuntu because it's ez # Use ubuntu because it's ez
FROM ubuntu:latest FROM ubuntu:latest
WORKDIR /build
# Use openssl and golang to generate certificates # Use openssl and golang to generate certificates
RUN apt-get update && \ RUN apt-get update && \
apt-get install -y ca-certificates openssl golang apt-get install -y ca-certificates openssl golang xxd
# Save the certificates to a volume
VOLUME /cert
WORKDIR /cert
# Download the go modules # Download the go modules
COPY go.mod go.sum ./ COPY go.mod go.sum ./
@ -16,5 +15,8 @@ RUN go mod download
# Copy over the remaining files. # Copy over the remaining files.
COPY . . COPY . .
# Save the certificates to a volume
VOLUME /cert
# TODO support an output directory # TODO support an output directory
CMD ./generate CMD ./generate && cp localhost.* /cert

View File

@ -17,4 +17,4 @@ go run filippo.io/mkcert -ecdsa -install
go run filippo.io/mkcert -ecdsa -days 10 -cert-file "$CRT" -key-file "$KEY" localhost 127.0.0.1 ::1 go run filippo.io/mkcert -ecdsa -days 10 -cert-file "$CRT" -key-file "$KEY" localhost 127.0.0.1 ::1
# Compute the sha256 fingerprint of the certificate for WebTransport # Compute the sha256 fingerprint of the certificate for WebTransport
openssl x509 -in "$CRT" -outform der | openssl dgst -sha256 > localhost.hex openssl x509 -in "$CRT" -outform der | openssl dgst -sha256 -binary | xxd -p -c 256 > localhost.hex

View File

@ -1,6 +1,9 @@
# Create a build image # Create a build image
FROM ubuntu:latest FROM ubuntu:latest
# Create the working directory.
WORKDIR /build
# Install necessary packages # Install necessary packages
RUN apt-get update && \ RUN apt-get update && \
apt-get install -y \ apt-get install -y \
@ -8,13 +11,15 @@ RUN apt-get update && \
wget \ wget \
ffmpeg ffmpeg
# Create a media volume
VOLUME /media
WORKDIR /media
# Download a file from the internet, in this case my boy big buck bunny # Download a file from the internet, in this case my boy big buck bunny
RUN wget http://commondatastorage.googleapis.com/gtv-videos-bucket/sample/BigBuckBunny.mp4 -O source.mp4 RUN wget http://commondatastorage.googleapis.com/gtv-videos-bucket/sample/BigBuckBunny.mp4 -O source.mp4
# Copy an run a script to create a fragmented mp4 (more overhead, easier to split) # Copy an run a script to create a fragmented mp4 (more overhead, easier to split)
COPY fragment . COPY fragment .
CMD ./fragment
# Create a media volume
VOLUME /media
# Fragment the media
# TODO support an output directory
CMD ./fragment && cp fragmented.mp4 /media

View File

@ -6,7 +6,7 @@ use clap::Parser;
#[derive(Parser)] #[derive(Parser)]
struct Cli { struct Cli {
/// Listen on this address /// Listen on this address
#[arg(short, long, default_value = "0.0.0.0:4443")] #[arg(short, long, default_value = "[::]:4443")]
addr: String, addr: String,
/// Use the certificate file at this path /// Use the certificate file at this path