Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions .env.production
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
PUBLIC_RELAY_URL="https://relay.quic.video"
# Generate with: cargo run --bin moq-token -- --key root.jwk sign --root "demo" --publish ""
PUBLIC_RELAY_TOKEN="eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJyb290IjoiZGVtbyIsInB1YiI6IiIsInN1YiI6bnVsbCwiZXhwIjpudWxsLCJpYXQiOm51bGx9.vizGIT2tLZLnYWkov6XHrzwt5YoKpi0jS9oIskXxhqA"
# Generate with: cargo run --bin moq-token -- --key root.jwk sign --root "demo" --subscribe ""
PUBLIC_RELAY_TOKEN="eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJyb290IjoiZGVtbyIsInB1YiI6bnVsbCwic3ViIjoiIiwiZXhwIjpudWxsLCJpYXQiOm51bGx9.g_iwc5vTOAgNtBqrzKQb2x-QZ05M55PBOFAsfj-aQjI"
138 changes: 65 additions & 73 deletions infra/.terraform.lock.hcl

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

29 changes: 7 additions & 22 deletions infra/input.tf
Original file line number Diff line number Diff line change
@@ -1,51 +1,36 @@
variable "project" {
description = "project id"
default = "quic-video"
}

variable "region" {
description = "region"
default = "us-central1"
}

variable "zone" {
description = "zone"
default = "us-central1-a"
}

variable "email" {
description = "Your email address, used for LetsEncrypt"
default = "kixelated@gmail.com"
}

variable "domain" {
description = "domain name"
default = "quic.video"
}

variable "docker_relay" {
description = "Docker image for moq-relay"
default = "docker.io/kixelated/moq-relay:0.7.6"
default = "docker.io/kixelated/moq-relay:0.8.0"
}

variable "docker_hang" {
description = "Docker image for hang"
default = "docker.io/kixelated/hang:0.1.8"
}

# cargo run --bin moq-token -- --key root.jwk generate
variable "root_key" {
description = "root key"
sensitive = true
}

# A token used to publish demo/bbb.hang
# This is very manual/crude, but I don't want someone to hijack the broadcast.
# cargo run --bin moq-token -- --key root.jwk sign --path "demo/bbb.hang" --publish "" > demo.jwt
variable "demo_token" {
description = "demo token"
sensitive = true
}

# cargo run --bin moq-token -- --key root.jwk sign --publish "" --publish-secondary --subscribe "" --subscribe-primary > cluster.jwt
variable "cluster_token" {
description = "cluster token"
sensitive = true
default = "docker.io/kixelated/hang:0.2.0"
}

# Too complicated to specify via flags, so do it here.
Expand Down
3 changes: 2 additions & 1 deletion infra/pub.tf
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,8 @@ resource "google_compute_instance" "pub" {
region = local.pub.region

# A token used to publish demo/bbb.hang
demo_token = var.demo_token
# cargo run --bin moq-token -- --key root.jwk sign --root "demo" --publish "" > demo.jwt
demo_token = file("demo.jwt")
})
}

Expand Down
2 changes: 1 addition & 1 deletion infra/pub.yml.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ write_files:
-e REGION=${region} \
--entrypoint hang-bbb \
${docker_image} \
publish "https://relay.quic.video/demo/bbb.hang?jwt=${demo_token}"
publish --url "https://relay.quic.video/demo?jwt=${demo_token}" --name "bbb"

ExecStop=docker stop hang-bbb

Expand Down
7 changes: 5 additions & 2 deletions infra/relay.tf
Original file line number Diff line number Diff line change
Expand Up @@ -48,8 +48,11 @@ resource "google_compute_instance" "relay" {
cluster_root = "${local.root}.c.${var.project}.internal"

# The root key and token, used to authenticate nodes
root_key = var.root_key
cluster_token = var.cluster_token
# cargo run --bin moq-token -- --key root.jwk generate > root.jwk
root_key = file("root.jwk")

# cargo run --bin moq-token -- --key root.jwk sign --publish "" --subscribe "" --cluster > cluster.jwt
cluster_token = file("cluster.jwt")
})
}

Expand Down
10 changes: 1 addition & 9 deletions infra/relay.yml.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -74,15 +74,7 @@ write_files:

[auth]
key = "/etc/moq/root.jwk"

[auth.path.demo]
public = { read = true }

[auth.path.anon]
key = ""

[auth.path.hang]
key = ""
public = "anon"

permissions: "0644"
owner: root
Expand Down