<commit_before>TAG ?= $(shell git rev-parse HEAD)
IMAGE = securedrop

.PHONY: assets
assets:
	sass

.PHONY: images
images:
	docker build $(EXTRA_BUILD_ARGS) -f Dockerfile -t $(IMAGE)-test:$(TAG) .

.PHONY: test
test:
	docker run --privileged \
		-e COMMIT_SHA=$(TAG) \
		$(EXTRA_TEST_ARGS) \
		--name $(IMAGE)-test \
		-ti $(IMAGE)-test:$(TAG) \
		./bin/test -v $(TESTFILES)

.PHONY: testclean
testclean:
	-docker rm -f $(IMAGE)-test

.PHONY: dev
dev:
	docker run \
		-p8080:8080 -p8081:8081 \
		$(EXTRA_DEV_ARGS) \
		-v $(shell pwd):/app \
		-ti $(IMAGE)-test:$(TAG) \
		./bin/dev


config.py: test-config

.PHONY: test-config
test-config:
	source_secret_key=$(shell head -c 32 /dev/urandom | base64) \
	journalist_secret_key=$(shell head -c 32 /dev/urandom | base64) \
	scrypt_id_pepper=$(shell head -c 32 /dev/urandom | base64) \
	scrypt_gpg_pepper=$(shell head -c 32 /dev/urandom | base64) \<commit_msg>securedrop: add dev-shell target<commit_after>TAG ?= $(shell git rev-parse HEAD)
IMAGE = securedrop

.PHONY: assets
assets:
	sass

.PHONY: images
images:
	docker build $(EXTRA_BUILD_ARGS) -f Dockerfile -t $(IMAGE)-test:$(TAG) .

.PHONY: test
test:
	docker run --privileged \
		-e COMMIT_SHA=$(TAG) \
		$(EXTRA_TEST_ARGS) \
		--name $(IMAGE)-test \
		-ti $(IMAGE)-test:$(TAG) \
		./bin/test -v $(TESTFILES)

.PHONY: testclean
testclean:
	-docker rm -f $(IMAGE)-test

.PHONY: dev
dev:
	docker run \
		-p8080:8080 -p8081:8081 \
		$(EXTRA_DEV_ARGS) \
		-v $(shell pwd):/app \
		-ti $(IMAGE)-test:$(TAG) \
		./bin/dev

.PHONY: dev-shell
dev-shell:
	docker run \
		-p8080:8080 -p8081:8081 \
		$(EXTRA_DEV_ARGS) \
		-v $(shell pwd):/app \
		-ti $(IMAGE)-test:$(TAG) \
		bash

config.py: test-config

.PHONY: test-config
test-config:
	source_secret_key=$(shell head -c 32 /dev/urandom | base64) \
	journalist_secret_key=$(shell head -c 32 /dev/urandom | base64) \
	scrypt_id_pepper=$(shell head -c 32 /dev/urandom | base64) \
	scrypt_gpg_pepper=$(shell head -c 32 /dev/urandom | base64) \
{'fraction_non_alphanumeric': 0.17413185707096124, 'fraction_numerical': 0.04026170105686965, 'mean_word_length': 3.2569593147751608, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2838926', 'n_tokens_mistral': 929, 'n_tokens_neox': 826, 'n_words': 191}