https://github.com/gh0stwizard/perl-pastebin-daemon
Standalone HTTP pastebin service writen in Perl
https://github.com/gh0stwizard/perl-pastebin-daemon
Last synced: 3 months ago
JSON representation
Standalone HTTP pastebin service writen in Perl
- Host: GitHub
- URL: https://github.com/gh0stwizard/perl-pastebin-daemon
- Owner: gh0stwizard
- License: artistic-2.0
- Created: 2015-01-15T15:37:05.000Z (over 10 years ago)
- Default Branch: master
- Last Pushed: 2015-02-03T23:18:34.000Z (over 10 years ago)
- Last Synced: 2025-01-01T11:27:19.287Z (5 months ago)
- Language: Perl
- Size: 457 KB
- Stars: 0
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# ppb
Standalone HTTP pastebin daemon written in [Perl](http://www.perl.org).
# Why?
Just for fun. The possible usecases:
* Personal usage
* Internal usage inside a company# Dependencies
This software requires next modules and libraries installed
via CPAN or other Perl package management system:* EV
* AnyEvent
* Feersum
* HTTP::Body
* HTML::Entities
* JSON::XS
* File::Spec
* Getopt::Long
* Math::BigInt
* UnQLite
* MIME::Type::FileName
* Sys::Syslog (optional)# Usage
The program is splitted in three major parts:
* starter:
main.pl
* backend:backend/feersum.pl
* application:app/feersum.pl
To start the program type in console:
```
shell> perl src/main.pl
```By default the server is listening on the address
127.0.0.1:28950
.
To run the listener on all interfaces and addresses you have to run
the server as described below:```
shell> perl src/main.pl --listen 0.0.0.0:28950
```# Options
Use the option **--help** to see all available options:
```
shell> perl src/main.pl --help
Allowed options:
--help [-h] prints this information
--version prints program version
--listen [-l] arg IP:PORT for listener
- default: "127.0.0.1:28950"
--backend [-b] arg backend name (default: feersum)
--app [-a] arg application name (default: feersum)
--background [-B] run process in background
- default: run in foreground (disables logging)
- hint: use --logfile / --enable-syslog for logging
--home [-H] arg working directory after fork
- default: root directory
--www-dir [-W] arg www directory with index.html
--debug be verbose
--verbose be very verbose
--quiet [-q] be silence, disables logging
--enable-syslog enable logging via syslog (default: disabled)
--syslog-facility arg syslog's facility (default: LOG_DAEMON)
--logfile [-L] arg path to log file (default: stdout)
--pidfile [-P] arg path to pid file (default: none)
```# Usage with nginx
The server is able to work together with [nginx](http://nginx.org).
The sample configuration file for nginx is placed inconf/nginx/ppb.conf
.Using ppb together with nginx is a good idea, because nginx is intended
to cache static files.# Development & Customization
The starter script
main.pl
was made to be independent
on a backend code, as possible at least.
To create your own backend you have to create a file in backend's directory.
For instance, for Twiggy, you may create filesrc/backend/twiggy.pl
.
Then run the server in this way:```
shell> perl src/main.pl --backend=twiggy
```Note that the extention of the file was ommitted, as well as full path to
file.