MCPSERV.CLUB
Directory Lister

Directory Lister

Self-Hosted

Browse and share web folders with zero configuration

Active(100)
2.4kstars
0views
Updated 11 days ago
Directory Lister screenshot

Overview

Discover what makes Directory Lister powerful

Directory Lister is a lightweight, PHP‑based web application that turns any web‑accessible folder into an interactive file browser. From a developer’s standpoint, the core value lies in its zero‑configuration deployment model: once the PHP files are copied to a web server, the application automatically discovers and serves the directory tree rooted at the configured base path. The interface is rendered on the fly using a minimal templating layer, and the backend logic is exposed through a small set of HTTP endpoints that support sorting, searching, hashing, and ZIP archiving. Because the application is written in pure PHP 8.2+, it can run on virtually any LAMP, LEMP, or serverless environment that supports the required extensions (Zip, DOM, Fileinfo).

Language & Runtime

Web Layer

Templating

Data Storage

Overview

Directory Lister is a lightweight, PHP‑based web application that turns any web‑accessible folder into an interactive file browser. From a developer’s standpoint, the core value lies in its zero‑configuration deployment model: once the PHP files are copied to a web server, the application automatically discovers and serves the directory tree rooted at the configured base path. The interface is rendered on the fly using a minimal templating layer, and the backend logic is exposed through a small set of HTTP endpoints that support sorting, searching, hashing, and ZIP archiving. Because the application is written in pure PHP 8.2+, it can run on virtually any LAMP, LEMP, or serverless environment that supports the required extensions (Zip, DOM, Fileinfo).

Architecture

  • Language & Runtime: PHP 8.2+ with the standard Zend engine; no external frameworks are required, keeping the footprint under 10 MB.
  • Web Layer: Apache/Nginx front‑end proxies requests to index.php, which dispatches based on query parameters (?path=...). Routing is handled by a simple switch statement, avoiding heavyweight routers.
  • Templating: A custom, component‑based view system uses PHP’s output buffering. CSS is bundled with two themes (light/dark) and a handful of icon assets.
  • Data Storage: No database is used; all state is derived from the file system. File metadata (size, MIME type, modification time) is cached in memory per request to reduce disk I/O.
  • Security: Path traversal protection is enforced by normalizing the requested path against the configured base directory. All file downloads are streamed to prevent memory exhaustion.

Core Capabilities

  • Dynamic File Listing: Recursively lists directories, with configurable sort orders (name, date, size) and pagination if needed.
  • Search API: /search?q=term returns JSON of matching files, enabling client‑side autocomplete or filtered views.
  • Hash Generation: hashes.json endpoint exposes SHA‑256 checksums for all files, useful for integrity verification.
  • ZIP Downloads: download.zip?path=... streams a ZIP archive of the requested directory using PHP’s ZipArchive, leveraging the required Zip extension.
  • README Rendering: If a README.md or similar is present, the app parses Markdown (via PHP’s DOM extension) and injects it into the page.
  • Localization: A simple language file loader supports over 20 locales, allowing developers to ship multilingual interfaces with minimal effort.

Deployment & Infrastructure

Directory Lister is intentionally container‑friendly. A Dockerfile is provided in the repository that builds a minimal PHP image with all extensions pre‑installed. The app scales horizontally by running multiple containers behind an HTTP load balancer; each instance is stateless, so any session data or configuration must be stored in shared storage (e.g., NFS, S3‑compatible object store). For serverless deployments, the PHP runtime can be wrapped in a Lambda or Cloudflare Worker that forwards requests to an underlying storage bucket.

Integration & Extensibility

The project exposes a small set of hooks: developers can register callbacks for events such as beforeRender, afterDownload, or onSearch. The hook system is built on PHP’s SplObserver pattern, making it straightforward to inject custom logic (e.g., logging, access control). Additionally, the app can be embedded into existing PHP frameworks by including its index.php as a sub‑module and overriding the base directory through environment variables. Webhooks are not natively supported, but the API endpoints can be consumed by external services to trigger CI/CD pipelines or analytics dashboards.

Developer Experience

  • Configuration: A single .env file controls the base path, theme, and locale. The environment parser is lightweight and supports comments.
  • Documentation: The official docs are concise, with a dedicated configuration guide and API reference. Inline comments in the source code aid comprehension.
  • Community & Support: The project has an active GitHub Discussions forum and a growing contributor base. Issues are triaged quickly, and pull requests are reviewed by the maintainer.
  • Licensing: Released under MIT, allowing unrestricted use in commercial or open‑source projects without copyleft constraints.

Use Cases

  1. Internal File Distribution – A dev‑ops team can expose build artifacts or logs without setting up S3 buckets.
  2. Static Site Hosting – Quickly share a folder of Markdown or HTML files for documentation portals.
  3. Multimedia Libraries – Serve photo or video collections with built‑in search and hash verification.
  4. Educational Resources – Teachers can host assignment files and README explanations for students.

Advantages

  • Zero‑Configuration: No database migrations or complex setup scripts.
  • Performance: Pure PHP with minimal memory usage; file metadata is cached per request, keeping latency low.
  • Flexibility: Stateless design and hook system allow integration into virtually any PHP stack.
  • Licensing Freedom: MIT license eliminates deployment barriers common with GPL‑licensed file managers.
  • Community Trust: Regular CI checks, active issue handling, and sponsorship support ensure long‑term maintenance.

In summary, Directory Lister offers a developer‑friendly, highly extensible solution for exposing file system contents over HTTP with minimal overhead, making it an attractive choice for projects that require quick, secure file browsing without the complexity of full‑blown CMS or cloud storage services.

Open SourceReady to get started?

Join the community and start self-hosting Directory Lister today

Weekly Views

Loading...
Support Us

Featured Project

$30/month

Get maximum visibility with featured placement and special badges

Repository Health

Loading health data...

Information

Category
other
License
MIT
Stars
2.4k
Technical Specs
Pricing
Open Source
Database
None
Supported OS
LinuxWindowsmacOSBSD
Author
DirectoryLister
DirectoryLister
Last Updated
11 days ago