-
-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
refactor: change utils to keys generate (#27)
- Loading branch information
Showing
2 changed files
with
42 additions
and
32 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 |
---|---|---|
@@ -0,0 +1,42 @@ | ||
# | ||
# See ./docs/contributing.md | ||
# | ||
|
||
## show keys.help | ||
.PHONY: keys.help | ||
keys.help: | ||
@echo ' keys:' | ||
@echo '' | ||
@echo ' keys help keys' | ||
@echo ' keys.openssl make key openssl by stage' | ||
@echo ' keys.pem make key openssl by stage' | ||
@echo '' | ||
|
||
## show help keys commands | ||
.PHONY: keys | ||
keys: | ||
make keys.help | ||
|
||
## show keys make | ||
.PHONY: keys.openssl | ||
keys.openssl: | ||
@if [ -z "${stage}" ]; then \ | ||
echo "is neccesary add a stage"; \ | ||
exit 2; \ | ||
fi | ||
mkdir -p ${KEYBASE_PATH}/${stage}/openssl/ | ||
openssl genrsa -out ${PROJECT}-${stage}.pem 2048 | ||
openssl rsa -in ${PROJECT}-${stage}.pem -pubout -out ${PROJECT}-${stage}.public.pem | ||
mv ${PROJECT}-${stage}.pem ${KEYBASE_PATH}/${stage}/openssl/${PROJECT}-${stage}.pem | ||
mv ${PROJECT}-${stage}.public.pem ${KEYBASE_PATH}/${stage}/openssl/${PROJECT}-${stage}.pem | ||
|
||
## Generate key rsa pem | ||
.PHONY: keys.pem | ||
keys.pem: | ||
@if [ -z "${stage}" ]; then \ | ||
echo "is neccesary add a stage"; \ | ||
exit 2; \ | ||
fi | ||
@ssh-keygen -q -m PEM -t rsa -b 4096 -C "admin@${PROJECT}-${stage}.com" -f ${PROJECT}-${stage} -P "" | ||
@openssl rsa -in ${PROJECT}-${stage} -outform pem > ${PROJECT}-${stage}.pem | ||
@chmod 0600 ${PROJECT}-${stage}.pem |
This file was deleted.
Oops, something went wrong.