summaryrefslogtreecommitdiff
path: root/readme.md
blob: 26a896087fe267b0159726fa5e7340cd0ef5104d (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
# jekyll-hook

A server that listens for webhook posts from GitHub, generates a site with Jekyll, and moves it somewhere to be served. Use this to run your own GitHub Pages-style web server. Great for when you need to serve your websites behind a firewall, need extra server-level features like HTTP basic auth (see `default` file for Nginx config with basic auth), or want to host your site directly on a CDN or file host like S3.

## Installation

- `build.sh` installs server dependencies for Ubuntu Linux
- run `$ npm install` to install app dependencies

## Configuration

Copy the following JSON to `config.json` in the application's root directory.

```json
{
    "gh_server": "github.com",
    "branch": "master",
    "temp_directory": "/home/ubuntu/jekyll-hook",
    "site_directory": "/usr/share/nginx/www",
    "email": {
       "user": "", 
       "password": "", 
       "host": "", 
       "ssl": true
    }
}
```

Configuration attributes:

- `gh_server` The GitHub server from which to pull code
- `branch` The branch to watch for changes
- `temp_directory` A directory to store code and site files
- `site_directory` A directory to publish the site
- `email` Optional. Settings for sending email alerts
    - `user` Sending email account's user name (e.g. `example@gmail.com`)
    - `password` Sending email account's password
    - `host` SMTP host for sending email account (e.g. `smtp.gmail.com`) 
    - `ssl` `true` or `false` for SSL

## Usage

- run once: `$ node app.js`
- use [forever](https://github.com/nodejitsu/forever) to run as server: `$ forever app.js`

## Web server

Serve content from a simple webserver link Nginx (the `default` file is a sample Nginx configuration with HTTP basic auth) or use s3cmd or rsync to mirror files on S3 or a CDN.