Lavoco::Web::Editor - FastCGI app to edit flat-files.
Version 0.07
This application was originally designed to aid in the editing of basic templates for a Lavoco::Web::App project.
use Lavoco::Web::Editor; my $editor = Lavoco::Web::Editor->new; my $action = lc( $ARGV[0] ); # (start|stop|restart) $editor->$action;
Creates a new instance of the editor object.
Number of FastCGI process to spawn, 5 by default.
Filename for the config file, default is editor.json and only JSON is currently supported.
editor.json
The loaded config as a hash-reference.
Starts the FastCGI daemon. Performs basic checks of your environment and config, dies if there's a problem.
Stops the FastCGI daemon.
Restarts the FastCGI daemon, with a 1 second delay between stopping and starting.
The editor app should be a simple Perl script in a folder with the following structure:
editor.pl # see the synopsis editor.json # config, see below editor.pid # generated, to control the process editor.sock # generated, to accept incoming FastCGI connections logs/
The config file is read for each and every request, so you can reasonably enable editing of the editors own config file.
See the examples directory for a sample JSON config file, similar to the following...
examples
{ "files" : [ "app.json", "site/style.css" ], "folders" : [ "templates/content/organic", "templates/content/store" ], "uploads" : [ "site/images" ], "password" : "foo", "salt" : "abc123" }
Three fields which drive the editor are files, folders and uploads, each of which is an array of paths, all relative to the base directory of the editor script.
files
folders
uploads
Files in the files list are editable, but the editor can not create new files in their respective containing directories.
All visible files in the folders are editable, but not sub-directories, you need to add those separately. The editor can also create new files in each folder.
The editor can upload files into any of the uploads folders.
If there is a defined password in the config, then this will be requested before a user can access the index page (listing all files that can be edited).
password
When using a password, a salt is also required, just create a random string, it's simply concatenated to the password before SHA-hashing and setting as a cookie.
salt
Allow absolute paths to any part of the filesystem?
Rob Brown, <rob at intelcompute.com>
<rob at intelcompute.com>
Copyright 2015 Rob Brown.
This program is free software; you can redistribute it and/or modify it under the terms of either: the GNU General Public License as published by the Free Software Foundation; or the Artistic License.
See http://dev.perl.org/licenses/ for more information.
To install Lavoco::Web::Editor, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Lavoco::Web::Editor
CPAN shell
perl -MCPAN -e shell install Lavoco::Web::Editor
For more information on module installation, please visit the detailed CPAN module installation guide.