Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save jbmusso/52769fc0e8bca4c24543d06edc895405 to your computer and use it in GitHub Desktop.
Save jbmusso/52769fc0e8bca4c24543d06edc895405 to your computer and use it in GitHub Desktop.

Revisions

  1. @superseb superseb revised this gist Sep 6, 2018. No changes.
  2. @superseb superseb revised this gist Aug 23, 2018. 1 changed file with 2 additions and 1 deletion.
    3 changes: 2 additions & 1 deletion rancher-singlenodeinstall-selfsignedcert.sh
    Original file line number Diff line number Diff line change
    @@ -19,6 +19,7 @@ export SSL_DNS="${FQDN}" # Additional SANs (comma separated) can be added
    #export SSL_IP="127.0.0.1,127.0.0.2" # Additional IPs (comma separated) can be added
    export SILENT="true"

    # Due to this open PR (https://github.com/paulczar/omgwtfssl/pull/10) I changed to use the edited version of the Docker image under superseb/omgwtfssl. Of course with appropriate referral in the description.
    docker run -v $PWD/certs:/certs \
    -e CA_SUBJECT \
    -e CA_EXPIRE \
    @@ -27,7 +28,7 @@ docker run -v $PWD/certs:/certs \
    -e SSL_DNS \
    -e SSL_IP \
    -e SILENT \
    paulczar/omgwtfssl
    superseb/omgwtfssl

    docker run -d --restart=unless-stopped \
    -p 80:80 -p 443:443 \
  3. @superseb superseb revised this gist Aug 15, 2018. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion rancher-singlenodeinstall-selfsignedcert.sh
    Original file line number Diff line number Diff line change
    @@ -46,4 +46,4 @@ done

    echo ""

    docker run superseb/rancher-check "https://${FQDN}"
    docker run --rm --net=host superseb/rancher-check "https://${FQDN}"
  4. @superseb superseb revised this gist Aug 15, 2018. 1 changed file with 2 additions and 0 deletions.
    2 changes: 2 additions & 0 deletions rancher-singlenodeinstall-selfsignedcert.sh
    Original file line number Diff line number Diff line change
    @@ -17,6 +17,7 @@ export SSL_EXPIRE="365" # Certificate expires in 1 year
    export SSL_SUBJECT="${FQDN}"
    export SSL_DNS="${FQDN}" # Additional SANs (comma separated) can be added
    #export SSL_IP="127.0.0.1,127.0.0.2" # Additional IPs (comma separated) can be added
    export SILENT="true"

    docker run -v $PWD/certs:/certs \
    -e CA_SUBJECT \
    @@ -25,6 +26,7 @@ docker run -v $PWD/certs:/certs \
    -e SSL_SUBJECT \
    -e SSL_DNS \
    -e SSL_IP \
    -e SILENT \
    paulczar/omgwtfssl

    docker run -d --restart=unless-stopped \
  5. @superseb superseb revised this gist Aug 14, 2018. 1 changed file with 1 addition and 0 deletions.
    1 change: 1 addition & 0 deletions rancher-singlenodeinstall-selfsignedcert.sh
    Original file line number Diff line number Diff line change
    @@ -29,6 +29,7 @@ docker run -v $PWD/certs:/certs \

    docker run -d --restart=unless-stopped \
    -p 80:80 -p 443:443 \
    -v $PWD/rancher:/var/lib/rancher \
    -v $PWD/certs/cert.pem:/etc/rancher/ssl/cert.pem \
    -v $PWD/certs/key.pem:/etc/rancher/ssl/key.pem \
    -v $PWD/certs/ca.pem:/etc/rancher/ssl/cacerts.pem \
  6. @superseb superseb revised this gist Aug 13, 2018. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion rancher-singlenodeinstall-selfsignedcert.sh
    Original file line number Diff line number Diff line change
    @@ -15,7 +15,7 @@ export CA_SUBJECT="My own root CA"
    export CA_EXPIRE="1825" # CA expires in 5 years
    export SSL_EXPIRE="365" # Certificate expires in 1 year
    export SSL_SUBJECT="${FQDN}"
    export SSL_DNS="${FQDN},sebftw.1337.com" # Additional SANs (comma separated) can be added
    export SSL_DNS="${FQDN}" # Additional SANs (comma separated) can be added
    #export SSL_IP="127.0.0.1,127.0.0.2" # Additional IPs (comma separated) can be added

    docker run -v $PWD/certs:/certs \
  7. @superseb superseb revised this gist Aug 10, 2018. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion rancher-singlenodeinstall-selfsignedcert.sh
    Original file line number Diff line number Diff line change
    @@ -11,7 +11,7 @@ fi

    # Set config here
    export FQDN=$1
    export CA_SUBJECT="Sebs CA"
    export CA_SUBJECT="My own root CA"
    export CA_EXPIRE="1825" # CA expires in 5 years
    export SSL_EXPIRE="365" # Certificate expires in 1 year
    export SSL_SUBJECT="${FQDN}"
  8. @superseb superseb revised this gist Aug 10, 2018. 1 changed file with 5 additions and 4 deletions.
    9 changes: 5 additions & 4 deletions rancher-singlenodeinstall-selfsignedcert.sh
    Original file line number Diff line number Diff line change
    @@ -11,19 +11,20 @@ fi

    # Set config here
    export FQDN=$1
    export CA_SUBJECT="My own root CA"
    export CA_SUBJECT="Sebs CA"
    export CA_EXPIRE="1825" # CA expires in 5 years
    export SSL_EXPIRE="365" # Certificate expires in 1 year
    export SSL_SUBJECT="${FQDN}"
    export SSL_DNS="${FQDN}" # Additional SANs (comma separated) can be added
    # export SSL_IP="127.0.0.1" # Additional IPs (comma separated) can be added
    export SSL_DNS="${FQDN},sebftw.1337.com" # Additional SANs (comma separated) can be added
    #export SSL_IP="127.0.0.1,127.0.0.2" # Additional IPs (comma separated) can be added

    docker run -v $PWD/certs:/certs \
    -e CA_SUBJECT \
    -e CA_EXPIRE \
    -e SSL_EXPIRE \
    -e SSL_SUBJECT \
    -e SSL_DNS \
    -e SSL_IP \
    paulczar/omgwtfssl

    docker run -d --restart=unless-stopped \
    @@ -42,4 +43,4 @@ done

    echo ""

    docker run superseb/rancher-check "https://${FQDN}"
    docker run superseb/rancher-check "https://${FQDN}"
  9. @superseb superseb renamed this gist Aug 10, 2018. 1 changed file with 0 additions and 0 deletions.
  10. @superseb superseb created this gist Aug 10, 2018.
    45 changes: 45 additions & 0 deletions rancher-selfsigned-single.sh
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,45 @@
    #!/bin/bash
    if [[ $DEBUG == "true" ]]; then
    set -x
    fi

    # Check if FQDN is given
    if [ -z "$1" ]; then
    echo "Usage: $0 rancher.yourdomain.com"
    exit 1
    fi

    # Set config here
    export FQDN=$1
    export CA_SUBJECT="My own root CA"
    export CA_EXPIRE="1825" # CA expires in 5 years
    export SSL_EXPIRE="365" # Certificate expires in 1 year
    export SSL_SUBJECT="${FQDN}"
    export SSL_DNS="${FQDN}" # Additional SANs (comma separated) can be added
    # export SSL_IP="127.0.0.1" # Additional IPs (comma separated) can be added

    docker run -v $PWD/certs:/certs \
    -e CA_SUBJECT \
    -e CA_EXPIRE \
    -e SSL_EXPIRE \
    -e SSL_SUBJECT \
    -e SSL_DNS \
    paulczar/omgwtfssl

    docker run -d --restart=unless-stopped \
    -p 80:80 -p 443:443 \
    -v $PWD/certs/cert.pem:/etc/rancher/ssl/cert.pem \
    -v $PWD/certs/key.pem:/etc/rancher/ssl/key.pem \
    -v $PWD/certs/ca.pem:/etc/rancher/ssl/cacerts.pem \
    rancher/rancher:latest

    echo "Waiting for Rancher to be started"
    while true; do
    docker run --rm --net=host appropriate/curl -sLk "https://$FQDN/ping" && break
    echo -n "."
    sleep 5
    done

    echo ""

    docker run superseb/rancher-check "https://${FQDN}"