-
Notifications
You must be signed in to change notification settings - Fork 19
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
8 changed files
with
95 additions
and
7 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
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,62 @@ | ||
#!/bin/bash | ||
|
||
function _readlink() { ( | ||
# INFO: readlink does not exists on OSX ¯\_(ツ)_/¯ | ||
cd $(dirname $1) | ||
echo $PWD/$(basename $1) | ||
) } | ||
|
||
pub=$(_readlink ./config_files) | ||
tdir=$(mktemp -d /tmp/qed_build.XXX) | ||
|
||
sign_path=${pub}/id_ed25519 | ||
cert_path=${pub}/server.crt | ||
key_path=${pub}/server.key | ||
|
||
( | ||
cd ${tdir} | ||
|
||
if [ ! -f ${sign_path} ]; then | ||
#build shared signing key | ||
ssh-keygen -t ed25519 -f id_ed25519 -P '' | ||
|
||
cp id_ed25519 ${sign_path} | ||
fi | ||
|
||
|
||
if [ ! -f ${cert_path} ] && [ ! -f ${key_path} ]; then | ||
|
||
#build shared server cert | ||
openssl req \ | ||
-newkey rsa:2048 \ | ||
-nodes \ | ||
-days 3650 \ | ||
-x509 \ | ||
-keyout ca.key \ | ||
-out ca.crt \ | ||
-subj "/CN=*" | ||
openssl req \ | ||
-newkey rsa:2048 \ | ||
-nodes \ | ||
-keyout server.key \ | ||
-out server.csr \ | ||
-subj "/C=GB/ST=London/L=London/O=Global Security/OU=IT Department/CN=*" | ||
openssl x509 \ | ||
-req \ | ||
-days 365 \ | ||
-sha256 \ | ||
-in server.csr \ | ||
-CA ca.crt \ | ||
-CAkey ca.key \ | ||
-CAcreateserial \ | ||
-out server.crt \ | ||
-extfile <(echo subjectAltName = IP:127.0.0.1) | ||
|
||
cp server.crt ${cert_path} | ||
cp server.key ${key_path} | ||
|
||
fi | ||
) | ||
|
||
#build server binary | ||
go build -o ${pub}/qed ../../ |
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,14 @@ | ||
# Info | ||
This folder is a placeholder to deploy in the `qed` servers. | ||
|
||
# Buildind stage | ||
Here you will need the following files. If aren't present, `config_build.sh` | ||
will generate development ones for testing porpouses. | ||
|
||
- `id_ed25519` the private key to sing the snapshots | ||
- `server.crt` the server certificate to use TLS connections | ||
- `server.key` the server key to use TLS connections | ||
|
||
Each execution will generate the following. | ||
|
||
- `qed` the binary to use in the servers. |
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
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,5 @@ | ||
#!/bin/bash | ||
|
||
mkdir -p ./data | ||
|
||
go build -o ./data/storage ../../../../tests/gossip/test_service.go |
This file was deleted.
Oops, something went wrong.
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