Deploy a server to terminate SSL and reverse proxy requests back to developer servers using accounts automatically created from GitHub users' SSH keys.
Right now if you get a big list of users for your org and then 3 months later regenerate this list of users, any users that have left your org and are not in the user.txt file stick around and still can use the service.
We should allow a --delete flag or something to be passed in such that any user not in the user.txt file is deleted (vhost, TLS cert, login, home dir etc.)
When login in with SSH, some information is printed in the console about the host. Would be great if the URLs can be calculated and printed out in the session console so the user doesn't need to figure out what is the final URL, specially taking into account that the final URL does not have the same domain that the domain used to log in with SSH.
right now we use SAN calls for just 2 per user. However, we could stack them up a LOT more and be able to on-board hundreds of users at once given 100 Names per Certificate.
This code was in there but then I realized you'd have trouble re-running the script for just a user or two b/c they'd be wedged in there with other SANs and you'd end up with a LOT of extra certs. Maybe that'd be ok and it's just work out ๐คท ?
echo""echo" ------ Fetching certs from Let's Encrypt... ------ "echo""
COUNTER=0
SUBCOUNTER=0
foriin"${VALID_USERS[@]}";do
FQDN="${i}.${DOMAIN}"
FQDN_ssl="${i}-ssl.${DOMAIN}"if [[ $COUNTER!= 0 ]] ;then
DOMAINS="${FQDN},${FQDN_ssl},${DOMAINS}"else
DOMAINS="${FQDN},${FQDN_ssl}"filet COUNTER++
let SUBCOUNTER++
# run certbot with every 40 domains (2 x per user, so SUBCOUNTER# at 20) or at end of arrayif [[ ${#VALID_USERS[@]}==$COUNTER ]] || [[ $SUBCOUNTER== 20 ]];then
SUBCOUNTER=0
sudo certbot --apache --non-interactive --agree-tos --email $EMAIL -d $DOMAINSfidone