Skip to content

Latest commit

 

History

History
140 lines (100 loc) · 3.98 KB

File metadata and controls

140 lines (100 loc) · 3.98 KB

Structure Logo

02. Setting up our Project Structure

Structure Banner

In this Tutorial we are going to setup our Project Structure which we are going to use in many of the other Tutorials. This part of the series will change often, depending on the progress, but will remain backwards-compatible with older Tutorials.

Video

Video

Links

Prerequisites

  • A Domain (spikyspam.site in this Tutorial*)
  • A Digital Ocean Account (any other DNS provider will do, like Cloudflare, ...)
  • 018. Install Ubuntu on ProxMox

Prepare Ubuntu VM

  • On your Windows Host

  • On your Ubuntu Guest

    • Install some necessary Packages:
      sudo apt update && sudo apt upgrade -y
      
      sudo apt -y install bridge-utils cpu-checker libvirt-clients libvirt-daemon qemu-kvm qemu-guest-agent curl
    • Your IP address should be 192.168.0.30 (for this tutorial)

Setup Project Environment

  • Create a .bash_profile file in your Solution Folder ⚠️

    For this tutorial we are using the following solution folder location:

    $HOME/Desktop/Tutorials/SS

    This is the main script for our complete Solution. Without it nothing will work. You need to add this file to your .gitignore file. 💥

    mkdir $HOME/Desktop/Tutorials
    mkdir $HOME/Desktop/Tutorials/SS
    
    nano $HOME/Desktop/Tutorials/SS/.bash_profile

    See this no-regrets.sh file for the latest version. Passwords and Secret Keys in this file are only examples, and are no where used. Otherwise let me know 😋

  • Call the solutions .bash_pofile by editing .bashrc. Be sure to change the $TF_VAR_PATH variable to your local directory if needed:

    nano $HOME/.bashrc
    # .bashrc
    
    export TF_VAR_PATH=$HOME/Desktop/Tutorials/SS
    source $TF_VAR_PATH/.bash_profile
  • Reload your Environment. (close and re-open your Terminal)

    source $HOME/.bashrc
  • Create Project Folders in your solution:

    mkdir $TF_VAR_PATH/SS
    mkdir $TF_VAR_PATH/SS/version
    mkdir $TF_VAR_PATH/SS/version/app
    mkdir $TF_VAR_PATH/SS/version/cli
    mkdir $TF_VAR_PATH/SS/version/cluster
    mkdir $TF_VAR_PATH/SS/version/docker
    mkdir $TF_VAR_PATH/SS/version/helm
    mkdir $TF_VAR_PATH/SS/version/terraform
    mkdir $TF_VAR_PATH/SS/CLI
    mkdir $TF_VAR_PATH/SS.APP
  • Create Version Environment variables scripts:

    touch $TF_VAR_PATH/SS/version/app/version.sh
    touch $TF_VAR_PATH/SS/version/cli/version.sh
    touch $TF_VAR_PATH/SS/version/docker/version.sh
    touch $TF_VAR_PATH/SS/version/cluster/version.sh
    touch $TF_VAR_PATH/SS/version/helm/version.sh
    touch $TF_VAR_PATH/SS/version/terraform/version.sh
    
    nano $TF_VAR_PATH/SS/version/docker/version.sh

    export TF_VAR_VERSION_DOCKER_NGINX="1.25.2" # https://hub.docker.com/_/nginx/tags
    export TF_VAR_VERSION_DOCKER_NPM="github-pr-3199" # https://hub.docker.com/r/jc21/nginx-proxy-manager/tags
    export TF_VAR_VERSION_DOCKER_POSTGRES="16.0" # https://hub.docker.com/_/postgres/tags
    export TF_VAR_VERSION_DOCKER_MYSQL="8.1.0" # https://hub.docker.com/_/mysql/tags
    export TF_VAR_VERSION_DOCKER_MARIADB="11.1.2" # https://hub.docker.com/_/mariadb/tags
    export TF_VAR_VERSION_DOCKER_REDIS="7.2.1" # https://hub.docker.com/_/redis/tags
    export TF_VAR_VERSION_DOCKER_PROMETHEUS="2.47.0" # https://hub.docker.com/r/prom/prometheus/tags
    export TF_VAR_VERSION_DOCKER_ELASTICSEARCH="8.10.2" # https://hub.docker.com/_/elasticsearch/tags
    export TF_VAR_VERSION_DOCKER_KIBANA=$TF_VAR_VERSION_DOCKER_ELASTICSEARCH # https://hub.docker.com/_/kibana/tags
    export TF_VAR_VERSION_DOCKER_GRAFANA="10.1.2" # https://hub.docker.com/r/grafana/grafana/tags
    export TF_VAR_VERSION_DOCKER_PGADMIN="7.7" # https://hub.docker.com/r/dpage/pgadmin4/tags
    export TF_VAR_VERSION_DOCKER_PHPMYADMIN="5.2.1" # https://hub.docker.com/_/phpmyadmin/tags
    export TF_VAR_VERSION_DOCKER_VAULTWARDEN="1.29.2" # https://hub.docker.com/r/vaultwarden/server/tags
    export TF_VAR_VERSION_DOCKER_KEYCLOAK="22.0.3" # https://hub.docker.com/r/keycloak/keycloak/tags
    export TF_VAR_VERSION_DOCKER_TWINGATE="1.59.0" # https://hub.docker.com/r/twingate/connector/tags
    export TF_VAR_VERSION_DOCKER_GUACD="1.5.3" # https://hub.docker.com/r/guacamole/guacd/tags
    export TF_VAR_VERSION_DOCKER_GUACAMOLE=$TF_VAR_VERSION_DOCKER_GUACD # https://hub.docker.com/r/guacamole/guacamole/tags
    export TF_VAR_VERSION_DOCKER_FILEBROWSER="2.25.0" # https://hub.docker.com/r/filebrowser/filebrowser/tags
    export TF_VAR_VERSION_DOCKER_KUTT="2.7.4" # https://hub.docker.com/r/kutt/kutt/tags
    export TF_VAR_VERSION_DOCKER_SEARXNG="2023.9.24-19383921d" # https://hub.docker.com/r/searxng/searxng/tags
    export TF_VAR_VERSION_DOCKER_DASHY="2.1.1" # https://hub.docker.com/r/lissy93/dashy/tags
    export TF_VAR_VERSION_DOCKER_UPTIMEKUMA="1.23.2" # https://hub.docker.com/r/louislam/uptime-kuma/tags
    export TF_VAR_VERSION_DOCKER_LISTMONK="2.5.1" # https://hub.docker.com/r/listmonk/listmonk/tags
    export TF_VAR_VERSION_DOCKER_RABBITMQ="3.12.6-management" # https://hub.docker.com/_/rabbitmq/tags
    export TF_VAR_VERSION_DOCKER_HARBOR="2.9.0" # https://hub.docker.com/r/bitnami/harbor-registry/tags
    export TF_VAR_VERSION_DOCKER_GITLAB="16.4.0-ce.0" # https://hub.docker.com/r/gitlab/gitlab-ce/tags
    export TF_VAR_VERSION_DOCKER_CODESERVER="4.17.0" # https://hub.docker.com/r/linuxserver/code-server/tags
    export TF_VAR_VERSION_DOCKER_JENKINS="2.425" # https://hub.docker.com/r/jenkins/jenkins/tags
    export TF_VAR_VERSION_DOCKER_PHONEINFOGA="2.10.7" # https://hub.docker.com/r/sundowndev/phoneinfoga/tags
    export TF_VAR_VERSION_DOCKER_SOFTETHER="4.42-9798-rtm-2023.06.30" # https://www.softether-download.com/files/softether
    export TF_VAR_VERSION_DOCKER_BEEF="0.5.4.0" # https://github.com/beefproject/beef/releases
    export TF_VAR_VERSION_DOCKER_UBUNTU="23.04" # https://hub.docker.com/_/ubuntu/tags
    export TF_VAR_VERSION_DOCKER_KALI="latest" # https://hub.docker.com/r/kalilinux/kali-rolling/tags
    export TF_VAR_VERSION_DOCKER_RUBY="3.2.2" # https://hub.docker.com/_/ruby/tags
    export TF_VAR_VERSION_DOCKER_PYTHON="3.9.18" # https://hub.docker.com/_/python/tags

  • Create Application Folders for docker, helm and other configuration files

    mkdir $TF_VAR_PATH_APP/docker
    mkdir $TF_VAR_PATH_APP/helm
    mkdir $TF_VAR_PATH_APP/yaml

Install Docker

  • Execute the following commands to Install Docker:

    curl -sSL https://get.docker.com/ | sh
    
    sudo usermod -aG docker $USER
    newgrp docker
    
    sudo service docker start
    
    sudo systemctl enable docker.service
    sudo systemctl enable containerd.service
  • Reboot the VM:

    reboot