# 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. #### Making a new bucky Load the two SQL files - these should be enough to set up the original DB schema, and then make a few changes: ```bash mysql -u carbon -p bucky < bucky-schema.sql mysql -u carbon -p bucky < migrate.sql ``` #### Loading an old bucky db dump ```bash mysql -u carbon -p bucky < bucky-20150903.sql ``` ### MongoDB DEPRECATED 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 DEPRECATED 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` :)