Skip to content

Commit

Permalink
fix auto provisionning
Browse files Browse the repository at this point in the history
  • Loading branch information
yann degat committed Mar 16, 2020
1 parent 4b3c4cd commit 8e52d6a
Show file tree
Hide file tree
Showing 4 changed files with 34 additions and 13 deletions.
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
live/*
clouds.yaml
.terraform
terraform.tfstate
.terragrunt-cache
.terragrunt-cache
2 changes: 1 addition & 1 deletion main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ locals {
][0]

ip_parts = split(".", local.jitsi)
fqdn = format("ip%s.ip-%s-%s-%s.eu", local.ip_parts[3], local.ip_parts[0], local.ip_parts[1], local.ip_parts[2])
fqdn = var.fqdn != "" ? var.fqdn : format("ip%s.ip-%s-%s-%s.eu", local.ip_parts[3], local.ip_parts[0], local.ip_parts[1], local.ip_parts[2])

user_data = {
hostname = local.fqdn
Expand Down
37 changes: 26 additions & 11 deletions provision.sh
Original file line number Diff line number Diff line change
Expand Up @@ -14,18 +14,33 @@ sudo apt-get -y update

#first install with a self signed cert. then restart with letsencrypt
cat > /tmp/jitsi.seeds <<EOF
jitsi-meet-web-config jitsi-meet/cert-choice select Generate a new self-signed certificate (You will later get a chance to obtain a Let's encrypt certificate)
jitsi-meet-prosody jitsi-meet-prosody/jvb-hostname string $(hostname)
jitsi-meet-web-config jitsi-meet/jvb-serve boolean true
jitsi-meet-prosody jicofo/jicofo-authuser string focus
jitsi-meet-web-config jitsi-meet/cert-path-key string
jicofo jitsi-videobridge/jvb-hostname string $(hostname)
jitsi-meet-prosody jitsi-videobridge/jvb-hostname string $(hostname)
jitsi-meet-web-config jitsi-videobridge/jvb-hostname string $(hostname)
jitsi-videobridge jitsi-videobridge/jvb-hostname string $(hostname)
jitsi-meet-web-config jitsi-meet/cert-path-crt string
jitsi-meet-web-config jitsi-meet/jvb-hostname string $(hostname)
jitsi-meet-web-config jitsi-meet/cert-choice select Generate a new self-signed certificate (You will later get a chance to obtain a Let's encrypt certificate)
jitsi-meet-web-config jitsi-meet/jvb-hostname string $(hostname)
jitsi-meet-web-config jitsi-videobridge/jvb-hostname string $(hostname)
jitsi-videobridge jitsi-videobridge/jvb-hostname string $(hostname)
EOF

sudo mkdir -p /etc/jitsi/videobridge/
sudo tee /etc/jitsi/videobridge/sip-communicator.properties <<EOF
org.jitsi.videobridge.rest.jetty.host=::
org.jitsi.videobridge.rest.jetty.port=443
org.jitsi.videobridge.rest.jetty.ProxyServlet.hostHeader=$(hostname)
org.jitsi.videobridge.rest.jetty.ProxyServlet.pathSpec=/http-bind
org.jitsi.videobridge.rest.jetty.ProxyServlet.proxyTo=http://localhost:5280/http-bind
org.jitsi.videobridge.rest.jetty.ResourceHandler.resourceBase=/usr/share/jitsi-meet
org.jitsi.videobridge.rest.jetty.ResourceHandler.alias./config.js=/etc/jitsi/meet/$(hostname)-config.js
org.jitsi.videobridge.rest.jetty.ResourceHandler.alias./interface_config.js=/usr/share/jitsi-meet/interface_config.js
org.jitsi.videobridge.rest.jetty.ResourceHandler.alias./logging_config.js=/usr/share/jitsi-meet/logging_config.js
org.jitsi.videobridge.rest.jetty.ResourceHandler.alias./external_api.js=/usr/share/jitsi-meet/libs/external_api.min.js
org.jitsi.videobridge.rest.jetty.RewriteHandler.regex=^/([a-zA-Z0-9]+)$
org.jitsi.videobridge.rest.jetty.RewriteHandler.replacement=/
org.jitsi.videobridge.rest.jetty.SSIResourceHandler.paths=/
org.jitsi.videobridge.rest.jetty.tls.port=443
org.jitsi.videobridge.TCP_HARVESTER_PORT=443
org.jitsi.videobridge.rest.jetty.sslContextFactory.keyStorePath=/etc/jitsi/videobridge/$(hostname).jks
org.jitsi.videobridge.rest.jetty.sslContextFactory.keyStorePassword=changeit
EOF

sudo debconf-set-selections /tmp/jitsi.seeds
sudo apt-get install -y jitsi-meet

Expand Down
5 changes: 5 additions & 0 deletions variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -48,3 +48,8 @@ variable ssh_user {
description = "Name of the user used in image_name"
default = "ubuntu"
}

variable fqdn {
description = "Fully qualified domain name of the server. By default, will use the reverse name of the public ip"
default = ""
}

0 comments on commit 8e52d6a

Please sign in to comment.