Skip to content

Commit

Permalink
Hopefully cleaned up enough
Browse files Browse the repository at this point in the history
  • Loading branch information
k3d3 committed Jan 21, 2012
1 parent ab40349 commit 53c6037
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 16 deletions.
8 changes: 0 additions & 8 deletions 3d3paste.py
Expand Up @@ -295,14 +295,6 @@ def rawurl(urlname):
else:
raise HTTPError(404, "URL not in database")

@route("/h")
def nohost():
raise HTTPError(404, "Not found: '/h'")

@route("/h", method="POST")
def host():
return "omg\n" + str([i for i in bottle.request.files]) + '\n'

@route("/p:pastename")
@route("/p:pastename", method="POST")
def paste(pastename):
Expand Down
23 changes: 15 additions & 8 deletions README.md
@@ -1,17 +1,22 @@
# 3d3Paste
3d3Paste is a simple, basic pastebin solution. It provides syntax highlighting and the ability to protect pastes with passwords.

Paste URLs are also encded with base58 to ensure the URLs are short and memorable

## Technologies
We use Python 2, Bottlepy (transitioning to Flask), Pygments for syntax highlighting, and currently Fapws3 as a web server.

For the storage of pastes and URLs, we use memcachedb and memcached with the cmemcached python plugin, however we are working to make this more modular.

All pastes and URLs are serialized with MsgPack.

## Installation and configuration
Currently you need Python 2.7 along with the Bottlepy, Pygments, MsgPack, cmemcached and FapWS3 modules. FapWS3 can be replaced with any WSGI server given some work. The majority of these, if not all of them, can be installed through pip.

Along with those modules, you need memcached and memcachedb servers running. Again, we are working to make this more modular.

We have a configuration that load balances among 4 instances, therefore we have included 3 scripts, start_3d3p.sh, kill_3d3p.sh and watch_3d3p.sh, as examples of how to use 3d3Paste.

You may also need to create an http user and group.

## Demo
Expand All @@ -22,23 +27,25 @@ Usage for 3d3Paste is simple. You can visit the website, enter a URL or paste, s

In addition to the web interface, it's also possible to submit pastes via cURL. To submit a paste:

`$ cat testing.txt | curl http://3d3.ca/ -F "paste=<-" -F "format=text" -F "p=mypassword" -F "title=mytitle"
http://3d3.ca/rpa`
> $ cat testing.txt | curl http://3d3.ca/ -F "paste=<-" -F "format=text" -F "p=mypassword" -F "title=mytitle"
> http://3d3.ca/rpa
This will return a link to the paste in raw form. You may also remove the initial r to access the web version of the paste, for example http://3d3.ca/pa

This will return a link to the paste in raw form. You may also remove the initial r to access the web version of the paste, for example `http://3d3.ca/pa`
The format, password and title are all optional. You may also remove the initial r to access the web version of the paste.

To submit a URL to shorten:

`$ echo http://www.example.com | curl http://3d3.ca -F "url=<-" -F "p=mypassword"
http://3d3.ca/ruv`
> $ echo http://www.example.com | curl http://3d3.ca -F "url=<-" -F "p=mypassword"
> http://3d3.ca/ruv
This will return a shortened link in raw form. A URL in raw form will be returned in plaintext rather than automatically forwarding.
You can be redirected by removing the initial r, for example `http://3d3.ca/uv`

You can be redirected by removing the initial r, for example http://3d3.ca/uv

# Additional Features
We have also included a simple page to show your IP and reverse DNS, at `http://3d3.ca/i`
You may remove this in the code if you feel the need.
We have also included a simple page to show your IP and reverse DNS, at http://3d3.ca/i

You may remove this in the code if you need to.

## License
3d3Paste is released under the GPLv2. Absolutely no warranty, explicit or implied, is available. Read the header in 3d3paste.py for more information.

0 comments on commit 53c6037

Please sign in to comment.