From 5374ab81cc3538912b0b35f11772a94db297b869 Mon Sep 17 00:00:00 2001 From: Daniel Arroyo Date: Tue, 7 Jul 2026 20:00:42 -0400 Subject: [PATCH] auth: default admin/admin credentials on first install + bump 1.0.4 SeedAdmin now uses 'admin'/'admin' as defaults when environment variables are not set, so the service works out-of-the-box after first install. --- Makefile | 2 +- cmd/server/main.go | 2 +- internal/auth/seed.go | 7 +++++-- 3 files changed, 7 insertions(+), 4 deletions(-) diff --git a/Makefile b/Makefile index ff2b4e0..88ade92 100644 --- a/Makefile +++ b/Makefile @@ -1,5 +1,5 @@ BINARY=syncserver -VERSION?=1.0.3 +VERSION?=1.0.4 GO?=go LDFLAGS=-s -w -X main.version=$(VERSION) -X main.commit=$(shell git rev-parse --short HEAD 2>/dev/null || echo unknown) BUILD_FLAGS=CGO_ENABLED=0 diff --git a/cmd/server/main.go b/cmd/server/main.go index 570320f..158ed50 100644 --- a/cmd/server/main.go +++ b/cmd/server/main.go @@ -20,7 +20,7 @@ import ( "github.com/syncserver/internal/syncengine" ) -var version = "1.0.3" +var version = "1.0.4" func main() { cfgPath := flag.String("config", "", "Path to config.yaml") diff --git a/internal/auth/seed.go b/internal/auth/seed.go index 351cea7..93b84ea 100644 --- a/internal/auth/seed.go +++ b/internal/auth/seed.go @@ -6,8 +6,11 @@ import ( ) func SeedAdmin(db *sql.DB, username, password string) error { - if username == "" || password == "" { - return nil + if username == "" { + username = "admin" + } + if password == "" { + password = "admin" } var exists bool