By | fr33domlover |
At | 2015-09-21 |
Title | write a better README |
Description |
Edit file README.md 33188 → 33188
- 1 ## Database setup
+ 1 # Toothpaste
+ 2 + 3 This is a simple paste server, a modified version of Chris Done's
+ 4 [hpaste](http://hackage.haskell.org/hpaste). Toothpaste can syntax-highlight
+ 5 some computer languages, and can post links into IRC channels.
+ 6 + 7 Examples for some of the changes made:
+ 8 + 9 - Use [[fr33domlover]]'s e-mail address as the contact URL. This is done for
+ 10 two reasons: First, it is the person who maintains this version. Second, the
+ 11 default address, Chris Done's, is a gmai1 address. And I don't want to
+ 12 endorse or suggest gmai1 in any way. Feels wrong to put a gmai1 address
+ 13 there.
+ 14 - Remove the JS code of g00gle ana1ytic$.
+ 15 - Fix and tweak some hard-coded URLs and labels
+ 16 - Add an SQL file with some initial data (languages and channels)
+ 17 - Disable IRC announcements of private pastes
+ 18 - Use [FunBot](https://notabug.org/fr33domlover/funbot) for IRC announcements
+ 19 instead of the (a bit too) simple IRC bot written originally
+ 20 + 21 # How to Use
+ 22 + 23 Even after the modifications I made, there are hardcoded URLs in some places,
+ 24 and some extra links I added, which you may wish to change. More generally, it
+ 25 seems the original author wrote the code in his earlier days as a Haskell
+ 26 developer and the code in some places could use a big cleaner layout. So feel
+ 27 free to hack and impove!
+ 28 + 29 Also, "hpaste" and "lpaste" are used when referring to the server in various
+ 30 places in the code. Don't worry about it. Just go to the UI layout code and
+ 31 change the UI strings and URLS you need. You can `grep` for the URLs or first
+ 32 launch the server and then take a look and see what you'd like to change.
+ 33 + 34 ## Database Setup
+ 35 + 36 Data is stored in a PostgreSQL database.
2 37 3 38 $ sudo su postgres --command 'createuser hpaste -P'
4 39 $ sudo su postgres --command 'createdb hpaste -O hpaste'
5 40 $ cat sql/schema.sql | psql -U hpaste -h 127.0.0.1 -d hpaste
6 41 + 42 You can also run the last line with the `sql/data.schema`, which contains some
+ 43 initial data such as lists of IRC channels and programming languages. Take a
+ 44 look at that file and tweak as needed before you commit it to `psql`.
+ 45 7 46 ## Configuration & Running
8 47 9 48 $ cp hpaste.conf.sample hpaste.conf
10 49 - 11 Edit hpaste.conf.
- 12 + 50 Edit `hpaste.conf`. Make sure the cache directory has correct permissions (the
+ 51 user running the server needs to be able to create files there).
+ 52 13 53 $ dist/build/hpaste/hpaste hpaste.conf
14 54 + 55 You can use *cron* or *supervisord* or similar to have the server launch
+ 56 automatically at boot time.
+ 57 + 58 ## Regenerating Web Pages
+ 59 + 60 The server keeps some content in a cache, whose path is set in `hpaste.conf`
+ 61 (`/tmp/hpaste-cache` by default). Some changes to the code won't take effect
+ 62 until you clear the cache and cause the server to generate new files there. You
+ 63 can safely clear the cache like this:
+ 64 + 65 $ rm -rf /tmp/hpaste-cache/*
… … … …