update envs and urls

This commit is contained in:
Egor Pozharov
2026-04-16 13:10:58 +06:00
parent ff27493670
commit 86a684790c
4 changed files with 5 additions and 5 deletions

View File

@@ -6,6 +6,9 @@ POSTGRES_DB=delivery_tracker
# JWT
JWT_SECRET=your_random_jwt_secret_min_32_chars
# Seed admin password
SEED_ADMIN_PASSWORD=your_secure_password_here
# Gitea Registry credentials for Watchtower
GITEA_REGISTRY=gitea.your-domain.com/yourusername
GITEA_USER=your_gitea_username

View File

@@ -24,21 +24,18 @@ func main() {
queries := db.New(pool)
// Проверяем, есть ли уже пользователи
_, err = queries.GetUserByUsername(ctx, "admin")
if err == nil {
log.Println("admin user already exists, skipping seed")
return
}
// Создаём через auth service (правильное хеширование)
secret := []byte(os.Getenv("JWT_SECRET"))
if len(secret) == 0 {
log.Fatalf("JWT_SECRET not set")
}
authService := auth.New(queries, secret, 0)
// Пароль из env или дефолтный (только для разработки!)
password := os.Getenv("SEED_ADMIN_PASSWORD")
if password == "" {
password = "admin123" // ⚠️ только для dev!

View File

@@ -1,4 +1,4 @@
# API Configuration
# Leave empty to use proxy (recommended for local dev and production)
# Or set full URL like http://localhost:8081 for direct API access
VITE_API_URL=
VITE_API_URL=http://localhost:8080

View File

@@ -29,7 +29,7 @@ export default defineConfig({
allowedHosts: ['delivery.loca.lt', '.loca.lt'],
proxy: {
'/api': {
target: 'http://localhost:8081',
target: 'http://localhost:8080',
changeOrigin: true,
},
},