<commit_before># webHookListener
ruby/sinatra github webhook listener

Webhook expected to be of type *application/x-www-form-urlencoded*

Need to set some environment variables before running the app:

+ **WEBHOOK_LISTENER_SECRET_TOKEN** your github webhook secret string
+ **WEBHOOK_LISTENER_BIND_ADDRESS** with the servers address to bind to
+ **WEBHOOK_LISTENER_SCRIPT** script on the server running this to call

ie: 
```
export WEBHOOK_LISTENER_SECRET_TOKEN=<PASSWORD>
export WEBHOOK_LISTENER_BIND_ADDRESS=192.168.3.11
export WEBHOOK_LISTENER_SCRIPT=/opt/local/bin/myWebHookScript
ruby webhookListener.rb
```

The webhookListener.rb calls a unix shell script with two arguments:
+ The name of the repo initiating the webhook
+ The event type that initiated the webhook

This allows the listener to handle webhook calls from different repos, but they would all have to share a common Secret Token.

## Installation - Fedora-25
As root:
+ dnf install ruby ruby-devel rubygems
+ If you are running a firewall, remember to poke a hole for port 4567 (sinatra default port)

As a regular user (possibly the account that will run the above?)
+ gem install sinatra
<commit_msg>improve install instructions in main readme.md file.<commit_after># webHookListener
ruby/sinatra github webhook listener

Webhook expected to be of type *application/x-www-form-urlencoded*

Need to set some environment variables before running the app:

+ **WEBHOOK_LISTENER_SECRET_TOKEN** your github webhook secret string
+ **WEBHOOK_LISTENER_BIND_ADDRESS** with the servers address to bind to
+ **WEBHOOK_LISTENER_SCRIPT** script on the server running this to call

ie: 
```
export WEBHOOK_LISTENER_SECRET_TOKEN=<PASSWORD>String
export WEBHOOK_LISTENER_BIND_ADDRESS=192.168.3.11
export WEBHOOK_LISTENER_SCRIPT=/opt/local/bin/myWebHookScript
ruby webhookListener.rb
```

The webhookListener.rb calls a unix shell script with two arguments:
+ The name of the repo initiating the webhook
+ The event type that initiated the webhook

This allows the listener to handle webhook calls from different repos, but they would all have to share a common Secret Token.

## Installation - Fedora-25
As root:
+ dnf install ruby ruby-devel rubygems
+ If you are running a firewall, remember to poke a hole for port 4567 (sinatra default port)

As a regular user (possibly the account that will run the above?)
+ gem install sinatra

Once the above is done, you should be able to read the README-FC+RHEL+CENTOS.md file and then Install the components on the server using the Install script.

{'fraction_non_alphanumeric': 0.0564042303172738, 'fraction_numerical': 0.011750881316098707, 'mean_word_length': 5.337468982630273, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 5, 'https://': 0, 'lorem ipsum': 0, 'www.': 2, 'xml': 0}, 'pii_count': 2, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2689102', 'n_tokens_mistral': 808, 'n_tokens_neox': 734, 'n_words': 318}