shiguanghuxian / etcd-manage

一个现代的etcd v3管理ui
http://140.143.234.132:10280/ui/#/key/kv
MIT License
244 stars 61 forks source link

未能正常启动`user' is not defined in config.Config #32

Open kaybinwong opened 5 years ago

kaybinwong commented 5 years ago

配置如下: docker-compose.yaml

version: '3'

services:
  etcd-manage:
    # build: .
    image: "shiguanghuxian/etcd-manage"
    volumes:
      - ./bin/config/cfg.toml:/app/config/cfg.toml
      - ./bin/logs:/app/logs
    ports:
      - "10280:10280"

cfg.toml

# debug模式
debug = false
# 日志文件路径
log_path = ""

# http 监听端口
[http]
# 监听地址
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]]
# 显示名称
title = "make docker_cluster_run"
# 标识名 - 只能是字母数字或下划线
name = "docker_cluster_run"
# etcd连接地址 如果为集群请填写全部地址
address = ["172.18.88.196:2379"]
# 查看的key前缀
key_prefix = "/"
# 简述信息
desc = "docker方式etcd集群方式"
# 可访问服务器角色列表 - 不写则为所有用户可访问
roles = []
# 是否启用tls连接
tls_enable = true
# tls证书配置
[server.tls_config]
cert_file = "/etc/ssl/etcd/ssl/node-a-docker-cluster04.pem"
key_file = "/etc/ssl/etcd/ssl/node-a-docker-cluster04-key.pem"
ca_file = "/etc/ssl/etcd/ssl/ca.pem"

[[server]]
title = "本地etcd"
name = "local"
address = ["127.0.0.1:2379"]
key_prefix = "/"
desc = "本机环境"
roles = ["admin","dev"]

## 以下为用户列表 ##
[[user]]
username = "admin"
password = "123456"
role = "admin"

[[user]]
username = "dev_user"
password = "123456"
role = "dev"

但是未能正常启动,日志如下

Recreating etcd-manage_etcd-manage_1 ... done
Attaching to etcd-manage_etcd-manage_1
etcd-manage_1  | 2019/11/06 09:57:13 main.go:18: line 57: field corresponding to `user' is not defined in config.Config
etcd-manage_etcd-manage_1 exited with code 1
kaybinwong commented 5 years ago

建议把版本给写上。

shiguanghuxian commented 5 years ago

已经推送了v1版镜像到hub.docker.com 如果你想使用v1默认ui可以使用 shiguanghuxian/etcd-manage:1 如果想使用v1版ui优化版,可以用 shiguanghuxian/etcd-manage:1.v2

如果你想使用v2版,可以使用 shiguanghuxian/etcd-manage:2.0.0 v2开源地址 https://github.com/etcd-manage

感谢你的反馈