Coder Social home page Coder Social logo

dennislwm / terraform-jitsi-ssl Goto Github PK

View Code? Open in Web Editor NEW
2.0 2.0 0.0 7 KB

Terraform starter project for a self-hosted Jitsi Video Server.

Home Page: https://markit.work

Shell 10.23% HCL 89.77%
terraform terraform-module digitalocean droplet-creation droplet digital-ocean ssh-key tutorial-code

terraform-jitsi-ssl's Introduction

terraform-jitsi-ssl

Terraform starter project for a self-hosted Jitsi Video Server.


About terraform-jitsi-ssl

Jitsi Meet is a secured, fully featured, and completely free video conferencing.

Jitsi isn't just for video conferencing. It also has room chat, virtual hand raise, screen sharing and streaming a YouTube video. Using your own Jitsi server, you don't have to be tied down to any free public servers, which may laggy or not available 24/7, or to be dependent on premium servers, which may be expensive. And if you're a serious user, you can create a scalable, optimized video conferencing server, or even a frontend graphical user interface to wrap around your server.

terraform-jitsi-ssl was a personal project to:

  • automate SSH key upload
  • automate droplet creation in a remote server
  • automate provision in a remote server

Automate SSH Key Upload

The main resource file, main.tf, has a shared resource objSshKey.

The SSH token string is stored in the root terraform.tfvars file (add to .gitignore).


Automate Droplet Creation in a Remote Server

The main resource file, main.tf, has a declaration for each module, e.g. jitsi.

In each module folder, a resource file declares a droplet and a project.

In each module folder, a variable file overrides the default root variable file.

For example, changing the default value of strDoImage to "opentradestatist-jitsiserver-18-04".


Automate Provision in a Remote Server

In each module, we perform the following in Terraform via a SSH connection:

  • provision for creating remote folders.

  • provision for copying local data files to a remote server.

  • provision for making a swapfile in a remote server.

  • provision for executing a docker-compose command in a remote server.

  • return the server IP address at completion.


Project Structure

 terraform-jitsi-ssl/             <-- Root of your project
   |- package.json                <-- Node.js project entries
   |- README.md                   <-- This README markdown file
   +- bin/                        <-- Holds any executable files
      |- mkswap.sh                <-- Creates a swapfile in a Bash terminal for production
   +- tf/                         <-- Terraform root folder
      |- main.tf                  <-- Main TF file (required)
      |- variables.tf             <-- Default variables declaration file for root
      |- outputs.tf               <-- Default outputs declaration file for root
      |- terraform.tfvars         <-- Secret variables declaration file for tokens (.gitignore)
      +- modules/                 <-- Nested modules
         +- jitsi/                <-- Holds any TF files for Jitsi
            |- jitsi.tf           <-- Resources TF file
            |- variables.tf       <-- Overrides inputs of variables.tf file in root
            |- outputs.tf         <-- Returns outputs in module to main.tf file in root

Prerequisite

Example Usage

Clone this repository to your folder myproject:

 $ git clone https://github.com/dennislwm/terraform-jitsi-ssl myproject

Infrastructure as Code

Configuration

  1. In the root folder, edit the variables.tf file and change the default values for:
  • strSshPath - path to local SSH folder, e.g. "c:\\users\\dennislwm\\.ssh\\"
  • strSshId - name of local SSH public_key .pub file, e.g. "id_rsa.pub"
  • strRootPath - path to this project root folder, e.g. "c:\\users\\dennislwm\\terraform-jitsi-ssl\\"
  • strDoDomain - name of custom domain, e.g. "markit.work"
  1. Create a terraform.tfvars file and add the following (remember to replace "token" with your DigitalOcean API access token string):

    strDoToken = "token"

Warning: Keep your terraform.tfvars file (add to .gitignore) a secret to prevent unauthorized access to your DigitalOcean account.

DigitalOcean

Browse lists of images, regions, and sizes for DigitalOcean:

URL: https://slugs.do-api.dev/

Initialize Terraform Nested Modules

In the Terraform tf folder, type the following command in your terminal:

 $ terraform init

Create a Terraform Plan

Type the following command in your terminal:

 $ terraform plan

Execute a Terraform Plan

Type the following command in your terminal:

 $ terraform apply

Before typing 'yes', ensure that ALL resources Terraform will create and destroy are correct.


Destroy a Terraform Plan

Type the following command in your terminal:

 $ terraform destroy

Before typing 'yes', ensure that ALL resources Terraform will destroy are correct.

Note: Add optional parameter "-target=module.mymodule" to destroy a given module, eg. "terraform destroy -target=module.jitsi"


Reach Out!

Please consider giving this repository a star on GitHub.

Alternatively, leave a comment on the tutorial How to Deploy Your Secure Video Conference Server in 4 GIF Steps.

terraform-jitsi-ssl's People

Contributors

dennislwm avatar

Stargazers

 avatar  avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.