feat: implement single binary build and env-based auth
- Unify login page styling with share page - Add AGENTS.md with build commands and code style guidelines - Add dev.sh and make.sh for development and production builds - Implement single binary build with embedded frontend using embed.FS - Change auth configuration from CLI flag to env variables (USHARE_USERNAME, USHARE_PASSWORD) - Set default credentials: admin / ushare@123 - Fix static file serving for SPA routes
This commit is contained in:
@@ -21,11 +21,11 @@ func (um *userManager) Login(username string, password string) (*model.User, err
|
||||
now = time.Now()
|
||||
)
|
||||
|
||||
if username != "admin" {
|
||||
if username != opt.Cfg.Username {
|
||||
return nil, errors.New("账号或密码错误")
|
||||
}
|
||||
|
||||
if !tool.ComparePassword(password, opt.Cfg.Auth) {
|
||||
if !tool.ComparePassword(password, opt.Cfg.Password) {
|
||||
return nil, errors.New("账号或密码错误")
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user