diff --git a/server/internal/auth/local.go b/server/internal/auth/local.go index 1069132..ecd65f1 100644 --- a/server/internal/auth/local.go +++ b/server/internal/auth/local.go @@ -83,17 +83,17 @@ func HandleBootstrap(c *gin.Context) { Password string `json:"password"` } if err := c.ShouldBindJSON(&body); err != nil || body.InstanceName == "" || body.Email == "" || len(body.Password) < 8 { - c.JSON(http.StatusBadRequest, gin.H{"error": "org_name, email, and password (>=8 chars) required"}) + c.JSON(http.StatusBadRequest, gin.H{"error": "instance_name, email, and password (>=8 chars) required"}) return } - orgCount, err := services.CountInstances() + instanceCount, err := services.CountInstances() if err != nil { c.JSON(http.StatusInternalServerError, gin.H{"error": err.Error()}) return } var inst *models.Instance - switch orgCount { + switch instanceCount { case 0: inst, err = services.CreateInstance(body.InstanceName) case 1: @@ -106,7 +106,7 @@ func HandleBootstrap(c *gin.Context) { c.JSON(http.StatusConflict, gin.H{"error": fmt.Sprintf( "cannot bootstrap: %d organizations already exist but no users do; "+ "create the owner against the intended inst rather than through setup, "+ - "or remove the unintended orgs and retry", orgCount)}) + "or remove the unintended orgs and retry", instanceCount)}) return } if err != nil { diff --git a/server/internal/services/instances.go b/server/internal/services/instances.go index c66f3eb..42017e5 100644 --- a/server/internal/services/instances.go +++ b/server/internal/services/instances.go @@ -92,7 +92,7 @@ func AdoptInstance(instanceID, name string) (*models.Instance, error) { if _, err := db.Col("instances").UpdateOne(ctx, bson.M{"instance_id": instanceID}, bson.M{"$set": set}); err != nil { if mongo.IsDuplicateKeyError(err) { - return nil, fmt.Errorf("organization slug already taken") + return nil, fmt.Errorf("instance slug already taken") } return nil, err } diff --git a/server/internal/services/monitors.go b/server/internal/services/monitors.go index e5569b9..57f2b29 100644 --- a/server/internal/services/monitors.go +++ b/server/internal/services/monitors.go @@ -52,7 +52,7 @@ func ListMonitors(instanceID string) ([]models.Monitor, error) { func ListMonitorsForRunner(instanceID, runner string) ([]models.Monitor, error) { if instanceID == "" { - return nil, errors.New("org id required") + return nil, errors.New("instance id required") } return listMonitorsForRunner(instanceID, runner) } @@ -227,7 +227,7 @@ func UptimeRollups(instanceID, monitorID string, since time.Time) ([]models.Roll func IngestResult(instanceID, runner, monitorID string, res checker.Result) error { if instanceID == "" { - return errors.New("org id required") + return errors.New("instance id required") } return ingestResult(instanceID, runner, monitorID, res) }