There are two components to this: a JavaScript/Angular client and a Nodejs server. The JavaScript/Angular client was inspired by kstep/nginx-autoindex-js project, but has been heavily hacked. The server responds to directory requests with a JSON encoded list of files and directories.
The client will display the root of the content directory as large, international-friendly icons. To do this, the top-level directories need to belong to the following group:
- food
- government
- maps
- medical
- music
- power
- video
- water
- wifi
- written
The contents of these directories can then be the usual mix of files and directories. After choosing one of the top-level icons, the client will hide the large icons and display the child files and directories. Certain files with certain extensions will be shown with icons that help denote the file's nature.
-
Download and install Node.js and NPM on target system.
-
Install this package somewhere
-
Edit
config/default.config
. SetcontentBase
to the base, file system location of the content to be served. ConfigcontentRoute
is the URL path at which content is served. The client will also usecontentRoute
to request content files and directory listings. Choose a differentport
if you don't want the server to listen on port 80.{ "Content":{ "contentBase":"/var/connectbox/content", "contentRoute":"/content" }, "Server":{ "port":80 }, "Client":{ "tail_slash":false } }
-
Navigate to the
server
directory and get dependencies$ npm install
This will install the dependencies listed in
package.json
-
All that is left is to run
file_server.js
with Node. Since the server is, by default, listening to port 80, root priviledges will be needed to execute the server.$ sudo NODE_CONFIG_DIR="../config/" node file_server.js
The
NODE_CONFIG_DIR
env variable sets the directory with the configuration files. If you want to enable debug logging, set the DEBUG env variable$ sudo DEBUG="connectbox" NODE_CONFIG_DIR="../config/" node file_server.js
-
Request the client by navigating to the web root of the server. The client and all support files will download.