Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/dev'
Browse files Browse the repository at this point in the history
  • Loading branch information
shiguanghuxian committed Jan 7, 2019
2 parents 9f895b5 + 93f2bef commit 592f7d9
Show file tree
Hide file tree
Showing 33 changed files with 7,616 additions and 30 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -19,5 +19,6 @@ etcd-manage

bin/etcd-manage
bin/logs/*
bin/etcd*

tpls/dist/*
21 changes: 17 additions & 4 deletions bin/config/cfg.toml
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,19 @@ address = "0.0.0.0"
# 监听端口
port = 10280

# 使用 Let's Encrypt 证书 - tls_enable为true优先使用本地证书模式
tls_encrypt_enable = false
# 域名列表
tls_encrypt_domain_names = ["shiguanghuxian.com"]

# 是否启用tls
tls_enable = false
# tls证书文件
[http.tls_config]
cert_file = "cert_file"
key_file = "key_file"


## 一下每一个server为一个etcd服务 ##
[[server]]
# 显示名称
Expand All @@ -25,12 +38,12 @@ desc = "docker方式etcd集群方式"
# 可访问服务器角色列表 - 不写则为所有用户可访问
roles = ["admin"]
# 是否启用tls连接
tls_enable = false
tls_enable = true
# tls证书配置
[server.tls_config]
cert_file = "cert_file"
key_file = "key_file"
ca_file = "ca_file"
cert_file = "/etc/etcd/etcdSSL/etcd.pem"
key_file = "/etc/etcd/etcdSSL/etcd-key.pem"
ca_file = "/etc/etcd/etcdSSL/etcd-root-ca.pem"

[[server]]
title = "make docker_run"
Expand Down
51 changes: 51 additions & 0 deletions bin/tlskey/etcd-key.pem
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
-----BEGIN RSA PRIVATE KEY-----
MIIJKQIBAAKCAgEA16iF/VlSSFaslvI4or4AZ0P0y3DHzddbfxw4nTSfX8e8dEoB
QJkHN94UxXDBcEkmQi6QEBtaFOPRf/4pROrznlHUjE7UxW9KV7dCPn3bfncTupv6
GxPTira0o0KiwlK2BlRUiI9xdbqk+wRLkaMz7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lb3+Q/5BH0zDJkh++yhb7voL
yzIq4FFnio1Hj3gbj1K/cTLdCuZGzExQ+e1MZMLFHhpNNz603BfcPQIDi19epbLT
+A+5X+sVwWf+HV75Erg3VnZam5Vzq/Q3Pp3shxii8pMcolqCUoZPe1svqaPvAT80
7xORAoIBAQCrDhY4v8UtZ6GEM9o9rthSb4HIWfWHqAt2OQ7wY6v5EyVuwz4s0JkJ
zdcKs/TUY7oVAxmuEJHT+oWIjLg9dW7ZEtBg86LzLePBz24HBDRBO8+ryubdX+m9
lRDAOGuwjHwWr63eFpKQi0uR5qz27VKWNQQsiR5sx3EQ18vYXXyWp8CvYDLcsIrv
zomTyjwlgoNAd62pqBGnsp2uIJVRGKvVaFAYa+szeH3D6l7I3DRj4WkVEXn1J7b5
pdCE6Doq8R9Tdz1xNzakIlF8636oCn7sW/3S2lp7FO0c32MxydRApneishk+Wggh
pqiMy9KL2UsgaVxZqYtekFwS8ZiR45qBAoIBAQDh2oGGS4TaJ0fvCK2UoRA7hII4
cS9+CeU+I9JEtGaUU2Iv0Pa5mc+gAjpNvJu+rWuGZz56OGA3lhOgy2Iz8ZMlxVLz
wC9mx3jm+iyrpQmkGTKgiaqGpmwVzoHYEhBBeUW/ow4SssaV84D2x4QwDR1rfmfr
pbwddPa5EUXcUe97DYtY9h9tM9HbUpuJwBNGo7QxqBrKfRxBexEzvXbWQRMBfo2t
BrS3WyZkarPB0AGAeKIv15BXwzB/1/LX4Nc+js9r9HpwvfUJ5PnBn0nqEfzB50Mg
tp8NoQTQGxZP2rZvcD5ome6DeNrYPvGFf/EMJEyCK5hG/4WQC2n4PTFN1CoV
-----END RSA PRIVATE KEY-----
51 changes: 51 additions & 0 deletions bin/tlskey/etcd-root-ca-key.pem
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
-----BEGIN RSA PRIVATE KEY-----
MIIJKQIBAAKCAgEA+RRWA5F0YsQm0B+1e5hXkYavzY70k8m0vKb9e0fU502n2JFq
wZp354zukFv4OilNwLl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JEbeCSua+Dy39OxuyZY3nayxyr53eUKSvB03
flK4Adq5OjZDMzRU4Wz+S/HEZnrl1maCs2gWK+VaZiqYLgJcw2nw8G+/Mc1TZMVs
j5pSyIM62BpFyTd+KDy1EP24Lo63UICnCMsi5bTiDfXv4bCRz2LaSWGxqejKLBiu
gpKdKRkZJnlXZH/ZzPPH8QjZejGLIpNkG78d/q96Pw9ed5HxrUsIwy2liGVQUgVz
RvyJAoIBAQCjASRnreIqAKxslBTSXzZAUmIJX/TJiM/cQGaLoFH/nJXN0WEV75a9
s8bOsiRpJcsgYopkpMtoX0C3uD4kPolObISWAEOKUZG3U3hztLp6o8YqbAEGdX94
FxY1GzMYj+62G4eaU9kVfE5Uo5wEqzm1xOSJ8haqajmqDC4mYCUNu1VOhXi85n+S
kVZiYn7wuBDu5561pJbqkXbE6PJsOm7v1NlrKxRYrOW50GdhuTSDSrtN8RBo0u3m
NFsN5+I0NkQI7cxIHKHEJBKeEOrukHu+KIfm/gGW6N0nM035+nJPdbVY1BOqTZBL
MnAjHx/eowzVAObRmvYKmy7Wi+tfeh/5AoIBAQCLEPVw5dL75ljPkY0mKWcBnDk3
aB6zPpVkUQnu1q0HkHPKG0QvGr1XBaKqIVQUU2FuFDHNe7oW+TXurS8t7Fek2BJC
IFjeKZogx5MwCCXY6yWMm1/W9RQCKGvwDWL+IYbHfkTd9Cq52NzqdwynQZ27/17w
uMbp/KsBltMgnsUT/OznoyONJnCkGMDd9b+cZvrWmOVZJTysnMWqPzs/JBfLgb4m
cWmIVlbYwf8BrV8Fr1LoW8whD/DVOwJIRBWg8UaMUTBXL+8aWPqUOnUmFZxA9SU5
4WvaWT2Lt5+vbuplxl41ZbFdJAOGK3RJHZSlcKfOgYCjULrSI81b7HKdqftq
-----END RSA PRIVATE KEY-----
33 changes: 33 additions & 0 deletions bin/tlskey/etcd-root-ca.pem
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
-----BEGIN CERTIFICATE-----
MIIFrjCCA5agAwIBAg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/169EIm/Zz8S87q8oxQ
yAThKCeeMFgv8h4Xi2dzJzfwJBZ4nXpnos84V42B9jcwnRsdIQIDAQABo0IwQDAO
BgNVHQ8BAf8EBAMCAQYwDwYDVR0TAQH/BAUwAwEB/zAdBgNVHQ4EFgQUPeUqZZev
gwjmuuQtcA5zasrXnJIwDQYJKoZIhvcNAQENBQADggIBADyIvQHVDFnAfQMIK4YK
oFmlIX0uzw9B2hPTg9dmoPHSohP+qW1Wqp6fuHdavXzGCL1GCbLNCWZhg67COWUe
LPYznE0HE8qDDpsXReZli+u12e5LEZfWRW/U+dOzB4Y21u75GqrUDcdsVmFRl3it
tyu8YIVMHYrM28ZtpJ2aJsRVVvCGC3WOBApZ2ayBRr4KSRXfrt0BisVMLFkDklSk
1P3FdawnCrIvCxK5AOJhTbs+iSjTOK1OvYUGvfkJSpuvyIGcJssl7O1u/7qTg/Cx
7EMTS3TymryndLRvMCJLQTPzVfnyihrfAeqEmLPILzxgfUJpTvAk1QcXvzy2RQjy
+HIIxo+Lr+wjGSxULD6kMmM5mcLJOAOlHTaPsxabGAtVUNRvr18BZhNoyob0lUUg
+khrRzPG7uRqbCWa3lCFUe2bRD3wfiIjBTgZiCA1X0GA87epCcyFjqiBCgoyHCpy
lahIL+RFrDh6PukV7KxoGlRZ7cAOZGgBTVlKfqoSOvl4q319nPkTjEmirI2cp4qh
rJjv/mChJGIwePeEwFw1coFWr2pIdlMnhndxbp0CnbmFyejK31ESpdCjKc/Ul5MW
ChMqk4Y+8tWJCLUS7gmNCBSmPklXfY0H6B/RaMfpsq31xt4SmJtADHyxtDXuXvMK
Tv9qqO+FUmzVK4MPJG4USAR9
-----END CERTIFICATE-----
35 changes: 35 additions & 0 deletions bin/tlskey/etcd.pem
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
-----BEGIN CERTIFICATE-----
MIIGFjCCA/6gAwIBAgIUVVXdy01B4zUZXYznpQmlaYsbVPswDQYJKoZIhvcNAQEN
BQAwbzELMAkGA1UEBh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AAaOBsTCBrjAOBgNVHQ8B
Af8EBAMCBaAwHQYDVR0lBBYwFAYIKwYBBQUHAwEGCCsGAQUFBwMCMAwGA1UdEwEB
/wQCMAAwHQYDVR0OBBYEFEODly/4G+Z1eZsRHhl8gs3nEwO/MB8GA1UdIwQYMBaA
FD3lKmWXr4MI5rrkLXAOc2rK15ySMC8GA1UdEQQoMCaCCWxvY2FsaG9zdIIFZXRj
ZDCCBWV0Y2QxggVldGNkMocEfwAAATANBgkqhkiG9w0BAQ0FAAOCAgEAts++rKSN
JYAB5889vwE1RhJkgCvMhUVxe15KY9wB0XbvtX9bChjAZ2EDSELjKroZhhzbDy3n
3PdodT2juYc1bQLNlBLhx2lSoGkV3N5Sq8f5P7rXk8UNT+S/a6U0CHx1Hr5BCYOd
Yld3zyUMBCY3UGdNf9NQdk11bjfrakidQ90Lx87fQ8xw8S0xsGGHPi+ybG/a7yEs
+QJGE/uZwJraC5c1XK02kuIikJwvmFnavl2exBL+6EHVzEdTR3h9uUbGOYTZnKSV
o2I/swCJ5Vt+npwB/wNNj5CHT2iZCyUmxFeA4lXFnpr2y0Z0ACW3AcFP0lNL8T4k
JGTm/Gs9avZ3ABbGHtKS3YWUYozPuqoBWWll8J/SkjZctSDnrh9oKpYFQXfWKFNF
rFhUdZS6cfl5Cb2os/tk2k6hdN4QSgA8xNEn1R3C00Rq0EdRcMsxrvmzupiwE7ZE
8HufAjjI9AlRRGUvCtxhNTbYDZYzYtffcHm6UXlxYpZTaLouISZmvEUgg4ZKxVTv
HNzrRM26pg6LUo8Xj2QYWILKz7wC49ax96t79UlTUL9NbxcLdlWjXUlmn+Icq4Fn
mB27K1Ckcsu77xtXAobiabOrGws7CeF0UXn2rMWsLMRNFD+AgAK8hZW85iIC8o0Z
LAV+fqGI6tQ8L3gwFoy9S11dIsSM9f1vvjU=
-----END CERTIFICATE-----
80 changes: 57 additions & 23 deletions docker-compose-cluster.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,67 +5,103 @@ services:
ports:
- 2379
volumes:
- etcd0:/etcd_data
- ./bin/tlskey:/etc/etcd/etcdSSL
command:
- /usr/local/bin/etcd
- -name
- etcd0
- --data-dir
- /etcd_data
- -advertise-client-urls
- http://etcd0:2379
- https://etcd0:2379
- -listen-client-urls
- http://0.0.0.0:2379
- https://0.0.0.0:2379
- -initial-advertise-peer-urls
- http://etcd0:2380
- https://etcd0:2380
- -listen-peer-urls
- http://0.0.0.0:2380
- https://0.0.0.0:2380
- -initial-cluster
- etcd0=http://etcd0:2380,etcd1=http://etcd1:2380,etcd2=http://etcd2:2380
- etcd0=https://etcd0:2380,etcd1=https://etcd1:2380,etcd2=https://etcd2:2380
- --cert-file
- /etc/etcd/etcdSSL/etcd.pem
- --key-file
- /etc/etcd/etcdSSL/etcd-key.pem
- --peer-cert-file
- /etc/etcd/etcdSSL/etcd.pem
- --peer-key-file
- /etc/etcd/etcdSSL/etcd-key.pem
- --trusted-ca-file
- /etc/etcd/etcdSSL/etcd-root-ca.pem
- --peer-trusted-ca-file
- /etc/etcd/etcdSSL/etcd-root-ca.pem
etcd1:
image: quay.io/coreos/etcd:v3.3
ports:
- 2379
volumes:
- etcd1:/etcd_data
- ./bin/tlskey:/etc/etcd/etcdSSL
command:
- /usr/local/bin/etcd
- -name
- etcd1
- --data-dir
- /etcd_data
- -advertise-client-urls
- http://etcd1:2379
- https://etcd1:2379
- -listen-client-urls
- http://0.0.0.0:2379
- https://0.0.0.0:2379
- -initial-advertise-peer-urls
- http://etcd1:2380
- https://etcd1:2380
- -listen-peer-urls
- http://0.0.0.0:2380
- https://0.0.0.0:2380
- -initial-cluster
- etcd0=http://etcd0:2380,etcd1=http://etcd1:2380,etcd2=http://etcd2:2380
- etcd0=https://etcd0:2380,etcd1=https://etcd1:2380,etcd2=https://etcd2:2380
- --cert-file
- /etc/etcd/etcdSSL/etcd.pem
- --key-file
- /etc/etcd/etcdSSL/etcd-key.pem
- --peer-cert-file
- /etc/etcd/etcdSSL/etcd.pem
- --peer-key-file
- /etc/etcd/etcdSSL/etcd-key.pem
- --trusted-ca-file
- /etc/etcd/etcdSSL/etcd-root-ca.pem
- --peer-trusted-ca-file
- /etc/etcd/etcdSSL/etcd-root-ca.pem
etcd2:
image: quay.io/coreos/etcd:v3.3
ports:
- 2379
volumes:
- etcd2:/etcd_data
- ./bin/tlskey:/etc/etcd/etcdSSL
command:
- /usr/local/bin/etcd
- -name
- etcd2
- --data-dir
- /etcd_data
- -advertise-client-urls
- http://etcd2:2379
- https://etcd2:2379
- -listen-client-urls
- http://0.0.0.0:2379
- https://0.0.0.0:2379
- -initial-advertise-peer-urls
- http://etcd2:2380
- https://etcd2:2380
- -listen-peer-urls
- http://0.0.0.0:2380
- https://0.0.0.0:2380
- -initial-cluster
- etcd0=http://etcd0:2380,etcd1=http://etcd1:2380,etcd2=http://etcd2:2380
- etcd0=https://etcd0:2380,etcd1=https://etcd1:2380,etcd2=https://etcd2:2380
- --cert-file
- /etc/etcd/etcdSSL/etcd.pem
- --key-file
- /etc/etcd/etcdSSL/etcd-key.pem
- --peer-cert-file
- /etc/etcd/etcdSSL/etcd.pem
- --peer-key-file
- /etc/etcd/etcdSSL/etcd-key.pem
- --trusted-ca-file
- /etc/etcd/etcdSSL/etcd-root-ca.pem
- --peer-trusted-ca-file
- /etc/etcd/etcdSSL/etcd-root-ca.pem
etcd-manage:
# build: .
image: "shiguanghuxian/etcd-manage"
Expand All @@ -74,10 +110,8 @@ services:
volumes:
- ./bin/config/cfg.toml:/app/config/cfg.toml
- ./bin/logs:/app/logs
- ./bin/tlskey:/etc/etcd/etcdSSL
depends_on:
- etcd0

volumes:
etcd0:
etcd1:
etcd2:
- etcd1
- etcd2
14 changes: 12 additions & 2 deletions program/config/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,18 @@ func (c *Config) GetUserByUsername(username string) *User {

// HTTP http 件套配置
type HTTP struct {
Address string `toml:"address"`
Port int `toml:"port"`
Address string `toml:"address"`
Port int `toml:"port"`
TLSEnable bool `toml:"tls_enable"` // 是否启用tls连接
TLSConfig *HTTPTls `toml:"tls_config"` // 启用tls时必须配置此内容
TLSEncryptEnable bool `toml:"tls_encrypt_enable"` // 是否启用 Let's Encrypt tls
TLSEncryptDomainNames []string `toml:"tls_encrypt_domain_names"` // 启用 Let's Encrypt 时的域名列表
}

// HTTPTls http tls配置
type HTTPTls struct {
CertFile string `toml:"cert_file"`
KeyFile string `toml:"key_file"`
}

// EtcdServer etcd 服务
Expand Down
Loading

0 comments on commit 592f7d9

Please sign in to comment.