Docs: init root user

pull/39/head
zijiren233 2 years ago
parent 10669666dc
commit 34ae7208c6

@ -81,6 +81,8 @@ synctv server
synctv server --data-dir ./
```
每次启动会检测是否有root权限的用户如果没有则会初始化一个`root`用户,密码为`root`,请及时修改用户名密码。
# 文档
https://synctv.wiki

@ -83,6 +83,8 @@ synctv server
synctv server --data-dir ./
```
Every time it starts, it will check for users with root permissions. If none are found, it will initialize a `root` user with the password `root`. Please change the username and password promptly.
# Documentation
https://synctv.wiki

@ -49,7 +49,8 @@ func initRootUser() error {
if err == nil || !errors.Is(err, gorm.ErrRecordNotFound) {
return err
}
_, err = CreateUser("root", "root", WithRole(model.RoleRoot))
u, err := CreateUser("root", "root", WithRole(model.RoleRoot))
log.Infof("init root user:\nid: %s\nusername: %s\npassword: %s", u.ID, u.Username, "root")
return err
}

Loading…
Cancel
Save