-
Notifications
You must be signed in to change notification settings - Fork 55
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Update README. #414
Merged
Merged
Update README. #414
Changes from 5 commits
Commits
Show all changes
6 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -34,10 +34,27 @@ own and can obtain certificates for. | |
1. Install Go version 1.10 or higher. Optionally, set | ||
[$GOPATH](https://github.com/golang/go/wiki/GOPATH) to something (default | ||
is `~/go`) and/or add `$GOPATH/bin` to `$PATH`. | ||
2. `go get -u -mod=vendor github.com/ampproject/amppackager/cmd/amppkg` | ||
|
||
Optionally, move the built `~/go/bin/amppkg` wherever you like. | ||
3. Create a file `amppkg.toml`. A minimal config looks like this: | ||
1. Get amppackager. | ||
|
||
For Go 1.14 and higher versions run: | ||
|
||
``` | ||
go get -u github.com/ampproject/amppackager/cmd/amppkg | ||
``` | ||
|
||
For Go 1.13 and earlier versions run: | ||
|
||
``` | ||
go get -u -mod=vendor github.com/ampproject/amppackager/cmd/amppkg | ||
``` | ||
|
||
1. Optionally, move the built `~/go/bin/amppkg` wherever you like. | ||
1. Prepare a temporary certificate and private key pair to use for signing the | ||
exchange when testing your config. Follow WICG | ||
[instructions](https://github.com/WICG/webpackage/tree/master/go/signedexchange#creating-our-first-signed-exchange) | ||
to ensure compliance with the [WICG certificate | ||
requirements](https://wicg.github.io/webpackage/draft-yasskin-httpbis-origin-signed-exchanges-impl.html#cross-origin-cert-req). | ||
1. Create a file `amppkg.toml`. A minimal config looks like this: | ||
``` | ||
LocalOnly = true | ||
CertFile = 'path/to/fullchain.pem' | ||
|
@@ -49,7 +66,7 @@ own and can obtain certificates for. | |
Domain = "amppackageexample.com" | ||
``` | ||
More details can be found in [amppkg.example.toml](amppkg.example.toml). | ||
4. `amppkg -development` | ||
1. `amppkg -development` | ||
|
||
If `amppkg.toml` is not in the current working directory, pass | ||
`-config=/path/to/amppkg.toml`. | ||
|
@@ -63,10 +80,15 @@ container. | |
|
||
1. Run Chrome with the following commandline flags: | ||
``` | ||
--user-data-dir=/tmp/udd | ||
--ignore-certificate-errors-spki-list=$(openssl x509 -pubkey -noout -in path/to/fullchain.pem | openssl pkey -pubin -outform der | openssl dgst -sha256 -binary | base64) | ||
--enable-features=SignedHTTPExchange | ||
'data:text/html,<a href="https://localhost:8080/priv/doc/https://amppackageexample.com/">click me' | ||
alias chrome = [FULL PATH TO CHROME BINARY] | ||
PATH_TO_FULLCHAIN_PEM = [FULL PATH TO fullchain.pem] | ||
chrome --user-data-dir=/tmp/udd\ | ||
--ignore-certificate-errors-spki-list=$(\ | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Added line breaks for readability. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. LGTM |
||
openssl x509 -pubkey -noout -in $PATH_TO_FULLCHAIN_PEM |\ | ||
openssl pkey -pubin -outform der |\ | ||
openssl dgst -sha256 -binary | base64)\ | ||
--enable-features=SignedHTTPExchange\ | ||
'data:text/html,<a href="https://localhost:8080/priv/doc/https://amppackageexample.com/">click me' | ||
``` | ||
2. Open DevTools. Check 'Preserve log'. | ||
3. Click the `click me` link. | ||
|
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I didn't notice "path/to/fullchain.pem" template in the command below:
Added a dedicated variable PATH_TO_FULLCHAIN_PEM so the requirement to insert the user cert path becomes explicit.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM