Skip to content

Commit

Permalink
Fix #18
Browse files Browse the repository at this point in the history
  • Loading branch information
cvrebert committed Jun 18, 2015
1 parent fdc71a6 commit e44e4f7
Show file tree
Hide file tree
Showing 5 changed files with 39 additions and 42 deletions.
11 changes: 6 additions & 5 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,11 +13,12 @@ Hacking on LMVTFY
## How do I run the LMVTFY service locally for test purposes?
**This method is not recommended for use in production deployments!**

0. If Bootlint integration is enabled, start Bootlint's server.
1. Ensure that sbt is installed (see above).
2. Go to your `lmvtfy` directory.
3. Run `sbt`
4. At the sbt prompt, enter `re-start 8080` (replace `8080` with whatever port you want the HTTP server to run on) or `re-start` (which will use the default port specified in `application.conf`). Note that running on ports <= 1024 requires root privileges (not recommended) or using port mapping.
0. Uncomment the `javaOptions +=` line in `build.sbt` and adjust the `application.conf` path in that line.
1. If Bootlint integration is enabled, start Bootlint's server.
2. Ensure that sbt is installed (see above).
3. Go to your `lmvtfy` directory.
4. Run `sbt`
5. At the sbt prompt, enter `re-start 8080` (replace `8080` with whatever port you want the HTTP server to run on) or `re-start` (which will use the default port specified in `application.conf`). Note that running on ports <= 1024 requires root privileges (not recommended) or using port mapping.

## How do I generate a single self-sufficient JAR that includes all of the necessary dependencies?
0. Ensure that sbt is installed (see above).
Expand Down
36 changes: 3 additions & 33 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -35,39 +35,9 @@ By automating the process of checking the validity of HTML examples, such issues
## Usage
Java 7+ is required to run LMVTFY. For instructions on building LMVTFY yourself, see [the Contributing docs](https://github.com/cvrebert/lmvtfy/blob/master/CONTRIBUTING.md).

LMVTFY accepts exactly one optional command-line argument, which is the port number to run its HTTP server on, e.g. `8080`. If you don't provide this argument, the default port specified in `application.conf` will be used. Once you've built the JAR, run e.g. `java -jar lmvtfy-assembly-1.0.jar 8080` (replace `8080` with whatever port number you want). Note that running on ports <= 1024 requires root privileges (not recommended) or using port mapping.

Other settings live in `application.conf`. In addition to the normal Akka and Spray settings, LMVTFY offers the following settings:
```
lmvtfy {
// Port to run on, if not specified via the command line
default-port = 8080
// Log the HTML being validated, for debugging purposes?
debug-html = false
// Suppress Spray's logging of malformed HTTP requests/headers?
// (Enable this to avoid floods in your log output when your LMVTFY instance gets weird requests from crackers.)
squelch-invalid-http-logging = true
// List of full names of GitHub repos to watch for new issues and new issue comments
github-repos-to-watch = ["twbs/bootstrap"]
// Username of the account that reply comments will be posted from
username = "twbs-lmvtfy"
// Password for the account that reply comments will be posted from
password = "not-actually-the-password"
// This goes in the "Secret" field when setting up the Webhook
// in the "Webhooks & Services" part of your repo's Settings.
// This string will be converted to UTF-8 for the HMAC-SHA1 computation.
// The HMAC is used to verify that LMVTFY is really being contacted by GitHub,
// and not by some random hacker.
web-hook-secret-key = "some-random-gibberish-here"
// Bootlint integration settings
bootlint {
// Enable Bootlint integration?
enabled = true
// Local port that Bootlint is running on
port = 7070
}
}
```
You will need to setup an `application.conf` file in order to run LMVTFY. See [`example.conf`](https://github.com/cvrebert/lmvtfy/blob/master/src/main/resources/example.conf) for info on LMVTFY's available settings. At a minimum, you will need to set `lmvtfy.github-repos-to-watch`, `lmvtfy.username`, `lmvtfy.password`, and `lmvtfy.web-hook-secret-key`. LMVTFY's default settings can be found in [`reference.conf`](https://github.com/cvrebert/lmvtfy/blob/master/src/main/resources/reference.conf). Akka and Spray settings can also be set in your `application.conf`.

LMVTFY accepts exactly one optional command-line argument, which is the port number to run its HTTP server on, e.g. `8080`. If you don't provide this argument, the default port specified in `application.conf` will be used. Once you've built the JAR, run e.g. `java -Dconfig.resource=/path/to/your/application.conf -jar lmvtfy-assembly-1.0.jar 8080` (replace `8080` with whatever port number you want and replace `/path/to/your/application.conf` with the actual path to your `application.conf`). Note that running on ports <= 1024 requires root privileges (not recommended) or using port mapping.

### GitHub webhook configuration
* Payload URL: `http://your-domain.example/lmvtfy`
Expand Down
2 changes: 2 additions & 0 deletions build.sbt
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,8 @@ libraryDependencies ++= {

scalacOptions := Seq("-unchecked", "-deprecation", "-feature", "–Xlint", "-encoding", "utf8")

// javaOptions += "-Dconfig.resource=/path/to/your/application.conf"

scalacOptions in Test ++= Seq("-Yrangepos")

// parallelExecution in Test := false
Expand Down
28 changes: 28 additions & 0 deletions src/main/resources/example.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
lmvtfy {
// Port to run on, if not specified via the command line
default-port = 8080
// Log the HTML being validated, for debugging purposes?
debug-html = false
// Suppress Spray's logging of malformed HTTP requests/headers?
// (Enable this to avoid floods in your log output when your LMVTFY instance gets weird requests from crackers.)
squelch-invalid-http-logging = true
// List of full names of GitHub repos to watch for new issues and new issue comments
github-repos-to-watch = ["twbs/bootstrap"]
// Username of the account that reply comments will be posted from
username = "twbs-lmvtfy"
// Password for the account that reply comments will be posted from
password = "not-actually-the-password"
// This goes in the "Secret" field when setting up the Webhook
// in the "Webhooks & Services" part of your repo's Settings.
// This string will be converted to UTF-8 for the HMAC-SHA1 computation.
// The HMAC is used to verify that LMVTFY is really being contacted by GitHub,
// and not by some random hacker.
web-hook-secret-key = "some-random-gibberish-here"
// Bootlint integration settings
bootlint {
// Enable Bootlint integration?
enabled = true
// Local port that Bootlint is running on
port = 7070
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,4 @@ lmvtfy {
port = 7070
}
github-rate-limit-threshold = 10
github-repos-to-watch = ["cvrebert/lmvtfy"]
username = throwaway9475947
password = XXXXXXXX
web-hook-secret-key = abcdefg
}

0 comments on commit e44e4f7

Please sign in to comment.