Skip to content
anderixPublic

About

A view-only directory browser that hands files to the Axe viewer to render.

Resources

Contributing

Security policy

Stars

0 stars

Watchers

0 watching

Forks

Latest commit

 

History

7 Commits

Folders and files

Repository files navigation

browse

A view-only directory browser for the web. It lists a folder, lets you walk into subfolders, and hands each file to the Axe viewer to render — so a .csv, .md, or .ics opens on-brand instead of downloading. It is the file-browser half of the pair: Axe is deployed for its styles and document viewers, and browse adds the server-side directory lister only where one is wanted.

browse is a single static page plus one small PHP endpoint. No build step, no framework, no dependency beyond a sibling Axe deployment for styling and file rendering.

How it works

index.html renders the listing and navigation entirely in the browser. list.php is the only server-side piece: it returns a directory's contents as JSON. Folders navigate in place via the URL hash; files link out to the Axe viewer at /axe/view/?url=…, which does the actual rendering. browse never renders document content itself, so it carries no document-parsing attack surface — that lives in Axe, behind Axe's sanitizer.

config.php   The one file you edit: the allowlist of folders browse may display.
index.html   The browser UI: listing, breadcrumbs, folder navigation, file hand-off.
list.php     Directory listing backend (returns JSON, requires PHP).

browse ships no content of its own. You list the folders it may display, and it shows those.

Configuring

Everything you set lives in config.php — a single list of the folder paths, relative to the web root, that browse is allowed to display:

return [
    'files',
    'reports/2026',
];

That list is the access-control policy. A request for any folder not in the list — or not inside one of them — is rejected by the backend. List one folder and browse opens straight into it; list several and browse shows them as a chooser. Leave the list empty to disable browsing.

browse never lists its own tool directory, regardless of what config.php says — list.php refuses any request that resolves to where it is deployed. So you can sit browse at /browse, allow /files, and the tool's own index.html/list.php/config.php can never be enumerated.

Deploying

Drop the directory onto a PHP host, serve it, and edit config.php. browse expects Axe to be deployed at the site root as /axe/ (the usual convention); that is where it sends files to be rendered and where it pulls its stylesheet. If your Axe lives elsewhere, change the VIEWER constant in index.html and the <link> hrefs in the head.

Read SECURITY.md before adding folders to config.php — it is an unauthenticated directory lister, and that allowlist is the only thing keeping it from enumerating the rest of your site.

License

MIT. See LICENSE.

About

A view-only directory browser that hands files to the Axe viewer to render.

Resources

Contributing

Security policy

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Used by

Contributors

Languages