<?php
// =============================================================================
// config.local.example.php - v2606 (SHT30 온습도) 운영 설정 예시
//
// 1. 이 파일을 config.local.php로 복사합니다.
// 2. 실제 운영 값으로 교체합니다.
// 3. config.local.php는 서버에만 보관하고 공유하지 않습니다.
// =============================================================================

return [
    'DB_HOST' => 'localhost',
    'DB_PORT' => 3306,
    'DB_NAME' => 'your_db_name',
    'DB_USER' => 'your_db_user',
    'DB_PASS' => 'your_db_password',

    'API_KEY' => 'replace-with-long-random-secret',

    'SMS_USER_ID' => 'your-cafe24-sms-user-id',
    'SMS_SECURE' => 'your-cafe24-sms-secure-key',
    'SMS_SENDER' => '01000000000',
    'SMS_RECIPIENTS' => [
        '01000000000',
    ],

    'ADMIN_USER' => 'admin',
    'ADMIN_PASSWORD_HASH' => '$2y$10$replace.with.password_hash.output',
    // Base32 TOTP secret. MUST be left EMPTY here and set to a UNIQUE generated value in
    // config.local.php. Empty '' => admin_mfa_configured() is false => login is DISABLED
    // (fail-closed) until a real secret is set. NEVER put a literal Base32 string in this
    // example file: any non-empty Base32-ish value (even "REPLACE_WITH_...") decodes to a
    // usable, publicly-known TOTP secret and silently enables MFA on a known seed.
    // Generate a unique secret on the server only:
    //   php -r "require 'php/admin_security.php'; echo admin_totp_secret().PHP_EOL;"
    'ADMIN_TOTP_SECRET' => '',
    // Temporary bootstrap token for setup_mfa.php. Remove or empty after MFA enrollment.
    'MFA_SETUP_TOKEN' => 'replace-with-temporary-random-token',

    // 온습도 임계 경보 (서버 판정 → SMS). 운영 환경에 맞게 조정.
    'METRIC_TEMP_HIGH_C' => 30,   // 고온 임계(℃)
    'METRIC_TEMP_LOW_C' => 10,    // 저온 임계(℃)
    'METRIC_RH_HIGH' => 70,       // 고습 임계(%)
    'METRIC_RH_LOW' => 20,        // 저습 임계(%)
    'METRIC_ALERT_COOLDOWN_SEC' => 1800,  // 동일 종류 경보 재발송 억제(초, 기본 30분)

    'SMS_LOG_RETENTION_DAYS' => 365,
    'SENSOR_LOG_RETENTION_DAYS' => 365,
    'SENSOR_METRIC_RETENTION_DAYS' => 365,
    'ADMIN_AUDIT_RETENTION_DAYS' => 365,
];
