<commit_before># cabinet
cabinet is an HTTP server to keep and serve your static files.

It stores the files in a key-value database, and supports a simple replication
scheme.

## Usage

Build and install normally using `go install`.

Start with `cabinet -pass=$PASSWORD -frontend=http://publicaddress:port`. The 
password is necessary for the upload API. The default username is `admin`, but 
can be configured differently.

The `cup` subdirectory contains an example how to use the upload API. The 
frontend address is required for generating complete URLs in the upload API.

To delete files, the same URL as was returned by the upload API needs to be 
called with the HTTP `DELETE` method and authentication like the upload API.

## Replication

cabinet implements a replication scheme. By default, a cabinet instance acts as 
a `parent`, which means it allows uploads and deletions.

A cabinet `child` can be started by providing the commandline option 
`-parent=http://parentserver:port`. A `child` will not allow uploads or 
deletions, but will instead replicate all uploads and deletions as they happen 
from the `parent` instance. `child` instances can be cascaded, i.e. one `child` 
can replicate from another `child`.
<commit_msg>add clarification how disconnects are being dealt with.<commit_after># cabinet
cabinet is an HTTP server to keep and serve your static files.

It stores the files in a key-value database, and supports a simple replication
scheme.

## Usage

Build and install normally using `go install`.

Start with `cabinet -pass=$PASSWORD -frontend=http://publicaddress:port`. The 
password is necessary for the upload API. The default username is `admin`, but 
can be configured differently.

The `cup` subdirectory contains an example how to use the upload API. The 
frontend address is required for generating complete URLs in the upload API.

To delete files, the same URL as was returned by the upload API needs to be 
called with the HTTP `DELETE` method and authentication like the upload API.

## Replication

cabinet implements a replication scheme. By default, a cabinet instance acts as 
a `parent`, which means it allows uploads and deletions.

A cabinet `child` can be started by providing the commandline option 
`-parent=http://parentserver:port`. A `child` will not allow uploads or 
deletions, but will instead replicate all uploads and deletions as they happen 
from the `parent` instance. `child` instances can be cascaded, i.e. one `child` 
can replicate from another `child`.

Whenever a `child` gets disconnected from its `parent`, it attempts to 
automatically reconnect and catch up with any uploads or deletions that 
happened during the disconnect time.
{'fraction_non_alphanumeric': 0.0565410199556541, 'fraction_numerical': 0.0, 'mean_word_length': 4.513238289205702, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, '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': '2779931', 'n_tokens_mistral': 703, 'n_tokens_neox': 677, 'n_words': 398}