Skip to content
davidmoreno edited this page Jul 4, 2011 · 3 revisions

onion fileserver

There are several versions of fileservers located at onion examples. basic is the simplest of them and with just 15 lines of code it sports SSL, PAM authentication and directory export. Then there is fileserver, which uses the internal file browser with custom headers and footer, and also allows to upload files. Finally, there is fileserver_otemplate, which uses a custom fileserver and which has otemplate templating, allowing the user to personalize it.

All these examples are located at the examples subdirectory on the source distribution.

basic

Basic is a simple example of how to use builtin handlers. It uses PAM handler to perform authentication with the default PAM rule "login" and then exports the current directory. Easy and straight. SSL is enabled. TheFor the desired directory key and cert should be located at the current directory. Basic is a fast example of a fileserver that can be very easily customized and/or used.

fileserver

More complete fileserver that uses internal directory export facilities. It has a custom footer, which adds a file upload field to the webpage. Also, it uses a handler to envelope the directory view, it captures the POSTS and uploads the files.

It also has PAM and SSL, but both can be easily desactivated with command line parameters.

fileserver_otemplate

Implements a fileserver using otemplate and custom methods; it uses no builtin handle. It creates a dictionary with files and data for the desired directory which is then rendered using an html template.

It has neither SSL nor PAM, but it should not be difficult to add.

Clone this wiki locally