Skip to content
Snippets Groups Projects
Select Git revision
  • a749b7101e2c9c1b12e7bacf06873f1b34ceebb7
  • master default
  • 2015ss
  • 2014ss
4 results

bs-20160404.tex

Blame
  • Forked from Peter Gerwinski / bs
    Source project has a limited visibility.
    setup.sh 2.06 KiB
    #!/bin/bash
    
    source config.sh
    
    # Remove all existing repositories
    # and configurations.
    function remove_all_configs() {
        echo "Removing all previous configs..."
        rm -rf $MUMBLE_DIR $JITSI_DIR $NOVNC_DIR
        git pull
        echo "Removed all repositories."
    }
    
    # Clone repositories
    function clone_repositories() {
        git clone $LETSENCRYPT_URL
        wait
    }
    
    function configure_letsencrypt() {
        echo ""
        echo "Setting your letsencrypt domain settings."
        echo ""
        le_compose=$LETSENCRYPT_DIR/docker-compose.yml
        # Adds your domain to docker-compose
        sed -i "s/your-domain.com/$DOMAIN/" $le_compose
        # Adds the list of subdomains to use to docker-compose
        sed -i "s/your_subdomains/$SUB_DOMAINS/" $le_compose
        # Add E-Mail address that will be used to notify you
        # about for example expiring certificates.
        sed -i "s/your_email/$MAIL/" $le_compose
        
        # For using not only your subdomains uncomment the following line.
        # sed -i "s/- ONLY_SUBDOMAINS=true/- ONLY_SUBDOMAINS=false/" $LETSENCRYPT_DIR
    
        # start once to generate directories and certificates
        docker-compose $base_compose_file $letsencrypt_compose_file up -d && docker logs reverse_proxy && docker-compose $base_compose_file $letsencrypt_compose_file down
        echo ""
        echo "Done configuring LetsEncrypt and generating certificates."
    }
    
    
    ## Configure Murmur (mumble server) and mumble-web
    #
    function configure_mumble_web(){
        cd $MUMBLE_WEB_DIR
        git clone https://github.com/Johni0702/mumble-web.git
        cd ..
        mkdir murmur
        cp $MUMBLE_WEB_DIR/murmur/mumble-server.ini murmur/mumble-server.ini
        touch murmur/mumble-server.log
    }
    
    
    ## Run configuration
    #
    echo ""
    echo "Starting configuration with cleaning up and pulling again."
    echo ""
    
    remove_all_configs;
    clone_repositories;
    
    configure_letsencrypt;
    
    if [ "$USE_JITSI" == "true" ]; then
    git clone $JITSI_URL
    ./"$JITSI_DIR"/setup.sh
    fi
    
    if [ "$USE_MUMBLE" == "true" ];then
    git clone $MUMBLE_WEB_URL && echo "Build Mumble Web cloned"
    configure_mumble_web
    fi
    
    if [ "$USE_NOVNC" == "true" ];then
    git clone $NOVNC_URL
    fi
    
    
    ./tools/update.sh