<commit_before># Manually building CENO

What follows are instructions for manually building CENO from source.
The first thing you will need to get started with this is the [git Version Control System](https://www.git-scm.com/)
software.

Assuming you are using the command-line `git`, you can obtain a copy or `clone` of the CENO source
by running the following command

```bash
git clone https://github.com/equalitie/ceno
```

## Building the client-side components

The client-side components include everything a user needs to use CENO to circumvent censorship.
The components here provide user interface elements and utilities as well as a disitribution of Freenet
that will allow access to securely stored content.

The components include

1. [Firefox](https://github.com/equalitie/ceno/tree/master/ceno-firefox) and [Chrome](https://github.com/equalitie/ceno/tree/master/ceno-chrome) browser extensions
2. A [proxy server](https://github.com/equalitie/ceno/tree/master/ceno-client)
3. A [Freenet plugin](https://github.com/equalitie/ceno/tree/master/ceno-freenet)

### Prerequisites

1. Either the Mozilla Firefox or Google Chrome (or Chromium) web browser
2. The Google Golang compiler and toolset
3. Node.js and NPM (For packaging the Firefox extension and building the CENO Portal pages)
4. Apache Ant (for building the Freenet plugins)

#### Web Browser

To use CENO as it was intended, you will need to be using either

1. [Mozilla Firefox](https://www.mozilla.org/en-US/firefox/new/) or
2. [Google Chrome](https://www.google.com/chrome/) or [Chromium](https://www.chromium.org/)

#### Golang

First, you must have the most recent version of Google's Golang compiler installed.
See the [official site](https://golang.org/doc/install) for instructions.

You will then have to set environment variables that will specify where Go binaries can
be found and where the Go installation is located.  Assuming you installed Go to `/usr/local/go`,
run

```bash
export GOPATH=$HOME/go
export GOROOT=/usr/local/go
export PATH=$PATH:$GOROOT/bin
```

#### Node.js and NPM

You can download Node.js and NPM together directly from the [official site](https://nodejs.org/dist/v4.2.2/).

### Building the client

If you have already configured the client or would like to stick with the
default configuration, you can run the client by executing the following
commands into your operating system's terminal program.

```bash
# <path-to-ceno> must be replaced with the path to where you cloned CENO
cd <path-to-ceno>/ceno-client/
./build.sh
CENOLANG=<language> ./client
```

Where `language` is one of the supported languages (a `<language code>.json` file in
`ceno-client/translations`). E.g. `en-us` or `fr-fr`.

### Packaging the browser extensions

Once packaged, either browser extension can be installed by opening it in its respective browser.

#### Firefox extension

Mozilla Firefox extensions using the addon SDK as CENO does can be easily built using Mozilla's new<commit_msg>Remind to install `nodejs-legacy` in Debian-based systems.<commit_after># Manually building CENO

What follows are instructions for manually building CENO from source.
The first thing you will need to get started with this is the [git Version Control System](https://www.git-scm.com/)
software.

Assuming you are using the command-line `git`, you can obtain a copy or `clone` of the CENO source
by running the following command

```bash
git clone https://github.com/equalitie/ceno
```

## Building the client-side components

The client-side components include everything a user needs to use CENO to circumvent censorship.
The components here provide user interface elements and utilities as well as a distribution of Freenet
that will allow access to securely stored content.

The components include

1. [Firefox](https://github.com/equalitie/ceno/tree/master/ceno-firefox) and [Chrome](https://github.com/equalitie/ceno/tree/master/ceno-chrome) browser extensions
2. A [proxy server](https://github.com/equalitie/ceno/tree/master/ceno-client)
3. A [Freenet plugin](https://github.com/equalitie/ceno/tree/master/ceno-freenet)

### Prerequisites

1. Either the Mozilla Firefox or Google Chrome (or Chromium) web browser
2. The Google Golang compiler and toolset
3. Node.js and NPM (For packaging the Firefox extension and building the CENO Portal pages)
4. Apache Ant (for building the Freenet plugins)

#### Web Browser

To use CENO as it was intended, you will need to be using either

1. [Mozilla Firefox](https://www.mozilla.org/en-US/firefox/new/) or
2. [Google Chrome](https://www.google.com/chrome/) or [Chromium](https://www.chromium.org/)

#### Golang

First, you must have the most recent version of Google's Golang compiler installed.
See the [official site](https://golang.org/doc/install) for instructions.

You will then have to set environment variables that will specify where Go binaries can
be found and where the Go installation is located.  Assuming you installed Go to `/usr/local/go`,
run

```bash
export GOPATH=$HOME/go
export GOROOT=/usr/local/go
export PATH=$PATH:$GOROOT/bin
```

#### Node.js and NPM

You can download Node.js and NPM together directly from the [official site](https://nodejs.org/dist/v4.2.2/).
In Debian-based systems you should install the `nodejs-legacy` package along with `nodejs`.

### Building the client

If you have already configured the client or would like to stick with the
default configuration, you can run the client by executing the following
commands into your operating system's terminal program.

```bash
# <path-to-ceno> must be replaced with the path to where you cloned CENO
cd <path-to-ceno>/ceno-client/
./build.sh
CENOLANG=<language> ./client
```

Where `language` is one of the supported languages (a `<language code>.json` file in
`ceno-client/translations`). E.g. `en-us` or `fr-fr`.

### Packaging the browser extensions

Once packaged, either browser extension can be installed by opening it in its respective browser.

#### Firefox extension

Mozilla Firefox extensions using the addon SDK as CENO does can be easily built using Mozilla's new
{'fraction_non_alphanumeric': 0.09511315185306658, 'fraction_numerical': 0.003935716628402755, 'mean_word_length': 4.519457013574661, 'pattern_counts': {'":': 0, '<': 11, '<?xml version=': 0, '>': 11, 'https://': 22, 'lorem ipsum': 0, 'www.': 8, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 2, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2152129', 'n_tokens_mistral': 1809, 'n_tokens_neox': 1717, 'n_words': 753}