├── .dockerignore ├── .example.env ├── .github ├── ISSUE_TEMPLATE │ ├── bug_report.md │ └── feature_request.md └── workflows │ ├── docker-image.yml │ └── docs.yml ├── .gitignore ├── Dockerfile ├── LICENSE ├── README.md ├── assets └── readme │ └── gh.css ├── cliff.toml ├── docs ├── .gitignore ├── CNAME ├── README.md ├── babel.config.js ├── docs │ ├── advanced │ │ ├── _category_.json │ │ ├── caching.md │ │ ├── performance.mdx │ │ ├── php.md │ │ └── redis.md │ ├── api │ │ └── _category_.json │ ├── changelog.md │ ├── configuration │ │ ├── _category_.json │ │ ├── attribution.md.x │ │ ├── batch.mdx │ │ ├── batch1.gif │ │ ├── batch2.png │ │ ├── download-count.md │ │ ├── hashes.md │ │ ├── http.mdx │ │ ├── http1.gif │ │ ├── i18n.md │ │ ├── icons.md │ │ ├── ignore.mdx │ │ ├── js.mdx │ │ ├── language.md.todo │ │ ├── layout.md │ │ ├── metadata.md │ │ ├── pagination.mdx │ │ ├── password.mdx │ │ ├── password1.png │ │ ├── password3.png │ │ ├── prefetch.mdx │ │ ├── readme.md │ │ ├── search.md │ │ ├── search1.png │ │ ├── search2.gif │ │ ├── themes.md │ │ ├── timing.mdx │ │ └── timing1.png │ ├── development │ │ ├── _category_.json │ │ ├── development.md │ │ └── roadmap.md.x │ ├── examples │ │ └── _category_.json │ ├── getting-started │ │ ├── _category_.json │ │ ├── installation.md │ │ └── reverse-proxy.md │ ├── intro.md │ └── v3.md ├── docusaurus.config.js ├── package-lock.json ├── package.json ├── sidebars.js ├── src │ ├── components │ │ ├── Checkmark.jsx │ │ ├── EnvConfig.jsx │ │ ├── HomepageFeatures │ │ │ ├── index.tsx │ │ │ └── styles.module.css │ │ └── Upcoming.jsx │ ├── css │ │ ├── b4.svg │ │ └── custom.css │ └── pages │ │ ├── index.jsx │ │ └── index.module.css ├── static │ ├── .nojekyll │ └── img │ │ ├── auth.svg │ │ ├── cerulean_dark.png │ │ ├── cerulean_light.png │ │ ├── colorp.svg │ │ ├── cosmo_dark.png │ │ ├── cosmo_light.png │ │ ├── counter.png │ │ ├── counter.svg │ │ ├── dir-browser.png │ │ ├── docker.svg │ │ ├── docker.webp │ │ ├── empty.png │ │ ├── favicon.ico │ │ ├── ignore.svg │ │ ├── litera_dark.png │ │ ├── litera_light.png │ │ ├── logo.svg │ │ ├── main1.png │ │ ├── main2.png │ │ ├── materia_dark.png │ │ ├── materia_light.png │ │ ├── metadata.png │ │ ├── mit.svg │ │ ├── nginx.svg │ │ ├── p1.png │ │ ├── p1.png.alt │ │ ├── p1.png.small │ │ ├── p2.png │ │ ├── p2.png.alt │ │ ├── pag1.png │ │ ├── perf2.png │ │ ├── perfdef.png │ │ ├── pw1.png │ │ ├── pw2.png │ │ ├── quartz_dark.png │ │ ├── quartz_light.png │ │ ├── readme.svg │ │ ├── sandstone_dark.png │ │ ├── sandstone_light.png │ │ ├── secure.svg │ │ ├── settings.svg │ │ ├── sketchy_dark.png │ │ ├── sketchy_light.png │ │ ├── united_dark.png │ │ ├── united_light.png │ │ ├── utpp.png │ │ ├── yeti_dark.png │ │ ├── yeti_light.png │ │ ├── z1.png │ │ └── z2.png ├── tsconfig.json ├── versioned_docs │ ├── version-0.1.x │ │ ├── api │ │ │ └── _category_.json │ │ ├── configuration │ │ │ ├── _category_.json │ │ │ └── download-count.md │ │ ├── development │ │ │ ├── _category_.json │ │ │ ├── development.md │ │ │ └── roadmap.md │ │ ├── examples │ │ │ └── _category_.json │ │ ├── getting-started │ │ │ ├── _category_.json │ │ │ ├── installation.md │ │ │ └── reverse-proxy.md │ │ └── intro.md │ ├── version-1.x │ │ ├── advanced │ │ │ ├── _category_.json │ │ │ └── performance.mdx │ │ ├── api │ │ │ └── _category_.json │ │ ├── configuration │ │ │ ├── _category_.json │ │ │ ├── attribution.md │ │ │ ├── download-count.md │ │ │ ├── file-hashes.md.todo │ │ │ ├── i18n.md │ │ │ ├── ignore.mdx │ │ │ ├── language.md.todo │ │ │ ├── password.mdx │ │ │ ├── php.md │ │ │ ├── readme.md │ │ │ ├── sort.md │ │ │ └── themes.md │ │ ├── development │ │ │ ├── _category_.json │ │ │ ├── development.md │ │ │ └── roadmap.md │ │ ├── examples │ │ │ └── _category_.json │ │ ├── getting-started │ │ │ ├── _category_.json │ │ │ ├── installation.md │ │ │ └── reverse-proxy.md │ │ └── intro.md │ └── version-2.x │ │ ├── advanced │ │ ├── _category_.json │ │ ├── performance.mdx │ │ └── php.md │ │ ├── api │ │ └── _category_.json │ │ ├── configuration │ │ ├── _category_.json │ │ ├── attribution.md │ │ ├── download-count.md │ │ ├── file-hashes.md.todo │ │ ├── highlight-updated.md │ │ ├── i18n.md │ │ ├── icons.md │ │ ├── ignore.mdx │ │ ├── language.md.todo │ │ ├── metadata.md │ │ ├── password.mdx │ │ ├── readme.md │ │ ├── sort.md │ │ └── themes.md │ │ ├── development │ │ ├── _category_.json │ │ ├── development.md │ │ └── roadmap.md │ │ ├── examples │ │ └── _category_.json │ │ ├── getting-started │ │ ├── _category_.json │ │ ├── installation.md │ │ └── reverse-proxy.md │ │ └── intro.md ├── versioned_sidebars │ ├── version-0.1.x-sidebars.json │ ├── version-1.x-sidebars.json │ └── version-2.x-sidebars.json └── versions.json ├── examples.dbmeta.json ├── examples ├── README.md ├── burger.jpg ├── burger.jpg.dbmeta.json ├── foo bar │ ├── bla bla.txt │ ├── bla bla.txt.dbmeta.json │ ├── cool project.dbmeta.json │ └── markdown │ │ └── .dbmeta.md ├── pwhash protected.txt └── pwhash protected.txt.dbmeta.json ├── server ├── nginx │ ├── conf.d │ │ └── default.conf │ └── nginx.conf ├── php │ ├── fpm-pool.conf │ └── php.ini └── redis │ └── redis.conf └── src ├── index.php └── init.sh /.dockerignore: -------------------------------------------------------------------------------- 1 | .vscode 2 | .git -------------------------------------------------------------------------------- /.example.env: -------------------------------------------------------------------------------- 1 | # DISPLAY_ERRORS=On 2 | # HASH=false 3 | # HASH_ALGO=md5 4 | # API=false 5 | #LAYOUT=popup 6 | # README_FIRST=true 7 | # OPEN_NEW_TAB=true 8 | # IGNORE=/\..* 9 | # PASSWORD_USER=admin 10 | # PASSWORD_RAW=foobar 11 | # HASH_REQUIRED=true 12 | # METADATA=false 13 | # THEME=united 14 | # BATCH_DOWNLOAD=false -------------------------------------------------------------------------------- /.github/ISSUE_TEMPLATE/bug_report.md: -------------------------------------------------------------------------------- 1 | --- 2 | name: Bug report 3 | about: Create a report to help us improve 4 | title: '' 5 | labels: bug 6 | assignees: '' 7 | 8 | --- 9 | 10 | **Describe the bug** 11 | A clear and concise description of what the bug is. 12 | 13 | **To Reproduce** 14 | Steps to reproduce the behavior: 15 | 1. Go to '...' 16 | 2. Click on '....' 17 | 3. Scroll down to '....' 18 | 4. See error 19 | 20 | **Expected behavior** 21 | A clear and concise description of what you expected to happen. 22 | 23 | **Screenshots** 24 | If applicable, add screenshots to help explain your problem. 25 | 26 | **Environment** 27 | - dir-browser version: [e.g. 2.2.0] 28 | - OS: [e.g. Windows, Android, iOS] 29 | - Browser: [e.g. Chrome, Safari] 30 | 31 | **Additional context** 32 | Add any other context about the problem here. 33 | -------------------------------------------------------------------------------- /.github/ISSUE_TEMPLATE/feature_request.md: -------------------------------------------------------------------------------- 1 | --- 2 | name: Feature request 3 | about: Suggest an idea for this project 4 | title: '' 5 | labels: enhancement 6 | assignees: '' 7 | 8 | --- 9 | 10 | **Is your feature request related to a problem? Please describe.** 11 | A clear and concise description of what the problem is. Ex. I'm always frustrated when [...] 12 | 13 | **Describe the solution you'd like** 14 | A clear and concise description of what you want to happen. 15 | 16 | **Describe alternatives you've considered** 17 | A clear and concise description of any alternative solutions or features you've considered. 18 | 19 | **Additional context** 20 | Add any other context or screenshots about the feature request here. 21 | -------------------------------------------------------------------------------- /.github/workflows/docker-image.yml: -------------------------------------------------------------------------------- 1 | name: Build and Push Docker Image 2 | 3 | on: 4 | release: 5 | types: [published] 6 | 7 | env: 8 | DOCKER_USERNAME: ${{ secrets.DOCKER_USERNAME }} 9 | DOCKER_PASSWORD: ${{ secrets.DOCKER_PASSWORD }} 10 | 11 | jobs: 12 | build-and-push: 13 | runs-on: ubuntu-latest 14 | steps: 15 | - name: Checkout Repository 16 | uses: actions/checkout@v3 17 | 18 | - name: Set up QEMU 19 | uses: docker/setup-qemu-action@v2 20 | 21 | - name: Set up Docker Buildx 22 | uses: docker/setup-buildx-action@v2 23 | 24 | - name: Login to Docker Hub 25 | uses: docker/login-action@v2 26 | with: 27 | username: ${{ env.DOCKER_USERNAME }} 28 | password: ${{ env.DOCKER_PASSWORD }} 29 | 30 | - name: Build and Push Docker Image 31 | uses: docker/build-push-action@v4 32 | with: 33 | context: . 34 | platforms: linux/amd64,linux/arm64 35 | push: true 36 | tags: ${{ secrets.DOCKER_USERNAME }}/dir-browser:latest,${{ secrets.DOCKER_USERNAME }}/dir-browser:${{ github.event.release.tag_name }} 37 | -------------------------------------------------------------------------------- /.github/workflows/docs.yml: -------------------------------------------------------------------------------- 1 | # Simple workflow for deploying static content to GitHub Pages 2 | name: Deploy static content to Pages 3 | 4 | on: 5 | # Runs on pushes targeting the default branch 6 | push: 7 | branches: [main, "3.x"] 8 | 9 | # Allows you to run this workflow manually from the Actions tab 10 | workflow_dispatch: 11 | 12 | # Sets permissions of the GITHUB_TOKEN to allow deployment to GitHub Pages 13 | permissions: 14 | contents: read 15 | pages: write 16 | id-token: write 17 | 18 | # Allow one concurrent deployment 19 | concurrency: 20 | group: "pages" 21 | cancel-in-progress: true 22 | 23 | env: 24 | # Hosted GitHub runners have 7 GB of memory available, let's use 6 GB 25 | NODE_OPTIONS: --max-old-space-size=6144 26 | 27 | defaults: 28 | run: 29 | working-directory: docs 30 | 31 | jobs: 32 | build: 33 | name: Build Docusaurus 34 | runs-on: ubuntu-latest 35 | steps: 36 | - uses: actions/checkout@v4 37 | with: 38 | fetch-depth: 0 39 | - uses: actions/setup-node@v4 40 | with: 41 | node-version: 18 42 | cache: npm 43 | cache-dependency-path: docs/package-lock.json 44 | 45 | - name: Install dependencies 46 | run: npm ci 47 | - name: Build website 48 | run: npm run build 49 | 50 | - name: Upload Build Artifact 51 | uses: actions/upload-pages-artifact@v3 52 | with: 53 | path: docs/build 54 | 55 | deploy: 56 | name: Deploy to GitHub Pages 57 | needs: build 58 | 59 | # Grant GITHUB_TOKEN the permissions required to make a Pages deployment 60 | permissions: 61 | pages: write # to deploy to Pages 62 | id-token: write # to verify the deployment originates from an appropriate source 63 | 64 | # Deploy to the github-pages environment 65 | environment: 66 | name: github-pages 67 | url: ${{ steps.deployment.outputs.page_url }} 68 | 69 | runs-on: ubuntu-latest 70 | steps: 71 | - name: Deploy to GitHub Pages 72 | id: deployment 73 | uses: actions/deploy-pages@v4 74 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | .vscode 2 | .local -------------------------------------------------------------------------------- /Dockerfile: -------------------------------------------------------------------------------- 1 | FROM php:8.4-fpm-alpine AS base 2 | 3 | ENV DIRBROWSER_VERSION=3.12.0 4 | 5 | RUN apk update && apk upgrade 6 | 7 | RUN docker-php-ext-install opcache 8 | 9 | RUN apk add --no-cache libzip-dev \ 10 | && docker-php-ext-configure zip \ 11 | && docker-php-ext-install zip 12 | 13 | RUN apk add --no-cache autoconf build-base \ 14 | && pecl install -o -f redis \ 15 | && rm -rf /tmp/pear \ 16 | && docker-php-ext-enable redis \ 17 | && apk del autoconf build-base 18 | 19 | RUN apk add --no-cache redis 20 | 21 | RUN apk add --no-cache nginx 22 | 23 | RUN apk add --no-cache bash 24 | 25 | RUN apk add --no-cache curl \ 26 | && curl -fSsL https://github.com/adrianschubek/utpp/releases/download/0.5.0/utpp-alpine -o /usr/local/bin/utpp && chmod +x /usr/local/bin/utpp\ 27 | && apk del curl 28 | 29 | RUN apk add --no-cache composer 30 | 31 | WORKDIR /var/www/html 32 | 33 | RUN composer require "league/commonmark:^2.6" 34 | 35 | RUN mkdir -p /data/nginx/cache 36 | # for batch downloads 37 | RUN mkdir -p /var/www/html/tmp 38 | 39 | COPY server/nginx/nginx.conf /etc/nginx/nginx.conf 40 | 41 | COPY server/nginx/conf.d/default.conf /etc/nginx/conf.d/default.conf 42 | 43 | COPY server/php/fpm-pool.conf /usr/local/etc/php-fpm.d/www.conf 44 | 45 | COPY server/php/php.ini /usr/local/etc/php/conf.d/custom.ini 46 | 47 | COPY src/index.php /var/www/html 48 | 49 | # skipped in v3.9 50 | # COPY src/worker.php /var/www/html 51 | 52 | COPY src/init.sh /init.sh 53 | 54 | RUN chmod +x /init.sh 55 | 56 | ENV THEME=default 57 | 58 | ENV DATE_FORMAT=relative 59 | 60 | ENV HASH=true 61 | 62 | ENV TRANSITION=false 63 | 64 | ENV HASH_FOLDER=false 65 | 66 | ENV HASH_REQUIRED=false 67 | 68 | ENV HASH_ALGO=sha256 69 | 70 | ENV API=true 71 | 72 | # TODO: full = popup fullscreen 73 | # basic,popup,full 74 | ENV LAYOUT=basic 75 | # TODO: show files in tree on hover 76 | ENV PREVIEW=false 77 | 78 | ENV README_NAME=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 79 | 80 | ENV README_FIRST=false 81 | 82 | ENV README_META=true 83 | 84 | ENV DOWNLOAD_COUNTER=true 85 | 86 | ENV README_RENDER=true 87 | 88 | ENV OPEN_NEW_TAB=false 89 | 90 | ENV HIGHLIGHT_UPDATED=true 91 | 92 | ENV METADATA=true 93 | 94 | ENV SEARCH=true 95 | 96 | # s=simple,g=glob,r=regex 97 | ENV SEARCH_ENGINE=s,g 98 | # regex only: 99 | ENV SEARCH_MAX_DEPTH=25 100 | 101 | ENV SEARCH_MAX_RESULTS=100 102 | 103 | # multi select batch file download 104 | ENV BATCH_DOWNLOAD=true 105 | # TODO: add more: https://www.php.net/manual/en/book.zlib.php 106 | ENV BATCH_TYPE=zip 107 | # https://www.php.net/manual/en/zip.constants.php#ziparchive.constants.cm-default 108 | ENV BATCH_ZIP_COMPRESS_ALGO=DEFAULT 109 | # MB 110 | ENV BATCH_MAX_TOTAL_SIZE=500 111 | # MB per file 112 | ENV BATCH_MAX_FILE_SIZE=100 113 | # MB, how much system disk space to keep free at all times 114 | ENV BATCH_MIN_SYSTEM_FREE_DISK=500 115 | # watch filesystem 116 | ENV WORKER_WATCH=true 117 | # seconds re-scan 118 | ENV WORKER_SCAN_INTERVAL=60 119 | 120 | ENV WORKER_FORCE_RESCAN= 121 | 122 | ENV PAGINATION_PER_PAGE=100 123 | 124 | ENV PREFETCH_FOLDERS=true 125 | 126 | ENV PREFETCH_FILES=false 127 | 128 | EXPOSE 8080 129 | 130 | CMD ["/init.sh"] 131 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2025 Adrian Schubek 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 |
2 | 3 | 6 | 7 | [![](https://user-images.githubusercontent.com/19362349/235141708-34db874f-729c-4e50-b458-a3c0cb5d6c07.png)](https://dir.adriansoftware.de) 8 | 9 | 14 | 15 | 19 |
20 | 21 | 22 | 23 |

24 | 25 | Visit [dir.adriansoftware.de](https://dir.adriansoftware.de) for documentation & more! 26 | 27 |

28 | 29 | 30 | 31 | 36 | 37 | 38 | ## Demo 39 | 40 | https://dir-demo.adriansoftware.de 41 | 42 | ## Features 43 | - **Download counter** for all files 44 | - Secure by default. **Read-only** access 45 | - Extremly **fast** file serving through **nginx** 46 | - **README** markdown rendering support 47 | - **JSON API** for programmatic access 48 | - **Batch download** of files and folders in a zip archive 49 | - **file integrity** check with **hashes** 50 | - **custom description** and **labels** for files and folders 51 | - **Search** and **sorting** built-in 52 | - **Password** protection 53 | - **Hide** files and folders 54 | - Light and **Darkmode** 55 | - File **icons** 56 | - Many **Themes** available 57 | - **Clean URLs** equivalent to file system paths 58 | - **Low memory** footprint (~10MB) 59 | - Easy setup using single **Docker** image 60 | - **Responsive** design for mobile devices and desktop 61 | - Easily configurable using **environment variables** 62 | - File stats like modification dates and sizes 63 | - Custom JS and CSS support 64 | - Highlight recently updated files 65 | - Track request timing 66 | - **arm64** support 67 | - Works **without JavaScript** enabled 68 | -------------------------------------------------------------------------------- /cliff.toml: -------------------------------------------------------------------------------- 1 | # git-cliff ~ default configuration file 2 | # https://git-cliff.org/docs/configuration 3 | # 4 | # Lines starting with "#" are comments. 5 | # Configuration options are organized into tables and keys. 6 | # See documentation for more information on available options. 7 | 8 | [changelog] 9 | # changelog header 10 | header = """ 11 | # Changelog\n 12 | All notable changes to this project will be documented in this file.\n 13 | """ 14 | # template for the changelog body 15 | # https://keats.github.io/tera/docs/#introduction 16 | body = """ 17 | {% if version %}\ 18 | ## [{{ version | trim_start_matches(pat="v") }}] - {{ timestamp | date(format="%Y-%m-%d") }} 19 | {% else %}\ 20 | ## [unreleased] 21 | {% endif %}\ 22 | {% for group, commits in commits | group_by(attribute="group") %} 23 | ### {{ group | striptags | trim | upper_first }} 24 | {% for commit in commits %} 25 | - {% if commit.scope %}*({{ commit.scope }})* {% endif %}\ 26 | {% if commit.breaking %}[**breaking**] {% endif %}\ 27 | {{ commit.message | upper_first }} ([{{ commit.id | truncate(length=7, end="") }}](https://github.com/adrianschubek/dir-browser/commit/{{ commit.id }}))\ 28 | {% endfor %} 29 | {% endfor %}\n 30 | """ 31 | # template for the changelog footer 32 | footer = """ 33 | 34 | """ 35 | # remove the leading and trailing s 36 | trim = true 37 | # postprocessors 38 | postprocessors = [ 39 | # { pattern = '', replace = "https://github.com/orhun/git-cliff" }, # replace repository URL 40 | ] 41 | 42 | [git] 43 | # parse the commits based on https://www.conventionalcommits.org 44 | conventional_commits = true 45 | # filter out the commits that are not conventional 46 | filter_unconventional = true 47 | # process each line of a commit as an individual commit 48 | split_commits = false 49 | # regex for preprocessing the commit messages 50 | commit_preprocessors = [ 51 | # Replace issue numbers 52 | #{ pattern = '\((\w+\s)?#([0-9]+)\)', replace = "([#${2}](/issues/${2}))"}, 53 | # Check spelling of the commit with https://github.com/crate-ci/typos 54 | # If the spelling is incorrect, it will be automatically fixed. 55 | #{ pattern = '.*', replace_command = 'typos --write-changes -' }, 56 | ] 57 | # regex for parsing and grouping commits 58 | commit_parsers = [ 59 | { message = "^feat", group = "🚀 Features" }, 60 | { message = "^fix", group = "🐛 Bug Fixes" }, 61 | { message = "^doc", group = "📚 Documentation" }, 62 | { message = "^perf", group = "⚡ Performance" }, 63 | { message = "^refactor", group = "🚜 Refactor" }, 64 | { message = "^style", group = "🎨 Styling" }, 65 | { message = "^test", group = "🧪 Testing" }, 66 | { message = "^chore\\(release\\): prepare for", skip = true }, 67 | { message = "^chore\\(deps.*\\)", skip = true }, 68 | { message = "^chore\\(pr\\)", skip = true }, 69 | { message = "^chore\\(pull\\)", skip = true }, 70 | { message = "^chore|^ci", group = "⚙️ Miscellaneous Tasks" }, 71 | { body = ".*security", group = "🛡️ Security" }, 72 | { message = "^revert", group = "◀️ Revert" }, 73 | ] 74 | # protect breaking changes from being skipped due to matching a skipping commit_parser 75 | protect_breaking_commits = false 76 | # filter out the commits that are not matched by commit parsers 77 | filter_commits = false 78 | # regex for matching git tags 79 | # tag_pattern = "v[0-9].*" 80 | # regex for skipping tags 81 | # skip_tags = "" 82 | # regex for ignoring tags 83 | # ignore_tags = "" 84 | # sort the tags topologically 85 | topo_order = false 86 | # sort the commits inside sections by oldest/newest order 87 | sort_commits = "oldest" 88 | # limit the number of commits included in the changelog. 89 | # limit_commits = 42 90 | -------------------------------------------------------------------------------- /docs/.gitignore: -------------------------------------------------------------------------------- 1 | # Dependencies 2 | /node_modules 3 | 4 | # Production 5 | /build 6 | 7 | # Generated files 8 | .docusaurus 9 | .cache-loader 10 | 11 | # Misc 12 | .DS_Store 13 | .env.local 14 | .env.development.local 15 | .env.test.local 16 | .env.production.local 17 | 18 | npm-debug.log* 19 | yarn-debug.log* 20 | yarn-error.log* 21 | -------------------------------------------------------------------------------- /docs/CNAME: -------------------------------------------------------------------------------- 1 | dir.adriansoftware.de -------------------------------------------------------------------------------- /docs/README.md: -------------------------------------------------------------------------------- 1 | # Website 2 | 3 | This website is built using [Docusaurus 2](https://docusaurus.io/), a modern static website generator. 4 | 5 | ### Installation 6 | 7 | ``` 8 | $ yarn 9 | ``` 10 | 11 | ### Local Development 12 | 13 | ``` 14 | $ yarn start 15 | ``` 16 | 17 | This command starts a local development server and opens up a browser window. Most changes are reflected live without having to restart the server. 18 | 19 | ### Build 20 | 21 | ``` 22 | $ yarn build 23 | ``` 24 | 25 | This command generates static content into the `build` directory and can be served using any static contents hosting service. 26 | 27 | ### Deployment 28 | 29 | Using SSH: 30 | 31 | ``` 32 | $ USE_SSH=true yarn deploy 33 | ``` 34 | 35 | Not using SSH: 36 | 37 | ``` 38 | $ GIT_USER= yarn deploy 39 | ``` 40 | 41 | If you are using GitHub pages for hosting, this command is a convenient way to build the website and push to the `gh-pages` branch. 42 | -------------------------------------------------------------------------------- /docs/babel.config.js: -------------------------------------------------------------------------------- 1 | module.exports = { 2 | presets: [require.resolve('@docusaurus/core/lib/babel/preset')], 3 | }; 4 | -------------------------------------------------------------------------------- /docs/docs/advanced/_category_.json: -------------------------------------------------------------------------------- 1 | { 2 | "label": "⚡ Advanced", 3 | "position": 5, 4 | "link": { 5 | "type": "generated-index", 6 | "description": "Advanced guides" 7 | } 8 | } 9 | -------------------------------------------------------------------------------- /docs/docs/advanced/caching.md: -------------------------------------------------------------------------------- 1 | # Caching 2 | 3 | :::info 4 | Work in progress. Do not use in production. 5 | ::: 6 | 7 | import EnvConfig from '@site/src/components/EnvConfig'; 8 | 9 | -------------------------------------------------------------------------------- /docs/docs/advanced/performance.mdx: -------------------------------------------------------------------------------- 1 | # Performance Tuning 2 | 3 | The performance is already pretty good, but there are a few configuration options that can be tweaked to further improve performance. 4 | 5 |
6 | 7 | ![](/img/perfdef.png) 8 | 9 |
10 | 11 | [Default](/getting-started/installation.md) performance running version 1.1.0 on a Ryzen 5 5600X processor 12 | 13 |
14 | 15 |
16 | 17 | ## Disable Download count 18 | 19 | By default, the download count is enabled. This means that every time a file is downloaded, the download count is incremented by one. This is done by incrementing a Redis key. 20 | However this has a performance impact. 21 | 22 | If you don't need the download count, you can disable it by setting the `DOWNLOAD_COUNTER` environment variable to `false`. 23 | 24 |
25 | 26 | ![](/img/perf2.png) 27 | 28 |
29 | 30 | Throughput after starting the container with env variable `DOWNLOAD_COUNTER=false` 31 | 32 |
33 | 34 |
35 | 36 | ## Disable Readme Renderer 37 | 38 | Set `README_RENDER` to `false` to disable the rendering of README files for improved performance. -------------------------------------------------------------------------------- /docs/docs/advanced/php.md: -------------------------------------------------------------------------------- 1 | --- 2 | sidebar_position: 2 3 | --- 4 | 5 | # PHP 6 | 7 | ## display_errors 8 | 9 | By default `display_errors` is set to `Off` in the `php.ini` file. 10 | 11 | ## memory_limit 12 | 13 | By default `memory_limit` is set to `128M` in the `php.ini` file. 14 | 15 | 16 | import EnvConfig from '@site/src/components/EnvConfig'; 17 | 18 | -------------------------------------------------------------------------------- /docs/docs/advanced/redis.md: -------------------------------------------------------------------------------- 1 | # Redis 2 | 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 | 5 | ### Access 6 | 7 | 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. 8 | 9 | 1. First create a shell. Replace `` with the name of the container. 10 | ```bash 11 | docker exec -it sh 12 | ``` 13 | 2. Start the Redis CLI. 14 | ```bash 15 | redis-cli 16 | ``` 17 | 18 | See https://redis.io/docs/latest/commands/ for a list of available commands. 19 | 20 | ### List all stored counters 21 | ```bash title="$> KEYS *" 22 | ... 23 | 25) "/src/index.php" 24 | 26) "/docs/versioned_docs/version-1.x/configuration/download-count.md" 25 | 27) "/docs/static/img/pw1.png" 26 | 28) "/docs/versioned_docs/version-1.x/development/_category_.json" 27 | 29) "/docs/versioned_docs/version-1.x/getting-started/installation.md" 28 | 30) "/docs/static/img/cerulean_dark.png" 29 | 31) "/docs/versioned_sidebars/version-1.x-sidebars.json" 30 | 32) "/docs/versioned_docs/version-2.x/configuration/highlight-updated.md" 31 | 33) "/docs/static/img/secure.svg" 32 | 34) "/docs/src/pages/index.module.css" 33 | ... 34 | ``` 35 | ### Read a counter 36 | ```bash title="$> GET /src/index.php" 37 | 123 38 | ``` 39 | ### Reset/Modify a counter 40 | ```bash title="$> SET /src/index.php 0" 41 | OK 42 | ``` -------------------------------------------------------------------------------- /docs/docs/api/_category_.json: -------------------------------------------------------------------------------- 1 | { 2 | "label": "🤖 API Reference", 3 | "position": 4, 4 | "link": { 5 | "type": "generated-index", 6 | "description": "API Reference" 7 | } 8 | } 9 | -------------------------------------------------------------------------------- /docs/docs/configuration/_category_.json: -------------------------------------------------------------------------------- 1 | { 2 | "label": "⚙️ Configuration", 3 | "position": 3, 4 | "link": { 5 | "type": "generated-index", 6 | "description": "Configuration" 7 | } 8 | } 9 | -------------------------------------------------------------------------------- /docs/docs/configuration/attribution.md.x: -------------------------------------------------------------------------------- 1 | --- 2 | sidebar_position: 5 3 | --- 4 | 5 | # Attribution 6 | 7 | You can hide the attribution by setting the environment variable `HIDE_ATTRIBUTION` to `true`. 8 | -------------------------------------------------------------------------------- /docs/docs/configuration/batch.mdx: -------------------------------------------------------------------------------- 1 | # Batch Downloads 2 | 3 | The batch download feature allows you to download multiple files at once in a zip file. 4 | 5 | Enable the multi selection mode by clicking the checkbox in the top right corner of the file list. You can then select multiple files by clicking on the files. 6 | 7 | ![](batch1.gif) 8 | 9 | Or download the current folder. 10 | 11 | ![](batch2.png) 12 | 13 | :::info 14 | Selecting a folder will also recursively select all files and folders inside it. 15 | ::: 16 | 17 | :::warning 18 | [Ignored](ignore.mdx), [hidden](metadata.md#hidden) and [password protected](password.mdx) files/folders cannot be batch downloaded and will be skipped. 19 | ::: 20 | 21 | import EnvConfig from "@site/src/components/EnvConfig"; 22 | 23 | 24 | -------------------------------------------------------------------------------- /docs/docs/configuration/batch1.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/adrianschubek/dir-browser/012f608713e3dc9e14acc372a74a8547f8df1f0a/docs/docs/configuration/batch1.gif -------------------------------------------------------------------------------- /docs/docs/configuration/batch2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/adrianschubek/dir-browser/012f608713e3dc9e14acc372a74a8547f8df1f0a/docs/docs/configuration/batch2.png -------------------------------------------------------------------------------- /docs/docs/configuration/download-count.md: -------------------------------------------------------------------------------- 1 | --- 2 | sidebar_position: 1 3 | --- 4 | # Download Counter 5 | 6 | Download count tracks the number of times a file has been downloaded/visited/opened. It will be saved in a persistent redis database (`-v redissave:/var/lib/redis/`). 7 | Folders itself will not be tracked. In [batch downloads](batch.mdx) the download count will intuitively be increased for each (nested) file in the batch. 8 | 9 | Files are tracked based on their (full) file path. Therefore renaming a file will change/reset the download count. 10 | 11 | 12 | import EnvConfig from '@site/src/components/EnvConfig'; 13 | 14 | -------------------------------------------------------------------------------- /docs/docs/configuration/hashes.md: -------------------------------------------------------------------------------- 1 | # Integrity & Hashes 2 | 3 | It is possible to verify the integrity of a file by setting the `?hash` query parameter to the hash of the file. If the hash does not match the actual hash of the file, an error will be returned instead. 4 | 5 | The [file info API](http.mdx) will also include the hash of the file. 6 | 7 | `sha256` is used as the default hashing algorithm but can be changed to any of the [supported](https://www.php.net/manual/en/function.hash-algos.php) algorithms. 8 | 9 | #### Example 10 | 11 | https://dir-demo.adriansoftware.de/Dockerfile?hash=foobar123 12 | 13 | will return an access denied error. 14 | 15 | Setting it to the correct hash will return the file as usual. 16 | 17 | https://dir-demo.adriansoftware.de/Dockerfile?hash=8102c6372ce8afd35c87df8a78cbd63386538211f45c0042b1a9a7e73630a9bb 18 | 19 | You can also use a POST request to verify the hash: 20 | 21 | ```bash 22 | curl -X POST https://dir-demo.adriansoftware.de/Dockerfile -d "hash=8102c6372ce8afd35c87df8a78cbd63386538211f45c0042b1a9a7e73630a9bb" 23 | ``` 24 | 25 | ### Mandatory hashes 26 | 27 | Set in the [metadata](metadata.md) config of the file to require the hash to be set. If the hash is not set, an error will be returned. 28 | 29 | ```json title=".dbmeta.json" 30 | { 31 | "hash_required": true 32 | } 33 | ``` 34 | 35 | Or set it globally using the `HASH_REQUIRED` variable. 36 | 37 | :::warning 38 | This feature should not be used to restrict access as the hash is publicly available through the [API](http.mdx) if enabled. It is only meant to make an integrity verification of the file mandatory for every request. 39 | 40 | To protect the file use the [password protection](password.mdx) feature. 41 | ::: 42 | 43 | import EnvConfig from '@site/src/components/EnvConfig'; 44 | 45 | 46 | 47 | -------------------------------------------------------------------------------- /docs/docs/configuration/http.mdx: -------------------------------------------------------------------------------- 1 | # API 2 | 3 | ### Folder listing 4 | 5 | Add `?ls` to a folder URL to get a JSON response of the folder content. 6 | 7 | ![](http1.gif) 8 | 9 | ![image](https://github.com/adrianschubek/dir-browser/assets/19362349/72464d3e-6cf2-475e-86ca-45534ad9fdce) 10 | 11 | https://dir-demo.adriansoftware.de/?ls 12 | 13 | ### File info 14 | 15 | Add `?info` to a file URL to get a JSON response of the file info. A password is required if the file is password protected. 16 | 17 | ![image](https://github.com/adrianschubek/dir-browser/assets/19362349/4e7e9928-50c6-41ee-864f-144866d6fe5f) 18 | 19 | https://dir-demo.adriansoftware.de/Dockerfile?info 20 | 21 | :::warning 22 | Disabling this feature will also disable the `Copy Hash` feature as it relies on the API. 23 | ::: 24 | 25 | import EnvConfig from "@site/src/components/EnvConfig"; 26 | 27 | 28 | -------------------------------------------------------------------------------- /docs/docs/configuration/http1.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/adrianschubek/dir-browser/012f608713e3dc9e14acc372a74a8547f8df1f0a/docs/docs/configuration/http1.gif -------------------------------------------------------------------------------- /docs/docs/configuration/i18n.md: -------------------------------------------------------------------------------- 1 | --- 2 | sidebar_position: 3 3 | --- 4 | # Format 5 | 6 | ## Date & Time 7 | 8 | The date and time format for files/folders displayed in the file tree. 9 | 10 | 11 | | Value | Description | 12 | | --- | --- | 13 | | `local` | Format based on user's localized date format (e.g. `12.1.2024, 04:36:30` in German) | 14 | | `utc` | UTC time (e.g. `2021-08-01 12:32:55 UTC`) | 15 | | `relative` (Default) | Relative time based on user's localized date format (e.g. `2 days ago` in English) | 16 | 17 | All times will be displayed in the user's local timezone. 18 | 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. 20 | 21 | 22 | import EnvConfig from '@site/src/components/EnvConfig'; 23 | 24 | -------------------------------------------------------------------------------- /docs/docs/configuration/icons.md: -------------------------------------------------------------------------------- 1 | # File Icons 2 | 3 | Display file and folders icons in the file tree. Increases the css bundle. 4 | 5 | import EnvConfig from '@site/src/components/EnvConfig'; 6 | 7 | -------------------------------------------------------------------------------- /docs/docs/configuration/ignore.mdx: -------------------------------------------------------------------------------- 1 | --- 2 | sidebar_position: 6 3 | --- 4 | 5 | # Hide Files & Folders 6 | 7 | :::info 8 | In contrast to using [metadata](./metadata.md) the file or folder is completely hidden/ignored from the filetree, all APIs and cannot be accessed via URL. 9 | ::: 10 | 11 | ### Ignore patterns 12 | 13 | Hide specific files or folders by defining an ignore pattern using regular expressions. 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. 17 | The path always starts with a `/`, which is the mounted folder. 18 | 19 | #### Examples 20 | 21 | | Pattern | Description | Hidden | Not Hidden | 22 | | ------------------------------------- | ---------------------------------------------------------------- | ---------------------------------------------- | ---------------------------------------------- | 23 | | `/\..*` | 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` | 29 | 30 | 31 | You can hide some files and folders by setting the environment variable `IGNORE` to a pattern. By default everything is shown. 32 | 33 |
34 | Legacy (v1.2 - v3.2) ignore pattern matching 35 | 36 | Patterns are matched against the file name and every parent folder name **individually** not as a path. 37 | 38 | 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 | 40 | Usecase: 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. 41 | 42 | It uses [fnmatch](https://www.php.net/manual/en/function.fnmatch.php) to match the pattern. 43 | 44 | | Pattern | Description | 45 | | -------- | -------------------------------------- | 46 | | `*` | Matches everything (including nothing) | 47 | | `?` | Matches any single character | 48 | | `[seq]` | Matches any character in seq | 49 | | `[!seq]` | Matches any character not in seq | 50 | 51 | - pattern `foo` will hide the file `foo/bar/secret.txt` because `foo` matches the first array element `foo`. 52 | - pattern `*bar*` will hide the file `foo/bar/secret.txt` because `*bar*` matches the second array element `bar`. 53 | - pattern `*.txt` will hide the file `foo/bar/secret.txt` because `*.txt` matches the third array element `secret.txt`. 54 | 55 | #### Examples 56 | 57 | - `*[ab].txt` hides all files or folder ending with either `a.txt` or `b.txt`. 58 | 59 | - `.*` hides all files or folder starting with a dot . 60 | 61 | - `[a-zA-Z0-9]*` hides all files or folder starting with a letter or number. 62 | 63 | - `[!a-zA-Z0-9]*` hides all files or folder not starting with a letter or number. 64 | 65 | - `report-???.pdf` hides `report-001.pdf`, `report-123.pdf` but not `report-1.pdf`. 66 | 67 |
68 | 69 | ### Multiple patterns 70 | 71 | You can specify multiple patterns and seperate them using a `;`. If any of the patterns matches, the file or folder will be hidden. 72 | 73 | import EnvConfig from "@site/src/components/EnvConfig"; 74 | 75 | 82 | -------------------------------------------------------------------------------- /docs/docs/configuration/js.mdx: -------------------------------------------------------------------------------- 1 | # Custom JavaScript 2 | 3 | import EnvConfig from '@site/src/components/EnvConfig'; 4 | 5 | -------------------------------------------------------------------------------- /docs/docs/configuration/language.md.todo: -------------------------------------------------------------------------------- 1 | --- 2 | sidebar_position: 4 3 | --- 4 | 5 | # Language 6 | 7 | Available Languages: `en` (English), `de` (Deutsch) 8 | 9 | By default the language is set to `en`. You can change it by setting the `LANGUAGE` environment variable. 10 | 11 | ``` 12 | docker run -d -p 8080:80 -v /my/local/folder:/var/www/html/public:ro -e LANGUAGE=de -v redissave:/var/lib/redis/ -it adrianschubek/dir-browser 13 | ``` -------------------------------------------------------------------------------- /docs/docs/configuration/layout.md: -------------------------------------------------------------------------------- 1 | # Layout 2 | 3 | 9 | import EnvConfig from '@site/src/components/EnvConfig'; 10 | 11 | -------------------------------------------------------------------------------- /docs/docs/configuration/metadata.md: -------------------------------------------------------------------------------- 1 | --- 2 | sidebar_position: -1 3 | --- 4 | 5 | import Image from "@theme/IdealImage"; 6 | 7 | # Metadata 8 | 9 | Files and folders can be annotated with metadata. Metadata is stored in a file called `.dbmeta.json`, where `` is the exact file (including extension) or folder name. Put it in the same folder as the target file or folder. Metadata is stored in a JSON format specified below. 10 | 11 | The `*.dbmeta.json` files are hidden from the user and cannot be viewed. 12 | 13 | 14 | 15 | 16 | 17 | ```json title="/foo bar/cool project.dbmeta.json" 18 | { 19 | "description": "A short project description ⭐", 20 | "labels": ["danger:Laravel", "primary:PHP 8", "dark:Hot 🔥"], 21 | "hidden": false, 22 | "password": "mysecurepassword", 23 | "hash_required": false 24 | } 25 | ``` 26 | 27 | 28 | :::info 29 | If you are looking for the ".dbmeta.**md**" files, see [Readme Rendering](./readme.md). 30 | ::: 31 | 32 | ## Properties 33 | 34 | #### Description 35 | 36 | A short description of the file or folder. This is displayed in the file tree. 37 | 38 | > Default is empty. 39 | 40 | #### Labels 41 | 42 | Labels always start with a style and a colon `:`, followed by the label text. The following styles are available: 43 | - `primary` 44 | - `secondary` 45 | - `success` 46 | - `danger` 47 | - `warning` 48 | - `info` 49 | - `light` 50 | - `dark` 51 | 52 | :::warning 53 | Labels must not contain a semicolon `;`. 54 | ::: 55 | 56 | > Default is empty. 57 | 58 | #### Hidden 59 | 60 | :::warning 61 | The file can still be accessed via URL directly. If you want to ignore it completely, consider using an [IGNORE](./ignore.mdx) pattern. 62 | ::: 63 | 64 | If set to `true`, the file or folder is hidden from the file tree. Can be combined with password protection. 65 | 66 | > Default is `false`. 67 | 68 | #### Password 69 | 70 | See [Password Protection](password.mdx). 71 | 72 | > Default is empty. 73 | 74 | #### Hash Required 75 | 76 | See [Integrity & Hashes](hashes.md). 77 | 78 | > Default is `false`. 79 | 80 | import EnvConfig from "@site/src/components/EnvConfig"; 81 | 82 | -------------------------------------------------------------------------------- /docs/docs/configuration/pagination.mdx: -------------------------------------------------------------------------------- 1 | # Pagination 2 | 3 | import Image from "@theme/IdealImage"; 4 | import EnvConfig from "@site/src/components/EnvConfig"; 5 | 6 | Display a large number of items in a list by splitting them into multiple pages. 7 | 8 | Pagination only visible when the number of items exceeds the number of items per page. 9 | 10 | 11 | 12 | -------------------------------------------------------------------------------- /docs/docs/configuration/password.mdx: -------------------------------------------------------------------------------- 1 | --- 2 | sidebar_position: 0.5 3 | --- 4 | 5 | import Image from "@theme/IdealImage"; 6 | 7 | # Password Protection 8 | 9 | Individual files can be protected with a password. 10 | It is also possible to protect the entire dir-browser instance with a global password. 11 | 12 | Both file passwords and a global password can be used at the same time. 13 | 14 | ## File password 15 | 16 | 17 | 18 | A file can be protected with a password, which is stored in a [dbmeta.json](/configuration/metadata.md) file. 19 | 20 | Protected files can only be downloaded/viewed after unlocking them with the correct password. However, they are still visible in the file tree. 21 | 22 | Protected files will display a key icon next to their name in the file tree. 23 | 24 | ### Definition 25 | 26 | See [Metadata](metadata.md) for more information on how to define metadata for a file. 27 | 28 | :::info 29 | At this time, only files can be protected with a password, not directories. This may change in the future. 30 | ::: 31 | 32 | #### Hash 33 | 34 | The hash should be generated using PHP's [`password_hash`](https://www.php.net/manual/en/function.password-hash.php) function. 35 | You can generate one using the following command or use an online generator. 36 | ```bash 37 | php -r "echo password_hash('foobar', PASSWORD_DEFAULT);" 38 | ``` 39 | 40 | ![](password1.png) 41 | 42 | 43 | ```json title="/examples/pwhash protected.txt.dbmeta.json" 44 | { 45 | "password_hash": "$2y$10$kwS/gp3aGLQ.DqUNhiqiPe1HDBN4mYlyfd06DIC/157L9WAaWngIy" 46 | } 47 | ``` 48 | 49 | #### Plaintext 50 | 51 | ```json title="/examples/foo bar/bla bla.txt.dbmeta.json" 52 | { 53 | "password": "foobar" 54 | } 55 | ``` 56 | 57 | :::warning 58 | Do not specify both `password` and `password_hash`. 59 | ::: 60 | 61 | 62 | ### Access 63 | 64 | #### Via UI 65 | 66 | When accessing a protected file, you will be prompted to enter the password. 67 | 68 | https://dir-demo.adriansoftware.de/examples/foo%20%20%20bar/bla%20bla.txt 69 | 70 | {/* */} 71 | ![](password3.png) 72 | 73 | #### GET request 74 | 75 | Specify the password as a `key` parameter in the URL: 76 | 77 | https://dir-demo.adriansoftware.de/examples/foo%20%20%20bar/bla%20bla.txt?key=foobar 78 | 79 | #### POST request 80 | 81 | Or as part of a POST request 82 | 83 | ``` 84 | curl -X POST https://dir-demo.adriansoftware.de/examples/foo%20%20%20bar/bla%20bla.txt -d "key=foobar" 85 | ``` 86 | 87 | ## Global password 88 | 89 | The entire dir-browser instance can be protected with a global password using [basic auth](https://en.wikipedia.org/wiki/Basic_access_authentication). 90 | 91 | ### Definition 92 | 93 | import EnvConfig from '@site/src/components/EnvConfig'; 94 | 95 | 96 | 97 | :::warning 98 | `PASSWORD_USER` and either `PASSWORD_RAW` or `PASSWORD_HASH` is mandatory to specify. 99 | ::: 100 | 101 | {/* :::info 102 | Support for LDAP, OAuth, and other authentication methods is planned. 103 | ::: 104 | 105 | support Basic Auth */} 106 | 107 | ### Access 108 | 109 | #### Via UI 110 | 111 | When accessing the dir-browser, your browser will prompt you to enter a username and password. 112 | 113 | #### GET request 114 | 115 | Specify the `username:password` pair base64 encoded in the `Authorization` header. 116 | 117 | For example if the username is `admin` and the password is `foobar` then Base64 encode `admin:foobar` to `YWRtaW46Zm9vYmFy`. 118 | 119 | ``` 120 | curl https://dir-demo.adriansoftware.de/examples/burger.jpg -H "Authorization: Basic YWRtaW46Zm9vYmFy" 121 | ``` 122 | 123 | #### POST request 124 | 125 | Or as part of a POST request 126 | 127 | ``` 128 | curl -X POST https://dir-demo.adriansoftware.de/examples/burger.jpg -H "Authorization: Basic YWRtaW46Zm9vYmFy" 129 | ``` 130 | -------------------------------------------------------------------------------- /docs/docs/configuration/password1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/adrianschubek/dir-browser/012f608713e3dc9e14acc372a74a8547f8df1f0a/docs/docs/configuration/password1.png -------------------------------------------------------------------------------- /docs/docs/configuration/password3.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/adrianschubek/dir-browser/012f608713e3dc9e14acc372a74a8547f8df1f0a/docs/docs/configuration/password3.png -------------------------------------------------------------------------------- /docs/docs/configuration/prefetch.mdx: -------------------------------------------------------------------------------- 1 | # Prefetching on Hover 2 | 3 | By default, hovering over a folder link in the filetree will prefetch the contents of the folder. This can be disabled by setting the `PREFETCH_FOLDERS` environment variable to `false`. 4 | Prefetching of files is disabled by default because it downloads the file in the background and may increase the counter inadvertently. This can be enabled again by setting the `PREFETCH_FILES` environment variable to `true`. 5 | 6 | import EnvConfig from '@site/src/components/EnvConfig'; 7 | 8 | -------------------------------------------------------------------------------- /docs/docs/configuration/readme.md: -------------------------------------------------------------------------------- 1 | --- 2 | sidebar_position: 4 3 | slug: readme 4 | --- 5 | # Readme Rendering 6 | 7 | If there is a `readme.md` (case insensitive) (can be configured) file in the current directory, it will be rendered. GitHub flavored markdown is supported. See [Demo Page](https://dir-demo.adriansoftware.de/examples/). 8 | 9 | ### `.dbmeta.md` file 10 | You can specify a `.dbmeta.md` file in a directory to render it while also hiding it from the file tree, API and downloads at the same time. A `.dbmeta.md` file will override a existing `readme.md` file. See [Demo](https://dir-demo.adriansoftware.de/examples/markdown/). 11 | 12 | :::info 13 | By default unsafe HTML inside markdown (such as `