# 3in1 HUB - protect secrets and internals
#
# Needs Apache 2.4 syntax. On LiteSpeed/cPanel this works as-is.
# nginx needs the equivalent rules in the vhost (see README.md).

# Secrets, logs, schema - never serve these
<FilesMatch "^(dbcreds\.txt|hub_secret\.txt|hub_setup_key\.txt|dbcreds\.sample\.txt|.*\.log|.*\.sql|.*\.md)$">
  Require all denied
</FilesMatch>

# Internal directories: no listing, no direct web entry
# (FilesMatch cannot match directories, RedirectMatch can)
<IfModule mod_rewrite.c>
  RewriteEngine On
  RedirectMatch 403 ^/(includes|tools|sql|shared|site_templates)(/|$)
  RedirectMatch 403 ^/[^/]+/(includes/(logs|hub_wallet\.php)|site_templates)(/|$)
</IfModule>

# No directory listing anywhere
Options -Indexes

# The engine must never be requested directly from a game folder
<Files "hub_wallet.php">
  Require all denied
</Files>
