summaryrefslogtreecommitdiff
path: root/README
blob: 4ff22612f3647064706a0f1b7713eac9f34d1692 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
# bucky

## Install

### osx

```
npm install
brew install mysql (used for main database)
```

### MySQL

```
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

```
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:

```
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`

```
npm start
```

Server will be running at http://localhost:5000/ aka http://lvh.me:5000/ (or whatever port you set in the .env)

### Produciton

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` :)