Skip to content

Commit 11c1e4c

Browse files
authored
Merge pull request #386 from ampproject/master
Snapshot release v3
2 parents c9993b8 + 865eab3 commit 11c1e4c

File tree

2,942 files changed

+659638
-109877
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

2,942 files changed

+659638
-109877
lines changed

Gopkg.lock

Lines changed: 0 additions & 134 deletions
This file was deleted.

Gopkg.toml

Lines changed: 0 additions & 33 deletions
This file was deleted.

README.md

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ own and can obtain certificates for.
3434
1. Install Go version 1.10 or higher. Optionally, set
3535
[$GOPATH](https://github.com/golang/go/wiki/GOPATH) to something (default
3636
is `~/go`) and/or add `$GOPATH/bin` to `$PATH`.
37-
2. `go get -u github.com/ampproject/amppackager/cmd/amppkg`
37+
2. `go get -u -mod=vendor github.com/ampproject/amppackager/cmd/amppkg`
3838

3939
Optionally, move the built `~/go/bin/amppkg` wherever you like.
4040
3. Create a file `amppkg.toml`. A minimal config looks like this:
@@ -78,7 +78,7 @@ container.
7878
#### Demonstrate privacy-preserving prefetch
7979
8080
This step is optional; just to show how [privacy-preserving
81-
prefetch](https://wicg.github.io/webpackage/draft-yasskin-webpackage-use-cases.html#private-prefetch)
81+
prefetch](https://wicg.github.io/webpackage/draft-yasskin-wpack-use-cases.html#private-prefetch)
8282
works with SXGs.
8383
8484
1. `go get -u github.com/ampproject/amppackager/cmd/amppkg_dl_sxg`.
@@ -131,7 +131,9 @@ For now, productionizing is a bit manual. The minimum steps are:
131131
team will release a new version approximately this often. Soon after each
132132
release, Googlebot will increment the version it requests with
133133
`AMP-Cache-Transform`. Googlebot will only allow the latest 2-3 versions
134-
(details are still TBD), so an update is necessary but not immediately.
134+
(details are still TBD), so an update is necessary but not immediately. If
135+
amppkg doesn't support the requested version range, it will fall back to
136+
serving unsigned AMP.
135137
136138
To keep subscribed to releases, you can select "Releases only" from the
137139
"Watch" dropdown in GitHub, or use [various tools](https://stackoverflow.com/questions/9845655/how-do-i-get-notifications-for-commits-to-a-repository)

amppkg.example.toml

Lines changed: 98 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,26 @@
4747
# SHA-256).
4848
CertFile = './pems/cert.pem'
4949

50+
# The path to save a new cert retrieved from the CA if the current cert in
51+
# 'CertFile' above is still valid.
52+
# This is optional and is needed only if you have 'autorenewcert' turned on.
53+
# For multi-replica setups (multiple AMP Packager instances), only the replica
54+
# that will do the autorenewal of certs needs this config item set.
55+
# NewCertFile = './pems/newcert.pem'
56+
57+
# The path to the Certificate Signing Request (CSR) that is needed to request
58+
# new certificates from the Certificate Authority using ACME.
59+
# CSRs are typically created using the openssl command:
60+
# openssl req -new -key /path/to/privkey -out /path/to/cert.csr
61+
# To verify:
62+
# openssl req -text -noout -verify -in cert.csr
63+
# The following docs list examples on how to go about generating CSRs:
64+
# https://www.digicert.com/csr-creation.htm?rid=011592
65+
# https://www.ssl.com/how-to/manually-generate-a-certificate-signing-request-csr-using-openssl/
66+
# https://geekflare.com/san-ssl-certificate/
67+
# This is optional and is needed only if you have 'autorenewcert' turned on.
68+
# CSRFile = './pems/cert.csr'
69+
5070
# The path to the PEM file containing the private key that corresponds to the
5171
# leaf certificate in CertFile.
5272
KeyFile = './pems/privkey.pem'
@@ -170,3 +190,81 @@ ForwardedRequestHeaders = []
170190
# Domain = "www.corp.amppackageexample.com"
171191
# PathRE = "/world/.*"
172192
# QueryRE = ""
193+
194+
# IMPORTANT NOTE: the support of the ACME protocol and automatic renewal of certificates is currently in the
195+
# EXPERIMENTAL stage. Once we have more experience with people using it out in the wild, we will gradually
196+
# move it to PRODUCTION mode.
197+
#
198+
# ACME is a protocol that allows for automatic renewal of certificates. AMP Packager uses an ACME library
199+
# https://github.com/go-acme/lego to handle certificate renewal. Automatic certificate renewal is enabled
200+
# in AMP Packager via the 'autorenewcert' flag. Turning the flag on will enable AMP Packager to automatically
201+
# request certificate renewals whenever it has determined that the current certificate is expired or about to
202+
# expire.
203+
#
204+
# ACMEConfig only needs to be present in the toml file if 'autorenewcert' command line flag was turned on.
205+
# If the flag is on, at least one of ACMEConfig.Production or ACMEConfig.Development should be present.
206+
# Note that a recommended best practice for setting up the cert renewal that minimizes both cost and bombarding
207+
# your Certificate Authority with requests is that for a multi-instance setup of AMP packager, only one instance is
208+
# setup to do automatic cert renewals and the rest of the instances will just be configured to reload the fresh
209+
# certificate from disk when their in-memory copies expire. This also implies that the cert paths configured above
210+
# in 'CertFile' and 'NewCertFile' are located on a shared filesystem accessible by all AMP packager instances.
211+
#
212+
# For the full ACME spec, see:
213+
# https://tools.ietf.org/html/draft-ietf-acme-acme-02
214+
# https://ietf-wg-acme.github.io/acme/draft-ietf-acme-acme.html
215+
# TODO(banaag): consider renaming ACMEConfig to ACME
216+
# [ACMEConfig]
217+
# This config will be used if 'autorenewcert' is turned on and 'development' is turned off.
218+
# If the flags above are on but we don't have an entry here, AMP Packager will not start.
219+
# [ACMEConfig.Production]
220+
# This is the ACME discovery URL that is used for ACME http requests to the Certificate Authority that
221+
# doles out the certificates.
222+
# Currently, the only CA that supports automatic signed exchange cert renewals is Digicert:
223+
# https://docs.digicert.com/certificate-tools/acme-user-guide/acme-directory-urls-signed-http-exchange-certificates/
224+
# DiscoURL = "https://production-acme.discovery.url/"
225+
226+
# This is the email address you used to create an account with the Certificate Authority that is registered to
227+
# request signed exchange certificates.
228+
# EmailAddress = "[email protected]"
229+
230+
# For the remaining configuration items, it's important to understand the different challenges employed as
231+
# part of the ACME protocol. See:
232+
# https://ietf-wg-acme.github.io/acme/draft-ietf-acme-acme.html#identifier-validation-challenges
233+
# https://letsencrypt.org/docs/challenge-types/
234+
# https://certbot.eff.org/docs/challenges.html?highlight=http
235+
# Note that you don't need to have all the challenges configured, it's typically sufficient to have one configured.
236+
# The exception arises when you have to deal with wildcard certificates, see below.
237+
238+
# This is the http server root directory where the ACME http challenge token could be deposited. Note that you may
239+
# need to do some configuration work to get this setup to work where multiple instances of AMP Packager is running.
240+
# For example:
241+
# https://community.letsencrypt.org/t/how-to-nginx-configuration-to-enable-acme-challenge-support-on-all-http-virtual-hosts/5622/3
242+
# HttpWebRootDir = '/path/to/www_root_dir'
243+
244+
# This is the port used by the AMP Packager to respond to the HTTP challenge issued as part of ACME protocol.
245+
# Note that if your setup only opens up certain ports, you may need to do a configuration change where you forward
246+
# requests to this port using proxy_pass, for example:
247+
# https://medium.com/@dipeshwagle/add-https-using-lets-encrypt-to-nginx-configured-as-a-reverse-proxy-on-ubuntu-b4455a729176
248+
# HttpChallengePort = 5002
249+
250+
# This is the port used by AMP packager to respond to the TLS challenge issued as part of the ACME protocol.
251+
# TlsChallengePort = 5003
252+
253+
# This is the DnsProvider to be used in fulfilling the ACME DNS challenge. Note that you only need the DNS challenge
254+
# setup if you have wildcard certificates. See: https://searchsecurity.techtarget.com/definition/wildcard-certificate
255+
# For the DNS challenge, go-acme/lego, there are certain environment variables that need to be set up which depends on
256+
# the DNS provider that you use to fulfill the DNS challenge. See:
257+
# https://go-acme.github.io/lego/dns/
258+
# DnsProvider = "gcloud"
259+
260+
# This config will be used if 'autorenewcert' is turned on and 'development' is turned on.
261+
# If the flags above are on but we don't have an entry here, AMP Packager will not start.
262+
# All the other fields below have the same semantics as the one in ACMEConfig.Production above.
263+
# For development mode, given that we don't require the SXG extension, one can use Let's Encrypt CA to generate the certs.
264+
# [ACMEConfig.Development]
265+
# DiscoURL = "https://development-acme.discovery.url/"
266+
# EmailAddress = "[email protected]"
267+
# HttpChallengePort = 5002
268+
# HttpWebRootDir = '/path/to/www_root_dir'
269+
# TlsChallengePort = 5003
270+
# DnsProvider = "gcloud"

0 commit comments

Comments
 (0)