This commit is contained in:
Elshimy Ziad Magdy Taha 2025-12-15 14:36:37 +05:00
parent ddd5f890f5
commit 92cec1bf65
3 changed files with 5 additions and 23 deletions

View file

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

View file

@ -1,18 +0,0 @@
# Database Configuration
DB_HOST=postgres
DB_PORT=5432
DB_NAME=jobs_scraper
DB_USER=postgres
DB_PASSWORD=postgres
# OpenRouter Configuration (for job description extraction)
OPENROUTER_API_KEY=your_openrouter_api_key_here
CV_AI_MODEL=google/gemini-flash-1.5
# Optional: OpenAI Configuration (alternative to OpenRouter)
# OPENAI_API_KEY=your_openai_api_key_here
# OPENAI_BASE_URL=https://api.openai.com/v1
# Chrome/Chromedp Configuration (usually defaults are fine)
CHROMEDP_DISABLE_GPU=true
CHROMEDP_NO_SANDBOX=true

View file

@ -17,9 +17,9 @@ func Work(mainCtx context.Context) func(page int, stream chan<- domain.GoogleLin
opts := append(chromedp.DefaultExecAllocatorOptions[:],
chromedp.Flag("headless", true),
chromedp.Flag("no-sandbox", true), // Required for Docker
chromedp.Flag("disable-gpu", true), // Recommended for Docker
chromedp.Flag("disable-dev-shm-usage", true), // Prevents crashes in Docker
chromedp.Flag("no-sandbox", true),
chromedp.Flag("disable-gpu", true),
chromedp.Flag("disable-dev-shm-usage", true),
chromedp.Flag("disable-blink-features", "AutomationControlled"),
chromedp.Flag("excludeSwitches", "enable-automation"),
chromedp.Flag("disable-web-security", false),