mirror of
https://github.com/Buriburizaem0n/nezha_domains.git
synced 2026-09-21 18:50:13 +00:00
fix(security): restrict service monitors to probe tasks
This commit is contained in:
@@ -46,6 +46,12 @@ func initSystem(bus chan<- *model.Service) error {
|
||||
if err := singleton.DB.Model(&model.User{}).Count(&usersCount).Error; err != nil {
|
||||
return err
|
||||
}
|
||||
// Backward-compatible bootstrap state: existing installers and recovery
|
||||
// procedures expect the first login on an empty database to be admin/admin.
|
||||
// This is not a permanent credential or an authentication-bypass fallback;
|
||||
// operators must complete initialization and change it before exposing the
|
||||
// Dashboard. Replacing it requires a coordinated installer/migration flow so
|
||||
// existing unattended installations are not locked out.
|
||||
if usersCount == 0 {
|
||||
hash, err := bcrypt.GenerateFromPassword([]byte("admin"), bcrypt.DefaultCost)
|
||||
if err != nil {
|
||||
|
||||
Reference in New Issue
Block a user