PK 3w‘CÉÒ}F F ownpaste-latest/searchindex.jsSearch.setIndex({objects:{},terms:{private_id:2,all:2,code:0,help:1,just:[1,2],carefulli:1,text:2,wsgi:1,rest:[0,2],syntax:0,through:1,follow:[3,1,2],nowadai:0,user:[0,1],digest:[1,2],paramet:[0,1,2],current:[0,1,2],privat:[0,1,2],jinja:2,unsecur:1,flask:[0,1],explain:2,configur:[0,1,3],friendli:1,should:1,ebuild:1,add:[1,2],html:2,queri:2,main:1,applic:[0,1,2],them:2,sourc:0,"return":2,string:[1,2],format:2,fals:2,timestamp:2,when:[1,2],pypi:1,goncalv:0,offlin:0,number:[1,2],api_vers:2,alias:2,know:2,credeti:2,veri:1,password:[0,1,3],requir:2,cool:[0,1],http_author:1,somewher:1,name:2,specif:2,request:[1,2],simpl:[0,1],manual:[0,1],unix:2,authent:2,server:[0,1,2],provid:[0,1,2],blohg:1,rafaelmartin:[0,1],common:2,timeout:1,each:2,output:1,path:[1,3],file_nam:2,page:[1,2],pygment:[0,1],system:1,www:1,set:1,deal:2,due:0,cfg:[1,3],phase:2,creation:[0,2],some:[0,1,2],idea:0,maintain:0,heavi:0,see:1,sure:1,design:0,integ:2,respons:[0,2],fail:[1,2],our:2,happen:2,patch:[0,2],extract:1,servic:0,librari:0,python:[0,1],variabl:[1,2],index:[1,2],statu:2,total:2,databas:[0,1,2,3],section:[1,2],deploy:1,abl:[1,2],per:[1,2],your:[0,1,3],content:2,delet:[0,2],version:[0,2,3],languag:2,without:0,"new":2,author:0,correct:1,refer:1,altern:1,difficulti:0,shut:0,full:2,run:[0,1,3],kei:[1,2],web:[0,1],numer:2,gener:[0,1,3],db_upgrad:[1,3],migrat:3,style:1,like:[0,1],bodi:2,extens:0,step:1,base:[0,1,2],repositori:[0,1,3],otherwis:2,ask:1,org:[0,1],method:2,valu:2,pygments_lineno:1,about:2,download:1,script:1,reason:[0,1],secur:1,manag:3,filter:0,etc:2,alia:2,instanc:2,pagin:[1,2],isn:1,implement:1,timezon:1,rafael:0,block:1,first:2,load:1,pleas:[1,3],pygments_styl:1,app:1,deploi:[0,1],easy_instal:[0,1],usual:[1,2],brute:1,down:0,header:[1,2],instruct:[1,3],"boolean":2,linux:[0,1],"import":1,guid:[0,1],tomorrow:0,login:1,yourself:0,avail:[1,2],guess:2,from:[0,1,2,3],spam:0,support:1,ip_block_hit:1,upgrad:[0,3],why:0,mercuri:[0,1],few:0,json:[0,2],alchemi:1,remote_addr:1,basic:2,file_cont:2,instal:[0,1],pocoo:[0,1],setup:[0,1,2],properli:1,desir:1,option:2,pip:[0,1],forc:1,"public":[0,2],enabl:1,tmp:1,generatepw:[1,3],sqlalchemi:3,templat:2,newer:3,demand:2,known:0,attempt:1,line:[1,2],blocker:1,"true":1,than:3,initi:[0,1,3],past:[0,1,2],none:2,endpoint:[0,2],retriev:2,look:[0,1],"default":[1,2],type:[1,2],remov:[1,2],work:1,tree:1,uniqu:2,project:0,directori:1,ownpast:[0,1,2,3],neat:2,can:[0,1,2],error:2,highlight:0,inform:2,root:1,pub_timestamp:2,control:2,sqlite:1,hash:[0,1,3],have:[1,2],creat:[1,2],ip_block_timeout:1,utc:[1,2],dure:2,pass:1,ani:[1,2],accept:2,equal:2,packag:1,list:2,itself:2,motiv:0,expir:0,file:[0,1,2,3],tabl:[1,2],need:[1,3],exist:[1,2],well:[0,2],pastebin:[0,1],risk:0,oper:1,alwai:2,tarbal:1,date:2,built:1,want:[1,2],eng:[0,1],receiv:2,anoth:2,make:1,get:[0,2],choic:1,detail:2,client:[0,2],note:[0,3],also:[1,3],post:[0,2],other:[0,1],runserv:1,take:1,nice:0,big:1,test:1,success:2,you:[0,1,2,3],document:[0,1,2],config:[1,3],command:[1,3],updat:3,ownpaste_set:1,product:1,relat:2,http:[0,1,2],thi:[0,1,2],gentoo:[0,1],api:[0,2],usernam:1,clone:1,licens:0,befor:1,paste_id:[0,2],auth:1,attack:1,sql:1,bsd:0,realm:1,create_app:1,contain:1,data:2,chang:2,blacklist:1,handl:1,sqlalchemy_database_uri:1,don:1,file_content_preview:2,scenario:0,framework:0,read:1,doc:1,martin:0,descript:[1,2],save:1,object:[0,2],doe:1,issu:0,person:0,emerg:1,environ:1,allow:0,time:0,db_version_control:[1,3],per_pag:[1,2],avoid:1,latest:1},objtypes:{},titles:["ownpaste, a personal pastebin application","Server setup","RESTful API documentation","Upgrade notes"],objnames:{},filenames:["index","setup","api","upgrade"]})PK 3w‘CÇÌæ æ ownpaste-latest/.buildinfo# Sphinx build info version 1 # This file hashes the configuration used when building these files. When it is not found, a full rebuild will be done. config: d7fc3e0320b041fefc2d7a3d001c816e tags: fbb0d17656682115ca4d033fb2f83ba1 PK 3w‘COµ$qÉ É ownpaste-latest/objects.inv# Sphinx inventory version 2 # Project: ownpaste # Version: 0.2.2 # The remainder of this file is compressed using zlib. xÚËÍOÉÌKIP(.I±ÊILJÍQÐ5T(¨ÔÍ…Jè++ø槔æ¤*x‚¸\é©yX4ÀDª!ÊŠS‹’3PAÄ€J‚!’‰é©\ qI+ýPK 3w‘Cpb9Ü1 Ü1 ownpaste-latest/index.html
Author: | Rafael Goncalves Martins |
---|---|
Source code: | http://hg.rafaelmartins.eng.br/ownpaste/ |
License: | BSD |
Version: | 0.2.2 |
ownpaste is a pastebin web application, designed to be used as a personal/private pastebin.
This project is motivated by the difficulty of maintain a public pastebin service nowadays, without time expiration and heavy spam filters. This is the reason why services like http://paste.pocoo.org/ are shutting down.
A simple private pastebin application, that you can run by yourself, that provides a nice RESTful API, allowing the creation of cool clients, and that can highlight your files nicely, without the risk of get offline tomorrow due to spam issues looks like a nice idea in this current scenario.
ownpaste uses the Flask web framework (and some of its extensions), the Pygments syntax highlighter and a few other well-known Python libraries.
This section will guide you through the alternatives for setting up and configuring ownpaste in your operating system. ownpaste is currently tested on Linux, but should works in other operating systems.
ownpaste works on Python 2.7.
ownpaste is available at the Python Package Index (PyPI):
http://pypi.python.org/pypi/ownpaste
To install blohg using pip, type:
# pip install ownpaste
Or using easy_install, type:
# easy_install ownpaste
There’s a Gentoo ebuild available in the main tree. Install it using:
# emerge -av www-apps/ownpaste
You can also run ownpaste from the Mercurial repository. Just clone it and make sure that it is added to your Python path:
$ hg clone http://hg.rafaelmartins.eng.br/ownpaste/
$ cd ownpaste/
The ownpaste script does not exists in the repository, but you can run it using the following command from the repository root:
$ python ownpaste/
ownpaste/ is the directory of the main Python package, with the ownpaste implementation.
These are the steps needed to configure ownpaste properly.
ownpaste is a private pastebin application, then you need an username and a password to be able to add pastes. Password is saved in the configuration file, but for security reasons you will want it hashed.
ownpaste provides an ownpaste script, that have some cool commands to help you when deploying ownpaste.
The following command will ask you for the desired password, and output the hash to be used in the configuration file:
$ ownpaste generatepw --config-file=/path/to/config-file.cfg
These are the configuration parameters available for ownpaste.
Please read the descriptions carefully and create your configuration file. The configuration file is an usual python file, with the following variables:
Key | Default | Description |
---|---|---|
PYGMENTS_STYLE | ‘friendly’ | Pygments style. See Pygments documentation for reference |
PYGMENTS_LINENOS | True | Enable Pygments line numbering |
PER_PAGE | 20 | Number of pastes per page, for pagination |
SQLALCHEMY_DATABASE_URI | ‘sqlite:////tmp/ownpaste.db’ | SQL-Alchemy database string |
REALM | ‘ownpaste’ | Realm for HTTP Digest auth. |
USERNAME | ‘ownpaste’ | Username |
PASSWORD | hash of ‘test’ | Password hash |
IP_BLOCK_HITS | 10 | Number of login attempts before block the user IP |
IP_BLOCK_TIMEOUT | 60 | Timeout to remove IPs from block blacklist |
TIMEZONE | ‘UTC’ | Timezone |
Please don’t use the default ‘test’ password, it is VERY unsecure.
Save your configuration file somewhere.
You’ll need to initialize the database with the needed tables. You can use any database system supported by SQL-Alchemy.
The ownpaste script provides a command to initialize the database:
$ ownpaste db_version_control --config-file=/path/to/config-file.cfg
$ ownpaste db_upgrade --config-file=/path/to/config-file.cfg
You can run ownpaste using the ownpaste script, for tests. The built-in server can’t handle a big request load, then please don’t use it in production.
$ ownpaste runserver --config-file=/path/to/config-file.cfg
You can also setup the configuration file path using the environment variable OWNPASTE_SETTINGS. This variable should contains a string with the path of the configuration file.
A simple wsgi file for ownpaste looks like this:
from ownpaste import create_app
application = create_app('/path/to/config-file.cfg')
ownpaste is an usual Flask application, take a look at flask deployment documentation for instructions:
http://flask.pocoo.org/docs/deploying/
Make sure that the REMOTE_ADDR and HTTP_AUTHORIZATION headers are being passed to the ownpaste application by your web server of choice.
The IP-based blocker, to avoid brute-force attacks, will fail if REMOTE_ADDR isn’t correct.