# ============================================================================
# MADELINEPROTO BOT SECURITY & ACCESS CONTROL
# ============================================================================

# 1. Deny access to sensitive files (JSON configurations, logs, locks, SQLite DBs)
<FilesMatch "\.(json|lock|log|db|sqlite|wal|shm|phar)$">
    <IfModule mod_authz_core.c>
        Require all denied
    </IfModule>
    <IfModule !mod_authz_core.c>
        Order deny,allow
        Deny from all
    </IfModule>
</FilesMatch>

# 2. Specifically block direct access to critical config and session files
<Files "config.json">
    <IfModule mod_authz_core.c>
        Require all denied
    </IfModule>
    <IfModule !mod_authz_core.c>
        Order deny,allow
        Deny from all
    </IfModule>
</Files>

# 3. Disable directory browsing
Options -Indexes

# 4. Allow access only to bot.php and dashboard.php
<FilesMatch "^(bot|dashboard)\.php$">
    <IfModule mod_authz_core.c>
        Require all granted
    </IfModule>
    <IfModule !mod_authz_core.c>
        Order allow,deny
        Allow from all
    </IfModule>
</FilesMatch>

# 5. Default UTF-8 character encoding
AddDefaultCharset UTF-8
