Skip to main content
Version: v4 (latest✅)

Hide Files & Folders

info

In contrast to using metadata the file or folder is completely hidden/ignored from the filetree, all APIs and cannot be accessed via URL.

Ignore patterns

Hide specific files or folders by defining ignore patterns as regular expressions.

Internally, each pattern is evaluated against the full file path using preg_match. Matching is case-insensitive. If any pattern matches, the file/folder will be hidden.

Notes:

  • The path always starts with /, which is the mounted folder.
  • Patterns are wrapped as #<pattern>#im internally. Avoid using # in patterns. The path always starts with a /, which is the mounted folder.

Examples

PatternDescriptionHiddenNot Hidden
/\..*Hide dotfiles like .env, .git at any depth/foo/.bar, /.foo/bar/foo/bar
^/foo/.*\.txt$Hide everything in /foo ending with .txt/foo/abc.txt/foo/abc.md, /bar/foo/abc.txt
^/node_modules/Hide /node_modules only at the root/node_modules/foo/node_modules
/node_modules/Hide node_modules at any depth/node_modules, /foo/node_modules/node_modules_123
^/reports/2023.*\.pdf$Hide PDFs in /reports starting with 2023/reports/2023-01.pdf/reports/2022-01.pdf, /reports/2023-01.txt
^/secret/.*\.(jpg|png)$Hide images anywhere under /secret/secret/foo.jpg, /secret/bar/abc.png/secret/foo.png.txt, /foo/secret/abc.png

You can hide some files and folders by setting the environment variable IGNORE to a pattern. By default everything is shown.

Legacy (v1.2 - v3.2) ignore pattern matching

Patterns are matched against the file name and every parent folder name individually not as a path.

For example if you have a file foo/bar/secret.txt. This path will be split into an array ['foo', 'bar', 'secret.txt'] and each part will be matched against the pattern. If at any point the pattern matches the name, it will be hidden.

Use case: Hide everything starting with a dot . using a .* pattern globally at any nesting level. This will hide /foo/bar/.foobar, /.baz, /foo/.secret/bar etc.

It uses fnmatch to match the pattern.

PatternDescription
*Matches everything (including nothing)
?Matches any single character
[seq]Matches any character in seq
[!seq]Matches any character not in seq
  • pattern foo will hide the file foo/bar/secret.txt because foo matches the first array element foo.
  • pattern *bar* will hide the file foo/bar/secret.txt because *bar* matches the second array element bar.
  • pattern *.txt will hide the file foo/bar/secret.txt because *.txt matches the third array element secret.txt.

Examples

  • *[ab].txt hides all files or folder ending with either a.txt or b.txt.

  • .* hides all files or folder starting with a dot .

  • [a-zA-Z0-9]* hides all files or folder starting with a letter or number.

  • [!a-zA-Z0-9]* hides all files or folder not starting with a letter or number.

  • report-???.pdf hides report-001.pdf, report-123.pdf but not report-1.pdf.

Multiple patterns

You can specify multiple patterns and separate them using ;. If any pattern matches, the file or folder will be hidden.

⚙️ Configuration

VariableDefaultValuesDetails
IGNORE<empty><patterns>
changed to regex instead of fnmatch in v3.3added in v1.2
How to set configuration options
Set the environment variables when starting the container.
Use docker run...
  • ...with -e IGNORE=<empty>
  • ...with --env-file .env and place IGNORE=<empty> in the file
See installation page for more details.