• This repository has been archived on 22/Oct/2021
  • Stars
    star
    178
  • Rank 214,207 (Top 5 %)
  • Language
    JavaScript
  • License
    MIT License
  • Created over 9 years ago
  • Updated over 6 years ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

Explore and share. Highly-configurable directory listing made with nodejs.

Logo Explorer Build Status

Explore and share. Highly-configurable directory listing made with nodejs.

Screenshot

Requirements

  • nodejs (v4 with harmony support)

0.12 and iojs are no longer supported as of v3.0.0

Installing nodejs with nvm

curl -o- https://raw.githubusercontent.com/creationix/nvm/v0.25.4/install.sh | bash
nvm install 4 #nvm ls-remote to see available versions
nvm alias default 4
nvm use default

Install

npm install pm2 -g
pm2 install xplorer

Go to IP:4859, login with admin:admin Don't forget to change the password.

With pm2 configuration file is located in ~/.config/explorer

You may want to create your own HTTPS certs or disable it (see below).

More installation methods

Configuration

---
search:
  # Available: pt, ack, find, mdfind, custom, native
  method: 'native'
  # Custom search command (${search} will be replaced by the string)
  command: "pt --nocolor --nogroup -l -i '${search}' ." # not used by native
  maxDepth: 10 # Default 10
  concurrency: 100 # Default 100 (only used with native search)
  # String match score (only used with native search)
  maxScore: 0.65
pagination:
  # Maximum number of items per page
  limit: 10 # Default 100
# Be careful with this next section as it will have an impact on performances
tree:
  # When calculating directory size we stop at the max_depth
  maxDepth: 10 #Default 10
  concurrency: 100 #Default 100
  cache: true # set to false to disable size caching
  cacheTTL: 86400 # dir size cache duration in second
remove:
  # 'mv' will move files to a trash directory
  # 'rm' will delete files
  # empty to disable deletion
  method: 'mv' # default is to mv (move instead of remove)
  path: './trash'
# disable with:
# archive: false
archive:
  path: './tmp'
# disable with:
# upload: false
upload:
  path: './upload'
  concurrency: 10
  maxSize: '50mb' # default to 50mb see https://github.com/expressjs/body-parser#limit
  maxCount: 10 # max number of files
# note that path values will be overridden by the user path if set
# path will be created if non-existant
database: './data/users' # don't touch if you don't know what you're doing
app_root: '/' # app root for client ressources
session_secret: 'Some string here' #Change this
port: 4859
https:
  port: 6859
  enabled: true # default option!
  key: './certs/key.pem' # change those are dummies
  cert: './certs/cert.pem'
plugins: # those are enable by default, use below options to disable them
  upload: {}
  archive: {}
cache: 'memory' # redis is available too
redis:
  host: 'redis://127.0.0.1:6379'
  # host: 'somesocket.sock'
dev: false # more verbose error (stack)
auth: false # disable auth
user: admin # user to use without auth

The config.yml will be searched in:

  • ~/.config/explorer/config.yml
  • ./config/explorer/config.yml (relative to the script directory!)

To reload the configuration you'll need to restart the script pm2 restart xplorer!

See also: minimal, dev

Search

Search accepts globs and filters:

somefile -exact # should match exactly, alias -e
somedir -e -dir # exact and a directory, -d or -directory
* -video # every video files
-audio # every audio files
* -video --no-recursive # search in the current path only
--directory --atime=1h # directory accessed in the last hour
*.js --mtime=>2015-10-13 --mtime=<2015-10-14 # get all javascript files modified between dates

HTTP(S)

Nginx

upstream explorer {
  server localhost:4859 #port can be changed in the config.yml
}

server {
  listen 80;

  location / { #if you want to change this, change `app_root` in the config.yml
    proxy_pass http://explorer/
  }
}

Apache

<VirtualHost *:80>
    ServerAdmin [email protected]
    ServerName explorer.com

    ProxyRequests off

    <Proxy *>
        Order deny,allow
        Allow from all
    </Proxy>

    <Location />
        ProxyPass http://localhost:4859/
        ProxyPassReverse http://localhost:4859/
    </Location>
</VirtualHost>

Certs

You can either change the paths in the config.yml, or replace those located in your configuration path (see Configuration).

Rss

By calling your tree url or a search path (localhost:4859/search?search=*.mkv&key=my-key), set the Accept header to application/rss+xml:

http GET localhost:4859/?key=get-your-key-from-settings Accept:application/rss+xml

Update

From 1.x to 2.x see configuration migration.

As a pm2 module

pm2 install xplorer

From tarball

cd /path/to/your/explorer
curl -L https://github.com/soyuka/explorer/archive/vx.x.x.tar.gz | tar xz --strip-components 1
npm rebuild

More installation methods

Docker

git clone https://github.com/soyuka/explorer.git
cd explorer
docker build -t explorer .
# you have to mount the configuration to /opt/explorer (see EXPLORER_CONFIG env)
docker run -p 8080:4859 -d -v $(pwd)/doc/examples:/opt/explorer --name explorer explorer

Use a mounted volume with data by changing your home in the Explorer admin panel. Here we forward 8080 to 4859, where 4859 is the default http port.

Tarball package

Download latest release, unpack, configure, launch :

cp doc/examples/config.yml config.yml #copy default configuration
cp -r doc/examples/data data #copy default database
cp -r doc/examples/certs certs #copy default certificates for https
npm rebuild

Git

git clone https://github.com/soyuka/explorer.git
cd explorer
cp doc/examples/config.yml config.yml #copy default configuration
cp -r doc/examples/data data #copy default database
cp -r doc/examples/certs certs #copy default certificates for https
npm install #install packages

Then run gulp to compile minified resources

npm install gulp bower -g
bower install
gulp

Beta/master installation

After using the default method (i.e. pm2 install xplorer):

cd ~/.pm2/node_modules
npm install gulp bower -g
npm install git://github.com/soyuka/explorer
cd xplorer
bower install
gulp
pm2 restart xplorer

Run

Installed as a pm2 module explorer will already be daemonized.

Development

DEBUG="explorer:*" node --harmony index.js

Daemonize with pm2

npm i pm2 -g
pm2 start --node-args="--harmony" --name explorer index.js

Plugins

Install a plugin:

explorer plugin install [plugin-name]

See explorer --help for more commands.

Configure

In the config.yml:

plugins:
  name:
    module: 'npm-package-name'
  local-name: {} # located in path/to/explorer/plugins/local-name

Available plugins:

plugins:
  unrar:
    module: 'explorer-unrar'
plugins:
  cksfv
    module: 'explorer-cksfv'
plugins:
  unrar:
    module: 'explorer-m3u'

Development

See plugins documentation

Development

Clone see From git

DEBUG="explorer:*" node --harmony index.js -c config.example.dev.yml

Sass is compiled with gulp:

gulp watch

To get stack traces from errors use dev: true in your configuration file.

Tests

Tests are using their own configuration file test/fixtures/config.yml:

mocha --harmony

Api docs

Generated with apidocjs (available here):

apidoc -i routes -o doc/api

Performances

We use Bluebird with concurrency, for your information you may speed things up:

$ sync && echo 3 > /proc/sys/vm/drop_caches
$ node test.js 1
reading files 35ms
$ sync && echo 3 > /proc/sys/vm/drop_caches
$ node test.js Infinity
reading files: 9ms

See bluebird docs, tree.concurrency and search.concurrency configuration options.

In the configuration there is a tree.maxDepth parameter. It's used when estimating the size of a directory, we'll stop recursivity when depth is more than 10. 10 is a lot actually, to improve performances you should lower the number. To get a more precise number increase it.

The search.maxDepth indicates wether to search in the directory or not if it's too deep. Search will go faster but you'll get less results.

Why?

I did this because I could not find a light file explorer. It had to be simple, easy to install and fast. I tried pydio but it's heavy and long to install. I also tried h5ai but it does not have user support and has a lot of client-side javascript. I also have the feeling that it's slow.

KISS.

More Repositories

1

pidusage

Cross-platform process cpu % and memory usage of a PID
JavaScript
507
star
2

dpicker

A framework-agnostic minimal date picker
JavaScript
185
star
3

esql

PHP Extended SQL
PHP
91
star
4

tmux-current-pane-hostname

Tmux plugin that enables displaying hostname and user of the current pane in your status bar.
Shell
70
star
5

fclone

Clone objects by dropping circular references
JavaScript
62
star
6

pm2-notify

SMTP PM2 notifier
JavaScript
60
star
7

relieve

Ease the implementation of multi processing accross your microservices
JavaScript
47
star
8

signalhubws

Signalhub implementation with websockets
JavaScript
41
star
9

node-rpi-monit

Light nodejs raspberry pi monitor (cpu, mem, temp, network etc)
JavaScript
37
star
10

rxrest

Reactive rest library
JavaScript
33
star
11

dat-daemon

Dat as a daemon
JavaScript
24
star
12

dotfiles

Dotfiles
Vim Script
19
star
13

pidusage-tree

Pidusage tree
JavaScript
18
star
14

IPCEE

IPC combined with EventEmitter
JavaScript
15
star
15

leverage-the-power-of-symfony-components-within-apiplatform

leverage-the-power-of-symfony-components-within-apiplatform
HTML
14
star
16

native-messaging-swarm

TCP/UDP swarm on top of WebExtension's native messaging protocol
JavaScript
13
star
17

promise-spawner

Lazy nodejs spawner with stdout/stderr streams and error handling through promises
JavaScript
12
star
18

caligo

Scalable URL obfuscator service
Go
11
star
19

jhaml

Stream based javascript implementation of Haml templating engine
JavaScript
10
star
20

symfony-messenger-redis

Redis adapter for symfony/messenger
PHP
10
star
21

api-platform-talk-beyond-rest-demo

The project behind my talk about "Api Platform beyond REST"
PHP
8
star
22

pmu

PHP Monorepo Utility
PHP
8
star
23

noel

Christmas thing
JavaScript
7
star
24

gulp-sym

Gulp symlink module
JavaScript
6
star
25

SeedBundle

Seed helper through symfony commands
PHP
5
star
26

nodejs-http-memtest

Memory graphs on a few http servers with nodejs
Shell
5
star
27

browser.runtime

nodejs bridge to support browser.runtime api
JavaScript
5
star
28

renice

Change cpu process priority
JavaScript
5
star
29

micro-virtual-list

Micro virtual list
JavaScript
5
star
30

EzSeed

Easy seedbox to share with your friends or your family !
PHP
5
star
31

vagrant-tutoriel-nginx-php-nodejs

Tutoriel vagrant php/nginx/nodejs
Ruby
5
star
32

learn-rxjs

todo
TypeScript
4
star
33

snake

🐍snake built with πŸš‚ choojs
JavaScript
4
star
34

esa

Edge side APIs for front-end developpers
HTML
4
star
35

audiocogs

Fork from audiocogs - DGPlayer which reads MP3 and FLAC - with playlist integration
JavaScript
4
star
36

incolore

Image hoster
Go
3
star
37

cma

Cli mail
JavaScript
3
star
38

supervisordstat

Run pidstat over supervisord processes.
Go
3
star
39

maree-bass-arcade

MarΓ©e bass arcade
SCSS
3
star
40

choo-redux

Choo redux bridge
JavaScript
3
star
41

cqrs-api-platform

Attempt at making api platform cqrs compliant (WIP)
PHP
3
star
42

sse-livereload

Experimental livereload server that uses browserify to build and server side events to reload the page automatically.
JavaScript
3
star
43

thoughts-for-paris

Some thoughts for paris - Nov 13 2015
JavaScript
3
star
44

api-platform-laravel

shhh
PHP
3
star
45

serializer-bench

PHP
3
star
46

ssestream

ServerSide event stream
JavaScript
2
star
47

gulp-xliff-to-json

Gulp xliff to json
JavaScript
2
star
48

api-platform-alice-sf5

PHP
2
star
49

ansi-rainbow

Rainbowify string with https://github.com/sindresorhus/ansi-styles
JavaScript
2
star
50

laravel-api-platform

PHP
2
star
51

api-platform-by-examples

PHP
2
star
52

native-installer

Cross-browser native messaging installer for webextensions
JavaScript
2
star
53

dotfiles-backup

My dot files
Vim Script
2
star
54

example-apiplatform-cqrs

PHP
2
star
55

pidusage-promise

Pidusage as a promise
JavaScript
1
star
56

TCPEE

TCP version of IPCEE
JavaScript
1
star
57

rockexplorer

Rust
1
star
58

tmdb

TheMovieDB nodejs API wrapper
JavaScript
1
star
59

relieve-failsafe

Relieve through tcp
JavaScript
1
star
60

explorer-m3u

M3u generation plugin for explorer
JavaScript
1
star
61

mdtobbcode

Markdown To BBCode
JavaScript
1
star
62

cronrs

Rust
1
star
63

lerna-babel-browserify-bootstrap

JavaScript
1
star
64

explorer-unrar

Explorer unrar plugin
JavaScript
1
star
65

first-existing-path

First existing path from an array
JavaScript
1
star
66

bootstrap-react-browserify

Bootstrap for react + browserify
HTML
1
star
67

api-platform-blackfire-sandbox

Sandbox for blackfire profiling with API Platform
TypeScript
1
star
68

nextjs-mdx-highlight

MDX
1
star
69

mapper

PHP object to object mapper
PHP
1
star
70

cours-http-pokemon

JavaScript
1
star
71

pong-mercure

test
JavaScript
1
star
72

tamagotchi

JavaScript
1
star
73

automapper

PHP
1
star
74

playground

test
JavaScript
1
star
75

php-wasm-example

PHP
1
star
76

repro6340

PHP
1
star
77

angular-testing

Todo app without tests to exercise (correction in the test branch)
TypeScript
1
star
78

empreinte-digitale-messenger

PHP
1
star
79

laravel

PHP
1
star
80

nextjs-mdx-standalone-memory

reproducer https://github.com/vercel/next.js/issues/57613
MDX
1
star
81

self-referencing-metadata-api-platform

Attempt to reproduce #3344 #3349 #3343 api-platform/core
PHP
1
star
82

shared-mem-wasm

C
1
star
83

formation-contrib

TypeScript
1
star
84

tamagotchi-1

JavaScript
1
star
85

api-platform-doctrine-mapper

PHP
1
star
86

symfony-tag-removal-repro

PHP
1
star
87

docs-website

Documentation website
1
star
88

state

API Platform State component
1
star
89

cours-http-pokedex

JavaScript
1
star
90

vulcain-caddy

Go
1
star
91

validator

API Platform validator component
1
star
92

my-api

TypeScript
1
star
93

my-test-api

TypeScript
1
star
94

secret-santa

Secret santa symfony command
PHP
1
star
95

api-platform-2316

see issue 2316
PHP
1
star
96

learn-ngrx

todo
TypeScript
1
star
97

mercure-php

Experimental php mercure draft implementation
PHP
1
star
98

chatbot

PHP
1
star
99

spotify-static-playlists

Generate a web page with your spotify playlists.
JavaScript
1
star
100

markdown-to-bbcode

Properly formatted markdown to bbcode. The core tags like b,i,h2,h3,code,img,url
HTML
1
star