parent
a7b4b333a5
commit
b247c8640d
10 changed files with 90 additions and 62 deletions
@ -0,0 +1,19 @@ |
|||||||
|
#!/bin/bash |
||||||
|
set -xe |
||||||
|
source $(dirname $0)/rootdir.sh #set ROOTDIR |
||||||
|
|
||||||
|
SERVER="ortem" |
||||||
|
REMOTE_DIR=/srv/usrv |
||||||
|
REMOTE_PATH=$SERVER:$REMOTE_DIR |
||||||
|
RSYNC="rsync -arzh --progress" |
||||||
|
|
||||||
|
ssh $SERVER mkdir -p $REMOTE_DIR/{release,deploy} |
||||||
|
$RSYNC $ROOTDIR/release/u_server $REMOTE_PATH/release/u_server |
||||||
|
$RSYNC --exclude="*.sh" $ROOTDIR/certs/ $REMOTE_PATH/certs |
||||||
|
$RSYNC $ROOTDIR/migrations/ $REMOTE_PATH/migrations |
||||||
|
$RSYNC $ROOTDIR/.env* $REMOTE_PATH/ |
||||||
|
$RSYNC $ROOTDIR/integration/docker-compose.yml $REMOTE_PATH/deploy/ |
||||||
|
$RSYNC $ROOTDIR/images/integration-tests/u_db* $REMOTE_PATH/deploy/ |
||||||
|
$RSYNC $ROOTDIR/images/integration-tests/u_server.Dockerfile $REMOTE_PATH/deploy/ |
||||||
|
$RSYNC $ROOTDIR/scripts/start_server.sh $REMOTE_PATH/start_server.sh |
||||||
|
ssh $SERVER "cd $REMOTE_DIR/deploy && ./start_server.sh" |
@ -1,16 +1,23 @@ |
|||||||
set -ex |
set -ex |
||||||
DIR=. |
source $(dirname $0)/rootdir.sh #set ROOTDIR |
||||||
|
DIR=$ROOTDIR/certs |
||||||
V3_CFG=$DIR/v3.ext |
V3_CFG=$DIR/v3.ext |
||||||
|
|
||||||
|
mkdir -p $DIR |
||||||
cat > $V3_CFG << EOF |
cat > $V3_CFG << EOF |
||||||
authorityKeyIdentifier=keyid,issuer |
authorityKeyIdentifier=keyid,issuer |
||||||
basicConstraints=CA:FALSE |
basicConstraints=CA:FALSE |
||||||
keyUsage = digitalSignature, nonRepudiation, keyEncipherment, dataEncipherment, keyAgreement, keyCertSign, cRLSign |
keyUsage = digitalSignature, nonRepudiation, keyEncipherment, dataEncipherment, keyAgreement, keyCertSign, cRLSign |
||||||
|
subjectAltName = @alt_names |
||||||
|
|
||||||
|
[alt_names] |
||||||
|
DNS.1 = ortem.xyz |
||||||
|
DNS.2 = u_server |
||||||
EOF |
EOF |
||||||
|
|
||||||
openssl req -x509 -newkey rsa:4096 -keyout $DIR/ca.key -out $DIR/ca.crt -nodes -days 365 -subj "/CN=root" |
openssl req -x509 -newkey rsa:4096 -keyout $DIR/ca.key -out $DIR/ca.crt -nodes -days 365 -subj "/CN=root" |
||||||
openssl req -newkey rsa:4096 -keyout $DIR/alice.key -out $DIR/alice.csr -nodes -days 365 -subj "/CN=alice" |
openssl req -newkey rsa:4096 -keyout $DIR/alice.key -out $DIR/alice.csr -nodes -days 365 -subj "/CN=alice" |
||||||
openssl req -newkey rsa:4096 -keyout $DIR/server.key -out $DIR/server.csr -nodes -days 365 -subj "/CN=u_server" |
openssl req -newkey rsa:4096 -keyout $DIR/server.key -out $DIR/server.csr -nodes -days 365 -subj "/CN=ortem.xyz" |
||||||
openssl x509 -req -in $DIR/alice.csr -CA $DIR/ca.crt -CAkey $DIR/ca.key -out $DIR/alice.crt -set_serial 01 -days 365 -extfile $V3_CFG |
openssl x509 -req -in $DIR/alice.csr -CA $DIR/ca.crt -CAkey $DIR/ca.key -out $DIR/alice.crt -set_serial 01 -days 365 -extfile $V3_CFG |
||||||
openssl x509 -req -in $DIR/server.csr -CA $DIR/ca.crt -CAkey $DIR/ca.key -out $DIR/server.crt -set_serial 01 -days 365 -extfile $V3_CFG |
openssl x509 -req -in $DIR/server.csr -CA $DIR/ca.crt -CAkey $DIR/ca.key -out $DIR/server.crt -set_serial 01 -days 365 -extfile $V3_CFG |
||||||
openssl pkcs12 -export -out $DIR/alice.p12 -inkey $DIR/alice.key -in $DIR/alice.crt -passin pass: -passout pass: |
openssl pkcs12 -export -out $DIR/alice.p12 -inkey $DIR/alice.key -in $DIR/alice.crt -passin pass: -passout pass: |
@ -0,0 +1,5 @@ |
|||||||
|
#!/bin/bash |
||||||
|
docker build -t unki/u_db -f u_db.Dockerfile . |
||||||
|
docker build -t unki/u_server -f u_server.Dockerfile . |
||||||
|
docker-compose down |
||||||
|
docker-compose up -d u_server |
Loading…
Reference in new issue