Skip to content
Silverweed edited this page Jul 29, 2016 · 14 revisions

Building from source

Required apps/packages

  • Node.js
    • npm
    • grunt-cli
  • Ruby / Gem
    • compass
  • Go 1.4+

Maud needs to connect to a MongoDB server on startup; by default, it will try to connect to localhost:27017, but a different location can be specified with the -dburl flag.

Installation

  1. Clone the repo git clone https://github.com/hamcha/maud
  2. Get inside cd maud
  3. Install the deps npm install (requires npm and compass)
  4. Copy info.json.sample to info.json and customize it (if you want, do the same with admin.conf.sample and captcha.conf.sample)
  5. make (requires grunt-cli and the deps)
  6. You're there, just check the options ./maud -h

Using the dockerized binary

If you have Docker installed, you can pull the latest maud build from Docker Hub via docker pull silverweed/maud:latest.

See the instructions on the repo for the details.

Extra

Keeping it safe

Maud has a module for blacklisting users based on their IP and/or User Agent. If want to use it, you'll need to create a blacklist.conf file containing a JSON object with key-pairs of banned users, like:

{
    "User 1": {
        "Criteria": "ALL", // must match both IP and UA checks; change to another string to match any of them
        "IP": "^192\.",    // can use regexes for IP
        "UserAgent": "^Mozilla",   // can use regexes for UA too
        "Reason": "Being nagging", // this will be displayed to the banned user (may be empty)
        "Action": "ban" // "ban": disallow access to this user; "captcha": require captcha for replying. CASE SENSITIVE, so use lowercase "ban" and "captcha".
    }
}

If you ever use the "captcha" action, you need to configure the capthas too. Please note that maud doesn't do HTTPS (which means basic auth is totally unencrypted and interceptable) so you should use a HTTPS reverse proxy (such as nginx) to secure your connection.

There's an additional check used for crunchy.rocks, that is, GeoIP checking and forcing captchas on all non-italian hosts. To download the GeoIP database, you can use this simple command:

curl http://geolite.maxmind.com/download/geoip/database/GeoLite2-Country.mmdb.gz | gunzip > geoip.mmdb

How to Go 1.4+

Step 1.

git clone https://github.com/golang/go --branch release-branch.go1.4 --single-branch
cd go/src
bash all.bash

Step 2. Add go/bin to your $PATH (or ln -s the files somewhere)

Step 3. Remember to set $GOPATH to somewhere

Captcha conf

Configuring the captchas is required only if you use the "captcha" Action in the blacklist.conf file. If you do, you need to provide a captcha.conf file containing a JSON array of objects with the conf values. Captchas consist in:

  1. an image which will be shown in the reply form
  2. a question which will be presented to the user
  3. an answer to said question.

Sample configuration:

[
    { 
        "ImgPath": "/static/images/foo.png",
        "Question": "what number is this?",
        "Answer": "42"
    },
    { 
        "ImgPath": "/static/images/bar.png",
        "Question": "what word is this?",
        "Answer": "sedimentary"
    }
]

Answer is not case sensitive and whitespaces don't matter (i.e. Maud Pie is the same as maudpie).