Skip to content

Instantly share code, notes, and snippets.

@gcoda
Created December 31, 2018 21:43
Show Gist options
  • Save gcoda/222b7b1fc4c580046fe2b9e6bb09c4c3 to your computer and use it in GitHub Desktop.
Save gcoda/222b7b1fc4c580046fe2b9e6bb09c4c3 to your computer and use it in GitHub Desktop.
Google App Engine - Lets Encrypt Wildcard

Make a script from this gist

Update the script

#!/usr/bin/env bash

cat cert-update.md | sed -n '/^```bash/,/```/p' | sed 's/^```/# /' | tail -n +2 > cert-update.sh

Verify Domain

at Google Webmasters

Create a servicae account

Go to Google Cloud Console IAM. Create a service account with role DNS Administrator cert-update@v-page.iam.gserviceaccount.com Save as json to ./lego/service-account.json

Run Lego

docker run \
  -v /home/gcoda/Private/v-page/lego:/.lego \
  -e GCE_PROJECT=v-page \
  -e GCE_SERVICE_ACCOUNT_FILE=/.lego/service-account.json \
  xenolf/lego \
  --email="gcoding@gmail.com" --accept-tos \
  --domains="*.nobs.pw" --dns="gcloud" \
  run

Upload a certificate with GUI, first time only

Get certivicate id from a list gcloud app ssl-certificates list

Update

gcloud app \
  ssl-certificates update 10857708 \
  --project v-page \
  --display-name=letsencrypt.nobs.pw \
  --certificate=./lego/certificates/_.nobs.pw.crt \
  --private-key=./lego/certificates/_.nobs.pw.key
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment