This is a simple pastebin made with node.js & a sqlite3 backend.
Note: The old mongodb codebase is in the mongodb branch.
I needed my own pastebin for "research" ;)
- clone the repo
- take a look at config.js
$ npm install- Get sqlite database ready
$ sqlite3 spb.db < sql/pastes.sql $ npm start- pop open
http://localhost:3030on the browser
The initial version of spb was built to use mongodb for its database. This new version will be using sqlite.
If you have a good chunk of pastes that you wish to move over, here's what you do
-
hop on the vm and take a mongodb dump like so
$ mongoexport -d spb -c pastes --jsonArray -o pastes.jsonthis create a
pastes.jsonfile which holds all of your old data. -
copy the
pastes.jsonfile into theextrasfolder and then run$ node extras/mongo_migrate.jsYou might see a warning like so which you can ignore.
(node:10559) ExperimentalWarning: Importing JSON modules is an experimental feature and might change at any time (Use `node --trace-warnings ...` to show where the warning was created)Please make sure you setup the sqlite database before hand
$ sqlite3 spb.db < sql/pastes.sql