<commit_before>MediaGrid
=========

MediaGrid is a **takedown-resistant, distributed wireless infrastructure** allowing citizens to **communicate and share real-time photo and video documentation** at public demonstrations, without the need for internet access. A MediaGrid uses a replicated database running on a wireless mesh network of small, battery-powered devices. Smartphones (or any wifi-enabled device) within range can then connect to the wifi network to upload files and securely chat. **ALL files uploaded to the grid are completely recoverable even if most of the devices are confiscated or taken offline**. See the original (outdated) [design document](https://github.com/dismantl/MediaGrid/blob/master/MediaGrid.Design.pdf?raw=true) for more details.

MediaGrid can either be run as a simple web application on any linux server or as part of a fully automated and independent system using a [Raspberry Pi](http://www.raspberrypi.org/).

### Implemented: ###
* Web application for uploading, browsing, and viewing files
* Webchat, including private encrypted chatrooms and encrypted IM*

**\* NOTE: The cryptographic security currently used in MediaGrid chat has [known vulnerabilities](https://blog.crypto.cat/2013/07/new-critical-vulnerability-in-cryptocat-details/), and should not be used for extremely sensitive communications!**

### Partially implemented: ###
* Custom, zero-configuration Debian image for the Raspberry Pi, including automated discovery of, and replication with, other MediaGrid nodes using mDNS/DNSSD

### TODO: ###
* add Batman-Adv or BMX6 meshing
* smart replication algorithm
* documentation
* native Android, iOS clients
* [Serval](https://github.com/servalproject/) integration for signing files and wireless traffic


Hardware Requirements
------------

* Raspberry Pi
* SD Card (with enough space for file storage)
* Atheros-based USB WiFi adapter
* Power source (I'm working on a cheap, high capacity battery pack, but AC adapter will work for now)


Installation
------------

This section describes the procedure for installing MediaGrid as a stand-alone web application. MediaGrid requires CouchDB version 1.2.x or later, which is in the standard repositories for Debian Wheezy and Ubuntu 12.10 or above. If you have an older Linux OS, you can instead use [Build CouchDB](https://github.com/iriscouch/build-couchdb) to build the latest version of CouchDB.

    apt-get update && sudo apt-get install couchdb python python-pip python-dev git -y
    pip install couchapp

Now get the MediaGrid files:

    cd ~/
    git clone git://github.com/dismantl/MediaGrid.git

Modify the `bind_address` and `timeout` options in the CouchDB configuration file `/etc/couchdb/default.ini`:

    [httpd]
    bind_address = 0.0.0.0
    
    [couch_httpd_auth]
    timeout = 86400
    
Finally, add an admin user in `/etc/couchdb/local.ini`:

    [admins]
    adminuser = <PASSWORD>

replacing the above credentials with your own.  **Important: use unique, random passphrases for each and every node! This is because databases, and thus uploaded files, can be deleted remotely using admin credentials.**
    
Now Restart the CouchDB server:

`service couchdb restart`

Insert MediaGrid into the CouchDB server:

    couchapp push ~/MediaGrid/media http://adminuser:s3cr3tp4ssw0rd@localhost:5984/media
    couchapp push ~/MediaGrid/chat http://adminuser:s3cr3tp4ssw0rd@localhost:5984/chat

Finally, open up `http://localhost:5984/media/_design/media/index.html` in your web browser to get started. Have fun!


More info
-------------

For questions or comments, send me an e-mail to <EMAIL>.<commit_msg>updated installation instructions<commit_after>MediaGrid
=========

MediaGrid is a **takedown-resistant, distributed wireless infrastructure** allowing citizens to **communicate and share real-time photo and video documentation** at public demonstrations, without the need for internet access. A MediaGrid uses a replicated database running on a wireless mesh network of small, battery-powered devices. Smartphones (or any wifi-enabled device) within range can then connect to the wifi network to upload files and securely chat. **ALL files uploaded to the grid are completely recoverable even if most of the devices are confiscated or taken offline**. See the original (outdated) [design document](https://github.com/dismantl/MediaGrid/blob/master/MediaGrid.Design.pdf?raw=true) for more details.

MediaGrid can either be run as a simple web application on any linux server or as part of a fully automated and independent system using a [Raspberry Pi](http://www.raspberrypi.org/).

### Implemented: ###
* Web application for uploading, browsing, and viewing files
* Webchat, including private encrypted chatrooms and encrypted IM*

**\* NOTE: The cryptographic security currently used in MediaGrid chat has [known vulnerabilities](https://blog.crypto.cat/2013/07/new-critical-vulnerability-in-cryptocat-details/), and should not be used for extremely sensitive communications!**

### Partially implemented: ###
* Custom, zero-configuration Debian image for the Raspberry Pi, including automated discovery of, and replication with, other MediaGrid nodes using mDNS/DNSSD

### TODO: ###
* add Batman-Adv or BMX6 meshing
* smart replication algorithm
* documentation
* native Android, iOS clients
* [Serval](https://github.com/servalproject/) integration for signing files and wireless traffic


Hardware Requirements
------------

* Raspberry Pi
* SD Card (with enough space for file storage)
* Atheros-based USB WiFi adapter
* Power source (I'm working on a cheap, high capacity battery pack, but AC adapter will work for now)


Installation
------------

This section describes the procedure for installing MediaGrid as a stand-alone web application. MediaGrid requires CouchDB version 1.2.x or later, which is in the standard repositories for Debian Wheezy and Ubuntu 12.10 or above. If you have an older Linux OS, you can instead use [Build CouchDB](https://github.com/iriscouch/build-couchdb) to build the latest version of CouchDB.

    sudo apt-get update && sudo apt-get install couchdb python python-pip python-dev git -y
    sudo pip install couchapp

Now get the MediaGrid files:

    cd ~/
    git clone git://github.com/dismantl/MediaGrid.git

Modify the `bind_address` and `timeout` options in the CouchDB configuration file `/etc/couchdb/default.ini`:

    [httpd]
    bind_address = 0.0.0.0
    
    [couch_httpd_auth]
    timeout = 86400
    
Finally, add an admin user in `/etc/couchdb/local.ini`:

    [admins]
    adminuser = <PASSWORD>

replacing the above credentials with your own.  **Important: use unique, random passphrases for each and every node! This is because databases, and thus uploaded files, can be deleted remotely using admin credentials.**
    
Now Restart the CouchDB server:

`sudo service couchdb restart`

Insert MediaGrid into the CouchDB server:

    couchapp push ~/MediaGrid/media http://adminuser:s3cr3tp4ssw0rd@localhost:5984/media
    couchapp push ~/MediaGrid/chat http://adminuser:s3cr3tp4ssw0rd@localhost:5984/chat
replacing 'adminuser:<PASSWORD>' with your own credentials. 

Finally, open up `http://localhost:5984/media/_design/media/index.html` in your web browser to get started. Have fun!


More info
-------------

For questions or comments, send me an e-mail to <EMAIL>.
{'fraction_non_alphanumeric': 0.08745247148288973, 'fraction_numerical': 0.011406844106463879, 'mean_word_length': 4.344702467343977, 'pattern_counts': {'":': 0, '<': 8, '<?xml version=': 0, '>': 8, 'https://': 8, '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': '2784161', 'n_tokens_mistral': 2081, 'n_tokens_neox': 1935, 'n_words': 854}