Skip to content

Commit

Permalink
Merge pull request #4 from gzchen008/develop
Browse files Browse the repository at this point in the history
add bin file to gitignore
  • Loading branch information
gzchen008 authored Jan 19, 2021
2 parents 7d74691 + 6436482 commit 474f5cc
Show file tree
Hide file tree
Showing 6 changed files with 118 additions and 1 deletion.
8 changes: 7 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -23,4 +23,10 @@ sys.pid
tomcat/
out/
tmp/
dockin-package.tar.gz
dockin-package.tar.gz
etcd
etcdctl
cfssl
cfssljson
dockin-docker/package

34 changes: 34 additions & 0 deletions dockin-etcd/tools/ca-gen/ca-config.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
{
"signing": {
"default": {
"expiry": "87600h"
},
"profiles": {
"server": {
"expiry": "87600h",
"usages": [
"signing",
"key encipherment",
"server auth"
]
},
"client": {
"expiry": "87600h",
"usages": [
"signing",
"key encipherment",
"client auth"
]
},
"peer": {
"expiry": "87600h",
"usages": [
"signing",
"key encipherment",
"server auth",
"client auth"
]
}
}
}
}
14 changes: 14 additions & 0 deletions dockin-etcd/tools/ca-gen/ca-csr.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
{
"CN": "WAE Etcd CA",
"key": {
"algo": "rsa",
"size": 2048
},
"names": [
{
"C": "CN",
"L": "GD",
"ST": "Shen Zhen"
}
]
}
15 changes: 15 additions & 0 deletions dockin-etcd/tools/ca-gen/client.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
{
"CN": "client",
"hosts": [""],
"key": {
"algo": "rsa",
"size": 2048
},
"names": [
{
"C": "CN",
"L": "GD",
"ST": "Shen Zhen"
}
]
}
31 changes: 31 additions & 0 deletions dockin-etcd/tools/ca-gen/gen-ca.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
#!/bin/bash
#
# Copyright (C) @2020 Webank Group Holding Limited
# <p>
# Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except
# in compliance with the License. You may obtain a copy of the License at
# <p>
# http://www.apache.org/licenses/LICENSE-2.0
# <p>
# Unless required by applicable law or agreed to in writing, software distributed under the License
# is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express
# or implied. See the License for the specific language governing permissions and limitations under
# the License.
#

################################
# add etcd node
################################
set -e
APP_BIN="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
APP_HOME="$(dirname $APP_BIN)"; [ -d "$APP_HOME" ] || { echo "ERROR dockin-etcd failed to detect APP_HOME."; exit 1;}
APP_NAME=$(basename "$APP_HOME")
rm -rf *.pem
./cfssl gencert -initca ca-csr.json | ./cfssljson -bare ca
./cfssl gencert -ca=ca.pem -ca-key=ca-key.pem -config=ca-config.json -profile=server server.json | ./cfssljson -bare server
cp server.json member.json
./cfssl gencert -ca=ca.pem -ca-key=ca-key.pem -config=ca-config.json -profile=peer member.json | ./cfssljson -bare member
./cfssl gencert -ca=ca.pem -ca-key=ca-key.pem -config=ca-config.json -profile=client client.json | ./cfssljson -bare client

time=$(date "+%m%d%H%M")
tar -czvf cers_$time.tar.gz *.pem
17 changes: 17 additions & 0 deletions dockin-etcd/tools/ca-gen/server.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
{
"CN": "WAE Etcd Server",
"hosts": [
ssl_server_list
],
"key": {
"algo": "rsa",
"size": 2048
},
"names": [
{
"C": "CN",
"L": "GD",
"ST": "Shen Zhen"
}
]
}

0 comments on commit 474f5cc

Please sign in to comment.