gighive

GigHive Music and Video Library

GigHive is an open-source deployment framework for hosting your own media library, a band’s library or fan videos, or even videos uploaded by guests from events like a wedding. There are two pieces to Gighive:

The automation allows you to spin up a fully reproducible environment using Docker, Ansible, and Terraform. It has a very simple interface: a splash page, a single database of stored videos and an upload utility.

This project is designed to be portable, easy to deploy, and suitable for local development or cloud environments (Azure supported out of the box).

REQUIREMENTS


πŸš€ Features


πŸ§‘β€πŸ’» Development Environment


πŸ“‚ Repository Structure

β”œβ”€β”€ 1prereqsInstall.sh
β”œβ”€β”€ 2bootstrap.sh
β”œβ”€β”€ 3deleteAll.sh
β”œβ”€β”€ ansible
β”‚Β Β  β”œβ”€β”€ callback_plugins
β”‚Β Β  β”œβ”€β”€ inventories
β”‚Β Β  β”‚Β Β  β”œβ”€β”€ group_vars
β”‚Β Β  β”‚Β Β  β”œβ”€β”€ inventory_azure.yml
β”‚Β Β  β”‚Β Β  β”œβ”€β”€ inventory_azure.yml.j2
β”‚Β Β  β”‚Β Β  β”œβ”€β”€ inventory_baremetal.yml
β”‚Β Β  β”‚Β Β  └── inventory_virtualbox.yml
β”‚Β Β  β”œβ”€β”€ playbooks
β”‚Β Β  β”‚Β Β  └── site.yml
β”‚Β Β  β”œβ”€β”€ roles
β”‚Β Β  β”‚Β Β  β”œβ”€β”€ base
β”‚Β Β  β”‚Β Β  β”œβ”€β”€ blobfuse2
β”‚Β Β  β”‚Β Β  β”œβ”€β”€ cloud_init
β”‚Β Β  β”‚Β Β  β”œβ”€β”€ cloud_init_disable
β”‚Β Β  β”‚Β Β  β”œβ”€β”€ docker
β”‚Β Β  β”‚Β Β  β”œβ”€β”€ mysql_backup
β”‚Β Β  β”‚Β Β  β”œβ”€β”€ nfs_mount
β”‚Β Β  β”‚Β Β  β”œβ”€β”€ post_build_checks
β”‚Β Β  β”‚Β Β  β”œβ”€β”€ security_basic_auth
β”‚Β Β  β”‚Β Β  β”œβ”€β”€ security_owasp_crs
β”‚Β Β  β”‚Β Β  β”œβ”€β”€ validate_app
β”‚Β Β  β”‚Β Β  └── varscope
β”‚Β Β  └── vdiLockedWriteDelete.sh
β”œβ”€β”€ ansible.cfg
β”œβ”€β”€ assets
β”‚Β Β  β”œβ”€β”€ audio
β”‚Β Β  └── video
β”œβ”€β”€ azure.env
β”œβ”€β”€ azure-prereqs.txt
β”œβ”€β”€ CHANGELOG.md
β”œβ”€β”€ docs
β”‚Β Β  β”œβ”€β”€ commonissue1.txt
β”‚Β Β  β”œβ”€β”€ commonissue2.txt
β”‚Β Β  β”œβ”€β”€ index.html
β”‚Β Β  β”œβ”€β”€ PREREQS.md
β”‚Β Β  β”œβ”€β”€ README.md
β”‚Β Β  └── timings.txt
β”œβ”€β”€ inventory.ini
β”œβ”€β”€ terraform
β”‚Β Β  └── variables.tf
└── tree.txt

βš™οΈ Preparation

Do these steps before moving ahead with one of the options below.

# 1. Clone the repo
git clone https://github.com/gighive/gighive

# 2. Set GIGHIVE_HOME variable
export GIGHIVE_HOME=<location of where you cloned gighive>
eg: export GIGHIVE_HOME=/home/$USER/gighive

# 3. Install Azure, Terraform and Ansible prerequisites 
cd $GIGHIVE_HOME;./1prereqsInstall.sh
Note VirtualBox install will require a reboot.

# 4. Make sure you have id_rsa.pub or id_ed25519.pub in 
./ssh for passwordless authentication


Option A: Install to Azure VM (requires an Azure subscription)

# 1. Export Azure Vars (as noted at top of 2bootstrap.sh)
export ARM_SUBSCRIPTION_ID=[put your subscription id here]
export ARM_TENANT_ID=[put your tenant id/mgmt group id here]

# 2. Provision infrastructure
./2bootstrap.sh

Watch and respond to these prompts:
.. apply Terraform plan 
.. update the ansible inventory file and finally,
.. run the ansible_playbook

# 3. If you're finished with the VM, delete all resources in Azure
cd $GIGHIVE_HOME;./3deleteAll.sh 

Option B: Create and install to new Virtualbox VM

# 1. Decide on an IP in your home network that you'd like to use. 

# 2. Edit the "ansible_host" field in $GIGHIVE_HOME/ansible/inventories/inventory_virtualbox.yml 

# 3. Run Ansible 
cd $GIGHIVE_HOME;ansible-playbook -i ansible/inventories/inventory_virtualbox.yml ansible/playbooks/site.yml --ask-become-pass

Option C: Install to existing baremetal server in your environment

# 1. Edit the inventory file and put the IP of your bare metal server that is prepped for Gighive 
$GIGHIVE_HOME/ansible/inventories/inventory_baremetal.yml

# 2. Run Ansible
cd $GIGHIVE_HOME;ansible-playbook -i ansible/inventories/inventory_baremetal.yml ansible/playbooks/site.yml 

βš™οΈ Setup & Installation


πŸ“œ License

GigHive Community Edition is licensed under the MIT License. This edition is intended for self-hosted, single-tenant use cases. For SaaS or multi-tenant solutions, please see GigHive Cloud (proprietary).


🀝 Contributing

Contributions welcome! Please open issues and pull requests.

πŸ‘‰ Contact us for commercial licensing or for any other questions regarding Gighive. GigHive bee mascot