-
-
Save danielnunez/78b8ccaf02a5010edcf2edc18f731d9b to your computer and use it in GitHub Desktop.
Minio using Let's Encrypt certbot obtained certificates
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
if [ "$#" -ne 2 ]; then | |
echo "Usage: $0 fqdn email" | |
exit 1 | |
fi | |
docker run -p 80:80 -p 443:443 -v /etc/letsencrypt:/etc/letsencrypt certbot/certbot certonly --standalone --agree-tos --reinstall --force-renewal --non-interactive --text --rsa-key-size 4096 --email $2 --domains $1 | |
mkdir -p /root/.minio/certs | |
cp /etc/letsencrypt/live/$1/fullchain.pem /root/.minio/certs/public.crt | |
cp /etc/letsencrypt/live/$1/privkey.pem /root/.minio/certs/private.key | |
echo "Run the following command:" | |
ACCESS_KEY=$(cat /dev/urandom | tr -dc 'a-zA-Z0-9' | fold -w 32 | head -n 1) | |
SECRET_KEY=$(cat /dev/urandom | tr -dc 'a-zA-Z0-9' | fold -w 32 | head -n 1) | |
echo docker run -d --name=minio -p 443:443 -ti -e MINIO_ACCESS_KEY=$ACCESS_KEY -e MINIO_SECRET_KEY=$SECRET_KEY -v /root/.minio:/root/.minio/ -v /root/data:/data minio/minio server --address ":443" /data | |
echo "" | |
echo "To use mc, use docker run -it --entrypoint=/bin/sh minio/mc" | |
echo "And configure: mc config host add minio https://$1 $ACCESS_KEY $SECRET_KEY" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment