kpaste

Pastebin service

git clone git://git.lin.moe/go/kpaste.git

 1#+Title: ReadMe
 2#+Options: toc:nil author:nil creator:nil
 3
 4* Issue
 5
 6Mail Lindsay Zhou <i@lin.moe>
 7
 8* Usage
 9#+begin_src sh
10# basic usage
11echo "Hello world!" | curl p.koi.moe -Ff=@-
12
13# parse as markdown or orgmode file
14curl p.koi.moe -Ff@<yourfile>.md
15# or
16curl p.koi.moe -Ff@<yourfile>.org
17
18# expire after 7 days
19curl p.koi.moe -Ff=@<yourfile.ext> -Fexpire=7
20
21# read max 5 times
22curl p.koi.moe -Ff=@<yourfile.ext> -Fread=5
23
24# Password protected
25curl --user <user>:<password> p.koi.moe -Ff=@<yourfile.ext>
26
27# Create or update with speicifying key
28# Notice: Only password protected notes can be updated and deleted
29curl p.koi.moe/<key> -Ff=@<youfile.ext>
30
31# Delete
32curl --user <user>:<password> -XDELETE p.koi.moe/<key>
33
34#+end_src
35
36* Content Limitation
37#+begin_src 
38Content-Security-Policy: default-src 'none'; style-src 'self'; sandbox allow-downloads allow-forms allow-popups
39#+end_src
40
41* Service Deployment
42** Install
43#+begin_src 
44git clone git://git.lin.moe/go/kpaste.git
45cd kpaste
46make && make install
47#+end_src
48
49** Run
50#+begin_src sh
51kpaste serve --db /tmp/kpaste.db
52# without --media flag, uploaded files will be stored in the sqlite database as blob type
53
54# or
55kpaste serve --db /tmp/kpaste --media /tmp/media --upload-limit 3027
56#+end_src
57
58** Clean up
59Run =kpaste clean --db <database_file> [--media <media_path>]= to clean expired data.
60
61** More help
62#+begin_src 
63kpaste help
64#+end_src
65
66* Todo
67** support 2-level note key, and group notes together using the first level key