An index page generator written using Mojolicious that supports permissioned file uploading, renaming, and deletion.
Go to file
Sam Greytalon 3867f4543a Make sure to actually check code returned from user_can_... before moving on! 2024-01-15 16:15:16 -08:00
app Make sure to actually check code returned from user_can_... before moving on! 2024-01-15 16:15:16 -08:00
examples/openbsd/etc Update OpenBSD config example. 2023-10-27 10:32:53 -07:00
LICENSE Initial commit. 2023-08-01 08:13:20 -07:00 Decode names received from the filesystem. 2023-11-16 10:27:38 -08:00


Dexter is a Mojolicious webapp that handles the generation of index pages under a directory and provides a method for authenticated users to upload files, delete files, create directories, and move files.


Dexter depends on these Perl modules:

  • Cwd
  • Encode
  • Readonly
  • File::Path
  • File::Spec
  • File::Find
  • File::Copy
  • Mojolicious::Lite
  • Module::Installed::Tiny

Install them using cpan or however else you get your Perl modules.

Once the proper modules are installed, clone this repository to wherever you want Dexter to reside. For me on my OpenBSD web server, that's /var/www/cgi-bin/.

After that, Dexter can be ran under any web server as a CGI or PSGI app, or via Mojolicious' builtin morbo and hypnotoad servers. See examples/openbsd/etc/ for the configuration files that I use on my OpenBSD web server to connect Dexter with httpd.


Configuration is done by modifying the constant variables in


Dexter expects authentication to be done on the web server, and relies on the REMOTE_USER environment variable to determine which user is using the app and what their permissions are. If a user is not authenticated, Dexter assumes their username to be 'guest'.

Dexter determines authorization by applying the first match approach to a list of regex/number pairs (rules) stored under the authenticated user's username in the %USER_ACCESS_RULES hash defined in When determining whether a user has the appropriate permissions to perform an action on a given path, Dexter iterates through the rules under a user's name until a regex matches the path. Dexter then performs a binary and of the corresponding permission number and the permission number required for the requested action. If the resulting number equals the number required for the requested action, the action is permitted.

If no rule matches, the requested action is denied.


Dexter needs to know about two directories you want it to use:

  • $ROOT_DIRECTORY: The directory that Dexter will be serving files from and saving uploaded files to. This is effectively the root directory of the website, and needs to be configured on the web server as well.
  • $SOCKET_DIRECTORY: The directory where Dexter's UNIX domain socket will be. This is only required if Dexter is running on OpenBSD, as Dexter needs to unveil the socket directory in order to be run as a PSGI daemon.


  • $MAX_REQUEST_SIZE: The maximum size of POST requests that Dexter will process.
  • $FS_ENCODING: The character encoding that the underlying filesystem uses to store filenames. The default value of UTF-8 is most likely correct.


Dexter is released under Version 3 of the GNU Affero General Public License (see LICENSE). The default font- JetBrainsMono from NerdFonts- is released under Version 1.1 of the SIL Open Font License (see app/public/.assets/FONT-LICENSE).