You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/docs/advanced/redis.md
+6-2Lines changed: 6 additions & 2 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -2,6 +2,8 @@
2
2
3
3
Redis is used to store the [download counter](./../configuration/download-count.md) data. If the download counter is disabled, Redis will not be loaded/started at all.
4
4
5
+
Counters are stored with the request path as key (relative to the mounted folder), for example `/reports/2024.pdf`.
6
+
5
7
### Access
6
8
7
9
Sometimes it is useful to access the Redis instance directly e.g. for resetting a counter. This can be done using the `redis-cli` tool inside the container.
@@ -18,6 +20,8 @@ redis-cli
18
20
See https://redis.io/docs/latest/commands/ for a list of available commands.
19
21
20
22
### List all stored counters
23
+
For small datasets you can use `KEYS`, but note that it can be slow on large databases.
24
+
21
25
```bash title="$> KEYS *"
22
26
...
23
27
25) "/src/index.php"
@@ -33,10 +37,10 @@ See https://redis.io/docs/latest/commands/ for a list of available commands.
Copy file name to clipboardExpand all lines: docs/docs/configuration/attribution.md.x
+1-1Lines changed: 1 addition & 1 deletion
Original file line number
Diff line number
Diff line change
@@ -4,4 +4,4 @@ sidebar_position: 5
4
4
5
5
# Attribution
6
6
7
-
You can hide the attribution by setting the environment variable `HIDE_ATTRIBUTION` to `true`.
7
+
dir-browser includes a small footer ("Powered by dir-browser") that links back to the project documentation and shows the running version. You can hide it by setting the environment variable `HIDE_ATTRIBUTION` to `true`.
Copy file name to clipboardExpand all lines: docs/docs/configuration/i18n.md
+4-6Lines changed: 4 additions & 6 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,11 +1,9 @@
1
1
---
2
2
sidebar_position: 3
3
3
---
4
-
# Format
4
+
# Date & Time
5
5
6
-
## Date & Time
7
-
8
-
The date and time format for files/folders displayed in the file tree.
6
+
Controls how file and folder timestamps are displayed in the file list.
9
7
10
8
<!-- table with options: relative, local, utc -->
11
9
| Value | Description |
@@ -14,9 +12,9 @@ The date and time format for files/folders displayed in the file tree.
14
12
|`utc`| UTC time (e.g. `2021-08-01 12:32:55 UTC`) |
15
13
|`relative` (Default) | Relative time based on user's localized date format (e.g. `2 days ago` in English) |
16
14
17
-
All times will be displayed in the user's local timezone.
15
+
Times are displayed in the user's local timezone.
18
16
19
-
When using the `relative` format you can override the language by setting the environment variable `DATE_FORMAT_RELATIVE_LANG` (e.g. `DATE_FORMAT_RELATIVE_LANG=de` will output relative times in German). By default it uses the locale of the user.
17
+
When using the `relative` format you can override the language used for phrases like “2 days ago” by setting `DATE_FORMAT_RELATIVE_LANG` (for example `de`). By default it uses the browser/user locale.
20
18
21
19
22
20
import EnvConfig from '@site/src/components/EnvConfig';
Copy file name to clipboardExpand all lines: docs/docs/configuration/ignore.mdx
+17-13Lines changed: 17 additions & 13 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -10,22 +10,26 @@ In contrast to using [metadata](./metadata.md) the file or folder is completely
10
10
11
11
### Ignore patterns
12
12
13
-
Hide specific files or folders by defining an ignore pattern using regular expressions.
13
+
Hide specific files or folders by defining ignore patterns as regular expressions.
14
14
15
-
It uses [preg_match](https://www.php.net/manual/en/function.preg-match.php) to match the file path. Pattern matching is case insensitive.
16
-
If a match is found the file/folder will be hidden.
15
+
Internally, each pattern is evaluated against the full file path using [preg_match](https://www.php.net/manual/en/function.preg-match.php). Matching is case-insensitive.
16
+
If any pattern matches, the file/folder will be hidden.
17
+
18
+
Notes:
19
+
- The path always starts with `/`, which is the mounted folder.
20
+
- Patterns are wrapped as `#<pattern>#im` internally. Avoid using `#` in patterns.
17
21
The path always starts with a `/`, which is the mounted folder.
|`/\..*`| Hide everything starting with a dot `.`like `.env`, `.git`... |`/foo/.bar`, `/.foo/bar`|`/foo/bar`|
24
-
|`^/foo/.*\.txt$`| Hide everything in the folder `/foo` ending with `.txt`|`/foo/abc.txt`|`/foo/abc.md`, `/bar/foo/abc.txt`|
25
-
|`^/node_modules/`| Hide the folder `/node_modules`and its content |`/node_modules`|`/foo/node_modules`|
26
-
|`/node_modules/`| Hide the folder `node_modules`and its content at any level |`/node_modules`, `/foo/node_modules`|`/node_modules_123`|
27
-
|`^/reports/2023.*\.pdf`| Hide all pdf files in the folder `/reports` starting with `2023`|`/reports/2023-01.pdf`, `/reports/2023-02.pdf`|`/reports/2022-01.pdf`, `/reports/2023-01.txt`|
28
-
|`^/secret/.*\.(jpg\|png)$`| Hide all images deep inside the folder `/secret`|`/secret/foo.jpg`, `/secret/bar/abc.png`|`/secret/foo.png.txt`, `/foo/secret/abc.png`|
25
+
| Pattern | Description | Hidden | Not Hidden |
26
+
| --- | --- | --- | --- |
27
+
|`/\..*`| Hide dotfiles like `.env`, `.git` at any depth |`/foo/.bar`, `/.foo/bar`|`/foo/bar`|
28
+
|`^/foo/.*\.txt$`| Hide everything in `/foo` ending with `.txt`|`/foo/abc.txt`|`/foo/abc.md`, `/bar/foo/abc.txt`|
29
+
|`^/node_modules/`| Hide `/node_modules`only at the root |`/node_modules`|`/foo/node_modules`|
30
+
|`/node_modules/`| Hide `node_modules` at any depth |`/node_modules`, `/foo/node_modules`|`/node_modules_123`|
31
+
|`^/reports/2023.*\.pdf$`| Hide PDFs in `/reports` starting with `2023`|`/reports/2023-01.pdf`|`/reports/2022-01.pdf`, `/reports/2023-01.txt`|
32
+
|`^/secret/.*\.(jpg\|png)$`| Hide images anywhere under `/secret`|`/secret/foo.jpg`, `/secret/bar/abc.png`|`/secret/foo.png.txt`, `/foo/secret/abc.png`|
29
33
30
34
31
35
You can hide some files and folders by setting the environment variable `IGNORE` to a pattern. By default everything is shown.
@@ -37,7 +41,7 @@ Patterns are matched against the file name and every parent folder name **indivi
37
41
38
42
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.
39
43
40
-
Usecase: Hide everything starting with a dot <kbd>.</kbd> using a `.*` pattern globally at any nesting level. This will hide `/foo/bar/.foobar`, `/.baz`, `/foo/.secret/bar` etc.
44
+
Use case: Hide everything starting with a dot <kbd>.</kbd> using a `.*` pattern globally at any nesting level. This will hide `/foo/bar/.foobar`, `/.baz`, `/foo/.secret/bar` etc.
41
45
42
46
It uses [fnmatch](https://www.php.net/manual/en/function.fnmatch.php) to match the pattern.
43
47
@@ -68,7 +72,7 @@ It uses [fnmatch](https://www.php.net/manual/en/function.fnmatch.php) to match t
68
72
69
73
### Multiple patterns
70
74
71
-
You can specify multiple patterns and seperate them using a `;`. If any of the patterns matches, the file or folder will be hidden.
75
+
You can specify multiple patterns and separate them using `;`. If any pattern matches, the file or folder will be hidden.
If you want to influence language output, the main supported knob is for **relative time strings** (for example “2 days ago”). See [Date & Time](./i18n.md) and use `DATE_FORMAT_RELATIVE_LANG`.
Copy file name to clipboardExpand all lines: docs/docs/configuration/readme.md
+1-1Lines changed: 1 addition & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -17,4 +17,4 @@ By default unsafe HTML inside markdown (such as `<script>`) will be escaped. You
17
17
18
18
import EnvConfig from '@site/src/components/EnvConfig';
19
19
20
-
<EnvConfigname="README_RENDER|README_NAME|README_FIRST|ALLOW_RAW_HTML|README_META"init="true|readme.md;readme.txt;readme.html;readme;read.me;read\ me;liesmich.md;liesmich.txt;liesmich;lies\ mich;index.html;index.htm;index.txt;license|false|false|true"values="true,false|<string>|true,false|true,false|true,false"versions="1.1|3.2|3.2|1.1|3.5"desc="|The case-insensitive file names seperated by a semicolon which should be rendered|Render the readme above the file tree instead of below it.||Renders a .dbmeta.md file if it exists" />
20
+
<EnvConfigname="README_RENDER|README_NAME|README_FIRST|ALLOW_RAW_HTML|README_META"init="true|readme.md;readme.txt;readme.html;readme;read.me;read\ me;liesmich.md;liesmich.txt;liesmich;lies\ mich;index.html;index.htm;index.txt;license|false|false|true"values="true,false|<string>|true,false|true,false|true,false"versions="1.1|3.2|3.2|1.1|3.5"desc="|The case-insensitive file names separated by a semicolon which should be rendered|Render the readme above the file tree instead of below it.||Renders a .dbmeta.md file if it exists" />
Copy file name to clipboardExpand all lines: docs/docs/configuration/search.md
+1-1Lines changed: 1 addition & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -42,4 +42,4 @@ This engine is the most powerful but slower than the glob engine. It is useful f
42
42
43
43
import EnvConfig from '@site/src/components/EnvConfig';
44
44
45
-
<EnvConfigname="SEARCH|SEARCH_ENGINE|SEARCH_MAX_DEPTH|SEARCH_MAX_RESULTS|REVERSE_SORT"init="true|s,g|25|100|false"values="true,false|s,g,r|integer|integer|true,false"versions="3.7|3.8|3.7|3.7|1.0"desc="Enables or disables the search functionality|s=simple, g=glob, r=regex. Multiple values seperated using commas.|Maximum recursive search depth (simple and regex engine only)|Maximum number of results in a single request|By default files and folders are sorted by name using natural sort."/>
45
+
<EnvConfigname="SEARCH|SEARCH_ENGINE|SEARCH_MAX_DEPTH|SEARCH_MAX_RESULTS|REVERSE_SORT"init="true|s,g|25|100|false"values="true,false|s,g,r|integer|integer|true,false"versions="3.7|3.8|3.7|3.7|1.0"desc="Enables or disables the search functionality|s=simple, g=glob, r=regex. Multiple values separated using commas.|Maximum recursive search depth (simple and regex engine only)|Maximum number of results in a single request|By default files and folders are sorted by name using natural sort."/>
Copy file name to clipboardExpand all lines: docs/docs/development/development.md
+6-6Lines changed: 6 additions & 6 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -4,18 +4,18 @@ sidebar_position: 2
4
4
5
5
# Development
6
6
7
-
Contributions are welcome. If you would like to contribute, please follow the steps below.
7
+
Contributions are welcome. To run dir-browser locally from source:
8
8
9
-
1. Clone the repository https://github.com/adrianschubek/dir-browser
10
-
2.Run the following command in the project folder. Be sure to replace `/some/local/folder` with a valid path to a folder.
9
+
1. Clone the repository:https://github.com/adrianschubek/dir-browser
10
+
2.Build and run the image from the project root. Replace `/some/local/folder` with a local folder you want to serve.
11
11
12
12
```
13
13
docker run --rm --name dir -p 8080:80 -v /some/local/folder:/var/www/html/public:ro -v redissave:/var/lib/redis/ -it $(docker build -q -f Dockerfile .)
14
14
```
15
15
It may take a few minutes to build the image.
16
16
17
-
3. Open http://localhost:8080 in your browser
17
+
3. Open http://localhost:8080
18
18
19
-
If you make any changes to the code, you have to rerun the docker command.
19
+
After making code changes, rebuild and re-run the container.
20
20
21
-
This project uses special syntax from the [utpp](https://github.com/adrianschubek/utpp) project, a CLI tool to pre-process and execute JavScript inside configuration files at startup. It's created by the same author as this project. If you would like to learn more about it, please visit the [documentation](https://utpp.adriansoftware.de/).
21
+
This project uses special syntax from [utpp](https://github.com/adrianschubek/utpp), a CLI tool that preprocesses templates and can execute JavaScript at build time. If you want to learn more, see https://utpp.adriansoftware.de/.
0 commit comments