-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add make rule to test serving locally and notes in README
- Loading branch information
Showing
2 changed files
with
21 additions
and
2 deletions.
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 |
---|---|---|
@@ -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}' |
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