<commit_before># Tentd - Protocol v0.3 [![Build Status](https://travis-ci.org/tent/tentd.png?branch=0.3)](https://travis-ci.org/tent/tentd)

## Setup

### ENV Variables

name            | required | description
--------------- | -------- | -----------
TENT_ENTITY     | Required | Entity URI (can be omitted if `env['current_user']` is set to an instance of `TentD::Model::User` prior to `TentD::API::UserLookup` being called)
DATABASE_URL    | Required | URL of postgres database (e.g. `postgres://localhost/tentd`)
REDIS_URL       | Required | URL of redis server (e.g. `redis://localhost:6379`)
REDIS_NAMESPACE | Optional | Redis key namespace for sidekiq (defaults to `tentd.worker`)
RUN_SIDEKIQ     | Optional | Set to 'true' if you want to boot sidekiq via `config.ru`
SIDEKIQ_LOG     | Optional | Sidekiq log file (defaults to STDOUT and STDERR)
SOFT_DELETE     | Optional | To perminently delete db records, set to `false`. Defaults to `true` (sets `deleted_at` timestamp instead of removing from db)

### Database Setup

```bash
createdb tentd
DATABASE_URL=postgres://localhost/tentd bundle exec rake db:migrate
```

### Running Server
<commit_msg>Add attachment storage options to README<commit_after># Tentd - Protocol v0.3 [![Build Status](https://travis-ci.org/tent/tentd.png?branch=0.3)](https://travis-ci.org/tent/tentd)

## Setup

### ENV Variables

name            | required | description
--------------- | -------- | -----------
TENT_ENTITY     | Required | Entity URI (can be omitted if `env['current_user']` is set to an instance of `TentD::Model::User` prior to `TentD::API::UserLookup` being called)
DATABASE_URL    | Required | URL of postgres database (e.g. `postgres://localhost/tentd`)
REDIS_URL       | Required | URL of redis server (e.g. `redis://localhost:6379`)
REDIS_NAMESPACE | Optional | Redis key namespace for sidekiq (defaults to `tentd.worker`)
RUN_SIDEKIQ     | Optional | Set to 'true' if you want to boot sidekiq via `config.ru`
SIDEKIQ_LOG     | Optional | Sidekiq log file (defaults to STDOUT and STDERR)
SOFT_DELETE     | Optional | To perminently delete db records, set to `false`. Defaults to `true` (sets `deleted_at` timestamp instead of removing from db)

#### Attachment Storage Options

Precedence is in the same order as listed below.

name       | env                              | description
----       | ---                              | -----------
Amazon S3  | AWS_ACCESS_KEY_ID                | Access key identifier
           | AWS_SECRET_ACCESS_KEY            | Access key
           | S3_BUCKET                        | Bucket name
Google     | GOOGLE_STORAGE_ACCESS_KEY_ID     | Access key identifier
           | GOOGLE_STORAGE_SECRET_ACCESS_KEY | Access key
           | GOOGLE_BUCKET                    | Bucket name
Rackspace  | RACKSPACE_USERNAME               | Username
           | RACKSPACE_API_KEY                | Api key
           | RACKSPACE_AUTH_URL               | Auth URL (European Rackspace)
           | RACKSPACE_CONTAINER              | Container (bucket) name
Filesystem | LOCAL_ATTACHMENTS_ROOT           | Path to directory (e.g. `~/tent-attachments`)
Postgres   | POSTGRES_ATTACHMENTS             | Default. Set to `true` to override any of the other options.

### Database Setup

```bash
createdb tentd
DATABASE_URL=postgres://localhost/tentd bundle exec rake db:migrate
```

### Running Server

{'fraction_non_alphanumeric': 0.12038949542637946, 'fraction_numerical': 0.005311301268810859, 'mean_word_length': 2.5987261146496814, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 4, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 4, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '5946176', 'n_tokens_mistral': 1052, 'n_tokens_neox': 1029, 'n_words': 308}