Commit d05f1a75 authored by Andy Mayhew's avatar Andy Mayhew

Initial adds.

parent 74ffc890
*~
_site
.DS_Store
*.sublime-project
*.sublime-workspace
codekit-config.json
node_modules
Gemfile.lock
.sass-cache
.jekyll-metadata
local-test.sh
GitLab/Certbot SSL Renewal
\ No newline at end of file
## [GitLab](https://gitlab.com/)/[Certbot](https://certbot.eff.org/lets-encrypt/) SSL Renewal
**Usage:** `certbot certonly --manual --preferred-challenges=http -n --manual-public-ip-logging-ok --config-dir ./ --work-dir ./ --manual-auth-hook ./gitlab-auth-hook.sh --manual-cleanup-hook ./gitlab-put-certs.sh --config [CERTBOT.ini]
**Example:** `certbot certonly --config autonomic-guru.ini --manual-auth-hook ./gitlab-auth-hook.sh --manual --preferred-challenges=http -n --manual-public-ip-logging-ok --work-dir /Users/andy/tmp/certbot/ --config-dir ./ --manual-cleanup-hook ./gitlab-put-certs.sh `
\ No newline at end of file
#!/bin/bash
baseDir="[DIRw/oTrailingSlash]"
GLDir="${baseDir}/[pages clone]"
SaveDir="${GLDir}/le"
CertPath="/.well-known/acme-challenge/"
echo ${CERTBOT_VALIDATION} > ${SaveDir}/${CERTBOT_TOKEN}
cd ${SaveDir}
git add -- ${CERTBOT_TOKEN}
git commit -m "certbot token" -- ${CERTBOT_TOKEN}
git push
while true; do
resp=`curl -s -I "http://${CERTBOT_DOMAIN}${CertPath}${CERTBOT_TOKEN}" | grep HTTP | awk '{print $2 }'`
if [ "${resp}" = "200" ]; then
break
fi
sleep 15
done
#!/bin/bash
baseDir="[ssl-renew-directory]"
certDir="${baseDir}/live/[1st-domain]"
glProjectId="[pages Project ID]"
glToken="[GitLab API Token]"
glAPI="https://gitlab.com/api/v4/projects/${glProjectId}/pages/domains"
for i in `curl -s --header "PRIVATE-TOKEN: ${glToken}" ${glAPI} | jq ".[].domain" | sed 's/"//g'`; do
echo "Updating certificate for: $i"
curl -s --request PUT --header "PRIVATE-TOKEN: ${glToken}" --form "[email protected]${certDir}/fullchain.pem" --form "[email protected]${certDir}/privkey.pem" ${glAPI}/$i | jq .
done
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment