Skip to content

Commit

Permalink
Add make rule to test serving locally and notes in README
Browse files Browse the repository at this point in the history
  • Loading branch information
maeve-fpf committed Sep 30, 2020
1 parent ae1b1f9 commit ea70129
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 2 deletions.
11 changes: 11 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,9 +1,20 @@
timestamp := $(shell cat latest-rulesets-timestamp)
image := fpf.local/securedrop-https-everywhere-ruleset:$(timestamp)

.PHONY: test-key
test-key: ## Generates a test key for development/testing purposes locally.
openssl genrsa -out key.pem 4096
openssl rsa -in key.pem -outform PEM -pubout -out public.pem
python jwk.py > test-key.jwk

.PHONY: serve
serve: ## Builds Nginx container to serve generated files
@docker build --build-arg "timestamp=$(timestamp)" -t "$(image)" -f docker/Dockerfile .
@echo "=============================================================================="
@echo " Serving ruleset at http://localhost:4080/https-everywhere/ "
@echo "=============================================================================="
@docker run --rm -p 4080 "$(image)"

.PHONY: help
help:
@grep -E '^[a-zA-Z_-]+:.*?## .*$$' $(MAKEFILE_LIST) | sort | awk 'BEGIN {FS = ":.*?## "}; {printf "\033[36m%-30s\033[0m %s\n", $$1, $$2}'
12 changes: 10 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,14 @@ For the production rules this signing must be done via the official signing cere

Once you have the signature, place the files to serve in the root of the git tree in this repository, and then update the directory listing in `index.html` using the `update_index.sh` shell script in this directory.

Inspect the diff. If it looks good, commit the resulting `index.html` and all files to be served.
# Verifying

Upon merge the ruleset release will be live.
Inspect the diff. If it looks good, commit the resulting `index.html` and all files to be served. To test locally, run

make serve

And configure your browser to use `http://localhost:4080/https-everywhere/`.

# Deployment

Upon merge the container will be published to `quay.io/freedomofpress` and the new tag will be deployed automatically.

0 comments on commit ea70129

Please sign in to comment.