2013-09-05 18:59:56 -07:00
|
|
|
fiche
|
|
|
|
|
=====
|
|
|
|
|
|
|
|
|
|
Command line pastebin for sharing terminal output.
|
2013-09-06 04:01:55 +02:00
|
|
|
|
|
|
|
|
## Installation ##
|
|
|
|
|
|
|
|
|
|
1. Clone into repository:
|
|
|
|
|
|
|
|
|
|
```
|
|
|
|
|
https://github.com/solusipse/fiche.git
|
|
|
|
|
```
|
|
|
|
|
|
|
|
|
|
2. Build program:
|
|
|
|
|
|
|
|
|
|
```
|
|
|
|
|
make
|
|
|
|
|
```
|
|
|
|
|
|
|
|
|
|
3. Install:
|
|
|
|
|
|
|
|
|
|
```
|
|
|
|
|
sudo make install
|
|
|
|
|
```
|
|
|
|
|
|
|
|
|
|
## Client-side usage ##
|
|
|
|
|
|
|
|
|
|
Self explanatory live examples:
|
|
|
|
|
|
|
|
|
|
```
|
|
|
|
|
ls -la | nc localhost 9999
|
|
|
|
|
```
|
|
|
|
|
|
|
|
|
|
```
|
|
|
|
|
cat file.txt | nc someserverrunningfiche.net 1234
|
|
|
|
|
```
|
|
|
|
|
|
|
|
|
|
```
|
|
|
|
|
echo just testing! | nc code.solusipse.net 9999
|
|
|
|
|
```
|
|
|
|
|
|
|
|
|
|
If you already haven't set up your server on localhost, try third line! My server is providing terminal
|
|
|
|
|
pastebin server powered by fiche - ```code.solusipse.net``` on port ```9999```.
|
|
|
|
|
|
|
|
|
|
- To upload text you need to have netcat installed (to check if netcat is installed, simply type ```nc``` in terminal).
|
|
|
|
|
|
|
|
|
|
## Server-side usage ##
|
|
|
|
|
|
|
|
|
|
```
|
|
|
|
|
usage: fiche [-bdpqs].
|
|
|
|
|
[-d host_domain.com] [-p port] [-s slug_size]
|
|
|
|
|
[-o output_directory] [-b buffer_size] [-q queue_size]
|
|
|
|
|
```
|
|
|
|
|
|
|
|
|
|
These are command line arguments. You don't have to provide any, but doing that is recommended. Without them, program
|
|
|
|
|
will use these default settings:
|
|
|
|
|
|
|
|
|
|
```C
|
|
|
|
|
domain = "http://localhost/";
|
|
|
|
|
basedir= "~/code/";
|
|
|
|
|
port = 9999;
|
|
|
|
|
slug_size = 4;
|
|
|
|
|
buffer_size = 8192;
|
|
|
|
|
queue_size = 100;
|
|
|
|
|
```
|
|
|
|
|
|
2013-09-09 01:15:55 +02:00
|
|
|
Examples:
|
|
|
|
|
|
|
|
|
|
```
|
|
|
|
|
fiche -d domain.com
|
|
|
|
|
```
|
|
|
|
|
|
|
|
|
|
```
|
|
|
|
|
fiche -s 6 -p 6666
|
|
|
|
|
```
|
|
|
|
|
|
2013-09-06 04:01:55 +02:00
|
|
|
### Basic arguments ###
|
|
|
|
|
|
|
|
|
|
Most important is providing **basedir** and **domain**.
|
|
|
|
|
|
|
|
|
|
Basedir should be **absolute** path to directory where you would like to store text files.
|
|
|
|
|
|
|
|
|
|
Domain should be provided in such format ```domain.com```.
|
|
|
|
|
|
2013-09-09 01:15:55 +02:00
|
|
|
Slug size: ```domain.com/SLUG_OF_CHOSEN_LENGTH/```.
|
2013-09-06 04:01:55 +02:00
|
|
|
|
|
|
|
|
### Parameters for advanced users ###
|
|
|
|
|
|
|
|
|
|
- Buffer size
|
|
|
|
|
- Queue size
|
|
|
|
|
|
2013-09-06 14:44:38 +02:00
|
|
|
## Running as service ##
|
2013-09-09 01:15:55 +02:00
|
|
|
e
|
2013-09-06 14:44:38 +02:00
|
|
|
You can run fiche as service, there is simple systemd example:
|
|
|
|
|
|
|
|
|
|
```
|
|
|
|
|
[Unit]
|
|
|
|
|
Description=FICHE-SERVER
|
|
|
|
|
|
|
|
|
|
[Service]
|
|
|
|
|
ExecStart=/usr/local/bin/fiche -d code.solusipse.net -o /home/www/code/
|
|
|
|
|
|
|
|
|
|
[Install]
|
|
|
|
|
WantedBy=multi-user.target
|
|
|
|
|
```
|
|
|
|
|
|
2013-09-09 01:15:55 +02:00
|
|
|
In service mode you have to set output directory with ```-d``` parameter, there's example:
|
|
|
|
|
|
|
|
|
|
```
|
|
|
|
|
fiche -o /home/www/code/
|
|
|
|
|
```
|
|
|
|
|
|
2013-09-06 04:20:35 +02:00
|
|
|
## Webserver ##
|
|
|
|
|
|
|
|
|
|
To make files available for users, you need to host them somehow. Http server is easiest option. Just set root
|
|
|
|
|
directory to ```BASEDIR```. **Remember that you have to distribute these files as plain text for safety measures!**
|
|
|
|
|
|
|
|
|
|
There is sample configuration for nginx:
|
|
|
|
|
|
|
|
|
|
```
|
|
|
|
|
server {
|
|
|
|
|
listen 80;
|
|
|
|
|
server_name mysite.com www.mysite.com;
|
|
|
|
|
add_header Content-Type text/plain;
|
|
|
|
|
|
|
|
|
|
location / {
|
|
|
|
|
root /home/www/code/;
|
|
|
|
|
index index.html;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
```
|
|
|
|
|
|
|
|
|
|
## License ##
|
2013-09-06 04:01:55 +02:00
|
|
|
|
|
|
|
|
Fiche is MIT licensed.
|