<commit_before>* Share Server
A single-file ShareJS server which uses a MongoDB backend.

Requires a running instance of [[http://www.mongodb.org/][MongoDB]] on localhost:27017, and a [[http://nodejs.org/][NodeJS]] installation.

Once those are available, we can fetch our dependencies as follows:
#+BEGIN_SRC sh
npm install
#+END_SRC

Then run the following to host a browser-channel socket on the given port:
#+BEGIN_SRC sh
node server.js 80; # 8080 Is the default port.
#+END_SRC

** Debian Service Install
This provides a systemd deamon called share-server and sets it to run on startup.

#+BEGIN_SRC sh
# CLone share server
git clone git@github.com:cse-bristol/share-server.git /opt/shareserver;

# install dependencies
cd /opt/shareserver;
npm install;

# Hard link the service file.
# (If you prefer you can use cp here. Symlinks don't work with systemd.)
ln /opt/shareserver/shareserver.service /etc/systemd/system/shareserver.service

systemctl enable shareserver.service
systemctl start shareserver.service

#+END_SRC


<commit_msg>Updated readme to reflect change to using ElasticSearch instead of MongoDB.<commit_after>* Share Server
A single-file ShareJS server which uses a MongoDB backend.

* Installation
** Dependencies
 + A running instance of [[https://www.elastic.co/products/elasticsearch][ElasticSearch]] on localhost:9200.
 + A [[http://nodejs.org/][NodeJS]] installation.

Once those are available, we can fetch our other dependencies as follows:
#+BEGIN_SRC sh
npm install
#+END_SRC

** Running
After getting dependencies, run the following to host a browser-channel socket on the given port:
#+BEGIN_SRC sh
node server.js 80; # 8080 Is the default port.
#+END_SRC

** Debian Service Install
This provides a systemd deamon called share-server and sets it to run on startup.

#+BEGIN_SRC sh
# CLone share server
git clone git@github.com:cse-bristol/share-server.git /opt/shareserver;

# install dependencies
cd /opt/shareserver;
npm install;

# Hard link the service file.
# (If you prefer you can use cp here. Symlinks don't work with systemd.)
ln /opt/shareserver/shareserver.service /etc/systemd/system/shareserver.service

systemctl enable shareserver.service
systemctl start shareserver.service

#+END_SRC



{'fraction_non_alphanumeric': 0.08582923558337059, 'fraction_numerical': 0.009387572641931158, 'mean_word_length': 4.782945736434108, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 1, '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': '3243899', 'n_tokens_mistral': 719, 'n_tokens_neox': 665, 'n_words': 262}