<?php

declare(strict_types=1);

/**
 * Copy to config/local.php and adjust (local.php must remain out of version control).
 * The installer (M1) will generate local.php automatically.
 */
return [
    'app' => [
        'env' => 'production',
        'debug' => false,
        'url' => 'https://example.com',
        // Subdirectory install only: leading slash, no trailing slash, e.g. '/seoscope/public'
        'base_path' => '',
        // After M1 installer: installed_at (ISO8601), key (random hex for signing / future license).
    ],
    'db' => [
        'host' => '127.0.0.1',
        'port' => 3306,
        'database' => 'seoscope',
        'username' => '',
        'password' => '',
        'charset' => 'utf8mb4',
        'table_prefix' => 'sscope_',
    ],
    // Licensing server (no secrets in the distributed package).
    'licensing' => [
        'url' => 'https://licensing.seoscope.cloud',
    ],
    // Do NOT add a dev_secret or other licensing bypass keys here.
    // Optional author-only local testing of special purchase codes: configure in config/local.php only.
    // Never ship config/local.php in a customer ZIP.

    // Optional. URL that returns JSON { "version", "released_at", "changelog_url" } (Settings → Update).
    'update' => [
        'releases_url' => 'https://seoscope.cloud/releases.json',
    ],

    // SEO AI Assistant (dashboard): sliding-window caps before outbound LLM calls (cache hits are not counted).
    'seo_ai' => [
        // Server cache TTL for structured LLM responses (DashboardCacheRepository row freshness).
        'cache_ttl_seconds' => 86400,
        'rate_limit' => [
            'per_user_session' => [
                'enabled' => true,
                'window_seconds' => 3600,
                'max_requests' => 24,
            ],
            // Uses REMOTE_ADDR + flock files under storage/rate_limit/. Disable if many users share one NAT and see false positives.
            'per_ip' => [
                'enabled' => true,
                'window_seconds' => 3600,
                'max_requests' => 72,
            ],
        ],
    ],
];
