Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions config/config.php
Original file line number Diff line number Diff line change
Expand Up @@ -119,6 +119,12 @@
define('FR_OIDC_DEBUG', false);
}
}
// Optional: which file or directory names to ignore while indexing
// Set FR_IGNORE_NAMES to a comma-separated list of file or directory names to ignore.
if (!defined('FR_IGNORE_NAMES')) {
$envVal = getenv('FR_IGNORE_NAMES');
define('FR_IGNORE_NAMES', ($envVal !== false && $envVal !== '') ? $envVal : '@eaDir,#recycle,.DS_Store,Thumbs.db');
}
// Optional: trusted proxy IP resolution for rate limiting/logging
// Set FR_TRUSTED_PROXIES to a comma-separated list of IPs/CIDRs (e.g. "127.0.0.1,10.0.0.0/8").
if (!defined('FR_TRUSTED_PROXIES')) {
Expand Down
22 changes: 20 additions & 2 deletions src/lib/FS.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,25 @@ final class FS
{
/** Hidden/system names to ignore entirely */
public static function IGNORE(): array {
return ['@eaDir', '#recycle', '.DS_Store', 'Thumbs.db'];
$raw = '';
if (defined('FR_IGNORE_NAMES')) {
$raw = FR_IGNORE_NAMES;
} else {
$env = getenv('FR_IGNORE_NAMES');
if ($env !== false && $env !== '') {
$raw = $env;
}
}

if (is_array($raw)) {
return $raw;
}
if (!is_string($raw) || trim($raw) === '') {
return [];
}

$parts = array_map('trim', explode(',', $raw));
return array_values(array_filter($parts, fn($part) => $part !== ''));
}

/** App-specific names to skip from UI */
Expand Down Expand Up @@ -84,4 +102,4 @@ public static function hasReadableDescendant(
}
return false;
}
}
}