Доброго всем
¡ ¡ ¡ ALL GLORY TO GLORIA ! ! !
Mojolicious::Plugin::StaticShare - browse, upload, copy, move, delete static files and dirs.
0.055
# Mojolicious $self->plugin('StaticShare', <options>); # Mojolicious::Lite plugin 'StaticShare', <options>; # oneliner $ perl -MMojolicious::Lite -E 'plugin("StaticShare", root_url=>"/my/share",)->secrets([rand])->start' daemon
This plugin for share static files/dirs and has public and admin functionality:
Can browse and upload files if name not exists.
Can copy, move, delete files/dirs.
Append param admin=<admin_pass> option to any url inside root_url requests (see below).
admin=<admin_pass> option
Absolute or relative file system path root directory. Defaults to '.'.
root_dir => '/mnt/usb', root_dir => 'foo',
This prefix to url path. Defaults to '/'.
root_url => '/', # mean route '/*pth' root_url => '', # mean also route '/*pth' root_url => '/my/share', # mean route '/my/share/*pth'
See Mojolicious::Guides::Routing#Wildcard-placeholders.
Admin password (be sure https) for admin tasks. None defaults.
admin_pass => '$%^!!9nes--', #
Signin to admin interface https://myhost/my/share/foo/bar?admin=$%^!!9nes--
https://myhost/my/share/foo/bar?admin=$%^!!9nes--
Template path, format, handler, etc which render directory index. Defaults to builtin things.
render_dir => 'foo/dir_index', render_dir => {template => 'foo/my_directory_index', foo=>...}, # Disable directory index rendering render_dir => 0,
pth, url_path, file_path, language, dirs, files, index
pth
url_path
file_path
language
dirs
files
index
Path of request exept root_url option, as Mojo::Path object.
root_url
Path of request with root_url option, as Mojo::Path object.
Req header AcceptLanguage as HTTP::AcceptLanguage object.
List of scalars dirnames. Not sorted.
List of hashrefs (name, size, mtime keys) files. Not sorted.
name, size, mtime
Filename for markdown or pod rendering in page below dirs and files.
Same as render_dir but for markdown files. Defaults to builtin things.
render_markdown => 'foo/markdown', render_markdown => {template => 'foo/markdown', foo=>...}, # Disable markdown rendering render_markdown => 0,
Module name for render markdown. Must contains sub markdown($str) or method parse($str). Defaults to Text::Markdown::Hoedown.
markdown($str)
parse($str)
markdown_pkg => 'Foo::Markup';
Does not need to install if render_markdown => 0 or never render md files.
render_markdown => 0
Template path, format, handler, etc which render pod files. Defaults to builtin things.
render_pod=>'foo/pod', render_pod => {template => 'foo/pod', layout=>'pod', foo=>...}, # Disable pod rendering render_pod => 0,
Arrayref to match files to include to directory index page. Defaults to [qw(README.md INDEX.md README.pod INDEX.pod)].
[qw(README.md INDEX.md README.pod INDEX.pod)]
dir_index => [qw(DIR.md)], dir_index => 0, # disable include markdown to index dir page
Boolean to disable/enable uploads for public users. Defaults to undef (disable).
public_uploads=>1, # enable
Everywhere and everything: module, files, content.
It was not tested but I hope you dont worry and have happy.
You can place classnames and css-style rules to markup elements as below.
In markdown:
# {.class1 .class2 padding: 0 0.5rem;} Header 1 {.brown-text} brown paragraph text ...
In pod:
=head2 {.class1 .blue-text border-bottom: 1px dotted;} Header 2 {.red-text} red color text...
Mojolicious::Plugin::StaticShare inherits all methods from Mojolicious::Plugin and implements the following new ones.
$plugin->register(Mojolicious->new);
Register plugin in Mojolicious application.
Mojolicious::Plugin::Directory
Mojolicious, Mojolicious::Guides, http://mojolicious.org.
Михаил Че (Mikhail Che), <mche[-at-]cpan.org>
<mche[-at-]cpan.org>
Please report any bugs or feature requests at https://github.com/mche/Mojolicious-Plugin-StaticShare/issues. Pull requests also welcome.
Copyright 2017 Mikhail Che.
This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself.
To install Mojolicious::Plugin::StaticShare, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Mojolicious::Plugin::StaticShare
CPAN shell
perl -MCPAN -e shell install Mojolicious::Plugin::StaticShare
For more information on module installation, please visit the detailed CPAN module installation guide.