From d57c652dc7aa3876c0b206d2ecd7b671ffd67a68 Mon Sep 17 00:00:00 2001 From: Jules Laplace Date: Wed, 13 Oct 2021 19:34:34 +0200 Subject: readme --- README.md | 62 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 62 insertions(+) create mode 100644 README.md (limited to 'README.md') diff --git a/README.md b/README.md new file mode 100644 index 0000000..6977640 --- /dev/null +++ b/README.md @@ -0,0 +1,62 @@ +# bucky + +## Install + +### osx + +```bash +yarn install +brew install mysql (used for main database) +``` + +### MySQL + +```sql +mysql -uroot +CREATE USER 'carbon'@'localhost' IDENTIFIED BY 'the_password'; +CREATE DATABASE bucky; +USE bucky; +GRANT ALL PRIVILEGES ON bucky.* TO 'carbon'@'localhost'; +``` + +Copy .env-sample to .env and edit the values accordingly. + +PLEASE change the value of S3_PATH to if you reuse S3 buckets. + +#### Loading an old bucky db dump + +```bash +mysql -u carbon -p bucky < bucky-20150903.sql +``` + +### MongoDB + +MongoDB is used in production as session store, but another session middleware can be substituted (it would be nice to not use Mongo). By default `SESSIONS_IN_MEMORY=yes` in the .env will use the default memorystore from Express, but this is not ideal for something accessible publicly on the open internet. + +### Berkeley DB + +Used for the search, `libdb` should already be installed on your system. + +## Building the search index + +This script should be run regularly to keep the search index fresh: + +```bash +npm run build:search +``` + +## Running + +You may have to include the .so files for bdb: `export LD_LIBRARY_PATH=/var/www/bucky.asdf.us/bucky3/node_modules/berkeleydb/lib` + +```bash +npm start +``` + +Server will be running at http://localhost:5000/ aka http://lvh.me:5000/ (or whatever port you set in the .env) + +### Production + +In production I use something to daemonize the node server, such as pm2 (provides nice dashboard with uptime, restarts, saves logs, etc). + +In .env, set `NODE_ENV=production` :) -- cgit v1.2.3-70-g09d2