/root/nodejs/lib/node_modules/yapi-cli/src/commands/my-yapi/config.json
(路径依据各自的实际情况查找)
{ "port": "3000", "adminAccount": "admin@admin.com", "db": { "servername": "127.0.0.1", "DATABASE": "yapi", "port": "27017" }, "mail": { "enable": false, "host": "smtp.163.com", "port": 465, "from": "***@163.com", "auth": { "user": "***@163.com", "pass": "*****" } }, "ldapLogin": { "enable": true, "server": "ldap://127.0.0.1", "baseDn": "cn=admin,dc=your company name,dc=com", "bindPassword": "mect888!", "searchDn": "ou=people,dc=your company name,dc=com", "searchStandard": "mail", "emailPostfix": "", "emailKey": "mail", "usernameKey": "displayName" } }
若禁止用户注册,则在配置文件中添加参数:
{ "port": 27017, "closeRegister":true }
systemctl restart yapi
关于yapi的systemd启动文件内容,可以参考: systemd下服务启动情况
yapi管理员登陆后台之后,在用户管理中查看用户的邮箱:
将邮箱添加到对应LDAP用户中即可用邮箱和LDAP的用户密码登陆YAPI了
“The first 90% of the code accounts for the first 90% of the development time. The remaining 10% of the code accounts for the other 90% of the development time.” – Tom Cargill
标 题:YAPI开启LDAP登陆