fix env file config

This commit is contained in:
Elshimy Ziad Magdy Taha 2025-09-28 21:03:50 +05:00
parent c341cb8ff8
commit d637f5f112
4 changed files with 52 additions and 9 deletions

8
.env
View file

@ -1,7 +1,7 @@
DB_HOST=localhost
DB_PORT=5432
DB_USER=postgres
DB_PASSWORD=password
DB_USER=your_db_user
DB_PASSWORD=your_db_password
DB_NAME=linkedin_jobs
DB_SSLMODE=disable
@ -12,5 +12,5 @@ SERVER_HOST=localhost
LINKEDIN_BASE_URL=https://www.linkedin.com
REQUEST_TIMEOUT=30s
RATE_LIMIT_DELAY=2s
CV_AI_MODEL=deepseek/deepseek-chat-v3.1:free
OPENROUTER_API_KEY=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
CV_AI_MODEL=your_ai_model
OPENROUTER_API_KEY=your_openrouter_api_key

36
.gitignore vendored Normal file
View file

@ -0,0 +1,36 @@
# Local environment files (contains real secrets)
.local.env
# IDE files
.vscode/settings.json
.idea/
# Go build artifacts
*.exe
*.exe~
*.dll
*.so
*.dylib
*.test
*.out
go.work
# Dependency directories
vendor/
# OS generated files
.DS_Store
.DS_Store?
._*
.Spotlight-V100
.Trashes
ehthumbs.db
Thumbs.db
# Logs
*.log
logs/
# Temporary files
*.tmp
*.temp

View file

@ -12,9 +12,13 @@ import (
)
func main() {
if err := godotenv.Load(); err != nil {
// Try to load .local.env first, then fallback to .env
if err := godotenv.Load("../.local.env"); err != nil {
log.Println("No .local.env file found, trying .env")
if err := godotenv.Load("../.env"); err != nil {
log.Println("No .env file found, using system environment variables")
}
}
dbConfig := infrastructure.LoadConfigFromEnv()
db, err := infrastructure.NewConnection(dbConfig)
@ -72,5 +76,4 @@ func main() {
}
log.Println(result)
// job,err :=
}

View file

@ -13,9 +13,13 @@ import (
)
func main() {
// Try to load .local.env first, then fallback to .env
if err := godotenv.Load(".local.env"); err != nil {
log.Println("No .local.env file found, trying .env")
if err := godotenv.Load(); err != nil {
log.Println("No .env file found, using system environment variables")
}
}
dbConfig := infrastructure.LoadConfigFromEnv()
db, err := infrastructure.NewConnection(dbConfig)