<?php
/*
 * package examples/crash_reporter/backend/config/config.example.php
 * config.example.php
 * Created at: Wed 20 May 2026 14:31:55 +0200
 * Updated at: Wed 20 May 2026 15:17:13 +0200 by Anton Afanasyeu <a.afanasieff@gmail.com>
 * Commit: 5d8e82d2e60a21fff3138d2a394ee4e8b4c6dcb8
 * Contributors:
 *    - Anton Afanasyeu <a.afanasieff@gmail.com> (2 commits, 23 lines)
 *    - Cursor Agent (project assistant)
 * Digest: SHA256	fcd4a89ef4201736923d0e7e1ad88868bba7e39eadb9fcf0ffb9d1ba7efecd12
 */
return [
    'app_name' => 'Android Cast Issues',
    // Production: '/app/androidcast_project/crashes' — Local php -S: use '' (empty string)
    'base_path' => '/app/androidcast_project/crashes',
    'db' => [
        // sqlite = default file DB; mysql = MariaDB/MySQL (recommended on BE for concurrency)
        'driver' => 'sqlite', // sqlite | mysql | mariadb (alias)
        'sqlite_path' => __DIR__ . '/../data/crashes.sqlite',
        'mysql' => [
            // Alpine: if TCP fails with "Connection refused", set socket (see /etc/my.cnf.d/*.cnf)
            'host' => '127.0.0.1',
            'port' => 3306,
            'socket' => '/run/mysqld/mysqld.sock', // leave '' to use host+port only
            'database' => 'androidcast_crashes',
            'username' => 'androidcast',
            'password' => 'change-me',
            'charset' => 'utf8mb4',
        ],
    ],
    'session_name' => 'ac_crash_sess',
    // Shared login cookie across crashes, build, and other consoles under this path
    'session_cookie_path' => '/app/androidcast_project',
    // When true, upload API may include a short error hint (do not enable on public prod long-term)
    'debug' => false,
    // Phase 1 RBAC: anonymous uploads and legacy rows attach to this company
    'rbac' => [
        'default_company_slug' => 'default',
        'default_company_id' => 1,
    ],
    // Google Analytics 4 (hub + crash console share public/assets/js/analytics.js)
    'analytics' => [
        'enabled' => false,
        'measurement_id' => '', // e.g. G-XXXXXXXXXX
        'debug' => false,
    ],
    // On-demand remote access (WireGuard v1) — see docs/REMOTE_ACCESS_IMPL.md
    'remote_access' => [
        // Public UDP endpoint shown to devices (FE DNAT → BE wg0)
        'wg_endpoint' => 'ra.apps.f0xx.org:51820',
        // Server WG public key (wg show wg0 public-key on BE)
        'wg_server_public_key' => '',
        'wg_interface' => 'wg0',
        // Run `wg set wg0 peer …` when device receives connect (requires wireguard-tools on BE)
        'provision_peers' => true,
        // Reject connect if wg genkey/pubkey unavailable (set true on production BE)
        'require_wg_tools' => false,
        'session_ttl_s' => 3600,
        'min_poll_interval_s' => 45,
    ],
];
