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.
This commit is contained in:
@@ -1,5 +1,5 @@
|
|||||||
BINARY=syncserver
|
BINARY=syncserver
|
||||||
VERSION?=1.0.3
|
VERSION?=1.0.4
|
||||||
GO?=go
|
GO?=go
|
||||||
LDFLAGS=-s -w -X main.version=$(VERSION) -X main.commit=$(shell git rev-parse --short HEAD 2>/dev/null || echo unknown)
|
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
|
BUILD_FLAGS=CGO_ENABLED=0
|
||||||
|
|||||||
+1
-1
@@ -20,7 +20,7 @@ import (
|
|||||||
"github.com/syncserver/internal/syncengine"
|
"github.com/syncserver/internal/syncengine"
|
||||||
)
|
)
|
||||||
|
|
||||||
var version = "1.0.3"
|
var version = "1.0.4"
|
||||||
|
|
||||||
func main() {
|
func main() {
|
||||||
cfgPath := flag.String("config", "", "Path to config.yaml")
|
cfgPath := flag.String("config", "", "Path to config.yaml")
|
||||||
|
|||||||
@@ -6,8 +6,11 @@ import (
|
|||||||
)
|
)
|
||||||
|
|
||||||
func SeedAdmin(db *sql.DB, username, password string) error {
|
func SeedAdmin(db *sql.DB, username, password string) error {
|
||||||
if username == "" || password == "" {
|
if username == "" {
|
||||||
return nil
|
username = "admin"
|
||||||
|
}
|
||||||
|
if password == "" {
|
||||||
|
password = "admin"
|
||||||
}
|
}
|
||||||
|
|
||||||
var exists bool
|
var exists bool
|
||||||
|
|||||||
Reference in New Issue
Block a user