-
Notifications
You must be signed in to change notification settings - Fork 133
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add Keys, Script and Signing Service to dev environment
This PR adds: - secret and public keys on dev/common/ - imports and trusts keys on container build time - add make docker/add-signing-service TODO: - [ ] Route URL to spawn sign task (subclass pulp_ansible#754 serializer) - [ ] Surface the signature on collectionversion serializer - [ ] Add test to sign a collection Issue: AAH-1181 Required PR: pulp/pulp_ansible#754 env:LOCK_REQUIREMENTS=0 env:PULP_CONTAINER_REVISION=39b3000150960c554d2124ab3654e3e7b4c54352 env:PULPCORE_REVISION=f8306ac5d3af1cf9936d39abb0568e86d18cd55f env:GALAXY_IMPORTER_REVISION=7091519f38acb8e10b85baffe7c6074b02309598
- Loading branch information
1 parent
c2eb855
commit d3f1de7
Showing
9 changed files
with
81 additions
and
5 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 |
---|---|---|
|
@@ -5,4 +5,3 @@ venv/ | |
pip-wheel-metadata/ | ||
**/__pycache__/ | ||
.git/ | ||
dev/ |
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 |
---|---|---|
@@ -0,0 +1 @@ | ||
Add keys, script and signing service to dev env |
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 |
---|---|---|
|
@@ -7,13 +7,13 @@ DJ_MANAGER = $(shell if [ "$(RUNNING)" == "" ]; then echo manage; else echo djan | |
|
||
define exec_or_run | ||
# Tries to run on existing container if it exists, otherwise starts a new one. | ||
@echo $(1)$(2)$(3)$(4)$(5) | ||
@echo $(1)$(2)$(3)$(4)$(5)$(6) | ||
@if [ "$(RUNNING)" != "" ]; then \ | ||
echo "Running on existing container $(RUNNING)" 1>&2; \ | ||
./compose exec $(1) $(2) $(3) $(4) $(5); \ | ||
./compose exec $(1) $(2) $(3) $(4) $(5) $(6); \ | ||
else \ | ||
echo "Starting new container" 1>&2; \ | ||
./compose run --use-aliases --service-ports --rm $(1) $(2) $(3) $(4) $(5); \ | ||
./compose run --use-aliases --service-ports --rm $(1) $(2) $(3) $(4) $(5) $(6); \ | ||
fi | ||
endef | ||
|
||
|
@@ -92,6 +92,10 @@ docker/makemigrations: ## Run django migrations | |
docker/migrate: ## Run django migrations | ||
$(call exec_or_run, api, $(DJ_MANAGER), migrate) | ||
|
||
.PHONY: docker/add-signing-service | ||
docker/add-signing-service: ## Add a Signing service using default GPG key | ||
$(call exec_or_run, worker, $(DJ_MANAGER), add-signing-service, ansible-default, /var/lib/pulp/scripts/collection_sign.sh, [email protected]) | ||
|
||
.PHONY: docker/resetdb | ||
docker/resetdb: ## Cleans database | ||
# Databases must be stopped to be able to reset them. | ||
|
@@ -109,6 +113,7 @@ docker/all: ## Build, migrate, loaddata, transl | |
make docker/migrate | ||
make docker/loaddata | ||
make docker/translations | ||
make docker/add-signing-service | ||
|
||
# Application management and debugging | ||
|
||
|
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
Binary file not shown.
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 |
---|---|---|
@@ -0,0 +1,41 @@ | ||
-----BEGIN PGP PUBLIC KEY BLOCK----- | ||
|
||
mQGNBGGyPsgBDACpWO2BexH3orSI2ksseqLjQ9h6Eq2HaBQdJLLQZZvkiWB/e3Gy | ||
8gvO3wgP7XxcIH09kddvmEFa4BXheXNd74qKTdoKh5UX2oFnw1rDwrQjcMKxJnjm | ||
Yku6br68kMfaNkwyQrSY7ww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wYOP/zAWrble9RdUsRZF/K | ||
dcWrMZmkDSqOch6Qbp+vc8n/Z1rFiNvyfbiAkQ/Z9BW3+iHolEGHwq4i/O9Xx5bq | ||
NWuRMs3XgtmQpAxFi2C8nGo5E8eDUw4qKHXYNkcuOraay0wBNpoffISO4+d24GB4 | ||
I6KUd9Bv1wf+etJ50jZ0dzt+T1Qs2wKbtf0= | ||
=PHJy | ||
-----END PGP PUBLIC KEY BLOCK----- |
Binary file not shown.
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 |
---|---|---|
@@ -0,0 +1,20 @@ | ||
#!/usr/bin/env bash | ||
|
||
FILE_PATH=$1 | ||
SIGNATURE_PATH="$1.asc" | ||
|
||
ADMIN_ID="[email protected]" | ||
PASSWORD="Galaxy2022" | ||
|
||
# Create a detached signature | ||
gpg --quiet --batch --pinentry-mode loopback --yes --passphrase \ | ||
$PASSWORD --homedir ~/.gnupg/ --detach-sign --default-key $ADMIN_ID \ | ||
--armor --output $SIGNATURE_PATH $FILE_PATH | ||
|
||
# Check the exit status | ||
STATUS=$? | ||
if [ $STATUS -eq 0 ]; then | ||
echo {\"file\": \"$FILE_PATH\", \"signature\": \"$SIGNATURE_PATH\"} | ||
else | ||
exit $STATUS | ||
fi |
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