2015-11-04 05:57:54 +01:00
|
|
|
|
|
|
|
Installing the Zulip Development environment
|
|
|
|
============================================
|
|
|
|
|
2016-05-05 01:16:31 +02:00
|
|
|
* [Development environment setup for first-time
|
|
|
|
contributors](#development-environment-setup-for-first-time-contributors)
|
|
|
|
* [Brief installation instructions for Vagrant development
|
|
|
|
environment](#brief-installation-instructions-for-vagrant-development-environment)
|
|
|
|
* [Installing on Ubuntu 14.04 Trusty without
|
|
|
|
Vagrant](#installing-on-ubuntu-1404-trusty-without-vagrant) (possibly more
|
|
|
|
convenient but more work to maintain/uninstall)
|
|
|
|
* [Installing manually on UNIX-based
|
|
|
|
platforms](#installing-manually-on-unix-based-platforms)
|
|
|
|
* [Using Docker (experimental)](#using-docker-experimental)
|
|
|
|
* [Using the Development Environment](#using-the-development-environment)
|
|
|
|
* [Running the test suite](#running-the-test-suite)
|
2015-11-04 05:57:54 +01:00
|
|
|
|
2016-05-05 01:16:31 +02:00
|
|
|
Those who have installed Zulip before or are experienced at administering Linux
|
|
|
|
may wish to skip ahead to [Brief installation instructions for Vagrant
|
|
|
|
development environment](#brief-installation-instructions-for-vagrant-development-environment),
|
|
|
|
[Using Docker (experimental)](#using-docker-experimental), or [Installing
|
|
|
|
manually on UNIX-based platforms](#installing-manually-on-unix-based-platforms).
|
|
|
|
|
|
|
|
## Development environment setup for first-time contributors
|
|
|
|
|
2016-07-15 06:51:37 +02:00
|
|
|
See [the setup
|
|
|
|
guide](https://zulip.readthedocs.org/en/latest/dev-env-first-time-contributors.html).
|
2016-05-05 01:16:31 +02:00
|
|
|
|
|
|
|
Brief installation instructions for Vagrant development environment
|
2015-11-04 05:57:54 +01:00
|
|
|
-------------
|
|
|
|
|
2016-07-15 06:58:43 +02:00
|
|
|
See [the Vagrant guide](https://zulip.readthedocs.org/en/latest/brief-install-vagrant-dev.html).
|
2016-07-07 23:47:59 +02:00
|
|
|
|
2016-05-05 01:16:31 +02:00
|
|
|
Installing on Ubuntu 14.04 Trusty without Vagrant
|
2015-11-04 05:57:54 +01:00
|
|
|
----------------------------------
|
2016-07-15 20:01:07 +02:00
|
|
|
See [this guide](https://zulip.readthedocs.io/en/latest/install-ubuntu-without-vagrant-dev.html).
|
2016-05-05 01:16:31 +02:00
|
|
|
Installing manually on UNIX-based platforms
|
2015-11-04 05:57:54 +01:00
|
|
|
-------
|
2016-05-05 01:16:31 +02:00
|
|
|
|
|
|
|
* [Debian or Ubuntu systems](#on-debian-or-ubuntu-systems)
|
|
|
|
* [Fedora 22 (experimental)](#on-fedora-22-experimental)
|
|
|
|
* [CentOS 7 Core (experimental)](#on-centos-7-core-experimental)
|
|
|
|
* [OpenBSD 5.8 (experimental)](#on-openbsd-58-experimental)
|
|
|
|
* [Fedora/CentOS](#common-to-fedoracentos-instructions)
|
|
|
|
* [Steps for all systems](#all-systems)
|
|
|
|
|
|
|
|
If you really want to install everything manually, the below instructions
|
|
|
|
should work.
|
2015-11-04 05:57:54 +01:00
|
|
|
|
|
|
|
Install the following non-Python dependencies:
|
|
|
|
* libffi-dev — needed for some Python extensions
|
2016-03-21 04:42:35 +01:00
|
|
|
* postgresql 9.1 or later — our database (client, server, headers)
|
2015-11-17 18:59:21 +01:00
|
|
|
* nodejs 0.10 (and npm)
|
2015-11-04 05:57:54 +01:00
|
|
|
* memcached (and headers)
|
|
|
|
* rabbitmq-server
|
|
|
|
* libldap2-dev
|
|
|
|
* python-dev
|
|
|
|
* redis-server — rate limiting
|
|
|
|
* tsearch-extras — better text search
|
2016-03-21 04:43:44 +01:00
|
|
|
* libfreetype6-dev — needed before you pip install Pillow to properly generate emoji PNGs
|
2015-11-04 05:57:54 +01:00
|
|
|
|
2015-11-04 05:59:28 +01:00
|
|
|
### On Debian or Ubuntu systems:
|
2015-11-04 05:57:54 +01:00
|
|
|
|
2016-05-05 01:16:31 +02:00
|
|
|
#### Using the official Ubuntu repositories and `tsearch-extras` deb package:
|
|
|
|
|
|
|
|
Start by cloning this repository: `git clone
|
|
|
|
https://github.com/zulip/zulip.git`
|
2016-05-10 22:45:16 +02:00
|
|
|
|
2015-11-04 05:57:54 +01:00
|
|
|
```
|
2016-03-21 04:40:10 +01:00
|
|
|
sudo apt-get install closure-compiler libfreetype6-dev libffi-dev \
|
|
|
|
memcached rabbitmq-server libldap2-dev redis-server \
|
|
|
|
postgresql-server-dev-all libmemcached-dev python-dev \
|
|
|
|
hunspell-en-us nodejs nodejs-legacy npm git yui-compressor \
|
|
|
|
puppet gettext
|
2015-11-04 05:57:54 +01:00
|
|
|
|
|
|
|
# If on 12.04 or wheezy:
|
|
|
|
sudo apt-get install postgresql-9.1
|
|
|
|
wget https://dl.dropboxusercontent.com/u/283158365/zuliposs/postgresql-9.1-tsearch-extras_0.1.2_amd64.deb
|
|
|
|
sudo dpkg -i postgresql-9.1-tsearch-extras_0.1.2_amd64.deb
|
|
|
|
|
|
|
|
# If on 14.04:
|
|
|
|
sudo apt-get install postgresql-9.3
|
|
|
|
wget https://dl.dropboxusercontent.com/u/283158365/zuliposs/postgresql-9.3-tsearch-extras_0.1.2_amd64.deb
|
|
|
|
sudo dpkg -i postgresql-9.3-tsearch-extras_0.1.2_amd64.deb
|
|
|
|
|
|
|
|
# If on 15.04 or jessie:
|
|
|
|
sudo apt-get install postgresql-9.4
|
|
|
|
wget https://dl.dropboxusercontent.com/u/283158365/zuliposs/postgresql-9.4-tsearch-extras_0.1_amd64.deb
|
|
|
|
sudo dpkg -i postgresql-9.4-tsearch-extras_0.1_amd64.deb
|
|
|
|
```
|
|
|
|
|
2016-05-05 01:16:31 +02:00
|
|
|
Now continue with the [All Systems](#all-systems) instructions below.
|
|
|
|
|
|
|
|
#### Using the [official Zulip PPA](https://launchpad.net/~tabbott/+archive/ubuntu/zulip/+packages) (for 14.04 Trusty):
|
|
|
|
|
|
|
|
Start by cloning this repository: `git clone
|
|
|
|
https://github.com/zulip/zulip.git`
|
2016-05-10 22:45:16 +02:00
|
|
|
|
|
|
|
```
|
|
|
|
sudo add-apt-repository ppa:tabbott/zulip
|
|
|
|
sudo apt-get update
|
|
|
|
sudo apt-get install closure-compiler libfreetype6-dev libffi-dev \
|
|
|
|
memcached rabbitmq-server libldap2-dev redis-server \
|
|
|
|
postgresql-server-dev-all libmemcached-dev python-dev \
|
|
|
|
hunspell-en-us nodejs nodejs-legacy npm git yui-compressor \
|
|
|
|
puppet gettext tsearch-extras
|
|
|
|
```
|
|
|
|
|
2016-05-05 01:16:31 +02:00
|
|
|
Now continue with the [All Systems](#all-systems) instructions below.
|
2015-11-04 05:57:54 +01:00
|
|
|
|
2015-11-04 05:59:28 +01:00
|
|
|
### On Fedora 22 (experimental):
|
2015-11-04 05:57:54 +01:00
|
|
|
|
2016-03-21 04:40:10 +01:00
|
|
|
These instructions are experimental and may have bugs; patches
|
|
|
|
welcome!
|
2015-11-04 05:57:54 +01:00
|
|
|
|
2016-05-05 01:16:31 +02:00
|
|
|
Start by cloning this repository: `git clone
|
|
|
|
https://github.com/zulip/zulip.git`
|
|
|
|
|
2015-11-04 05:57:54 +01:00
|
|
|
```
|
2016-03-21 04:40:10 +01:00
|
|
|
sudo dnf install libffi-devel memcached rabbitmq-server \
|
|
|
|
openldap-devel python-devel redis postgresql-server \
|
|
|
|
postgresql-devel postgresql libmemcached-devel freetype-devel \
|
|
|
|
nodejs npm yuicompressor closure-compiler gettext
|
2015-11-04 05:57:54 +01:00
|
|
|
```
|
|
|
|
|
2016-05-05 01:16:31 +02:00
|
|
|
Finally continue with the [All Systems](#all-systems) instructions below.
|
2015-11-04 05:57:54 +01:00
|
|
|
|
2015-11-04 05:59:28 +01:00
|
|
|
### On CentOS 7 Core (experimental):
|
2015-11-04 05:57:54 +01:00
|
|
|
|
2016-03-21 04:40:10 +01:00
|
|
|
These instructions are experimental and may have bugs; patches
|
|
|
|
welcome!
|
2015-11-04 05:57:54 +01:00
|
|
|
|
2016-05-05 01:16:31 +02:00
|
|
|
Start by cloning this repository: `git clone
|
|
|
|
https://github.com/zulip/zulip.git`
|
|
|
|
|
2015-11-04 05:57:54 +01:00
|
|
|
```
|
2016-03-21 04:40:10 +01:00
|
|
|
# Add user zulip to the system (not necessary if you configured zulip
|
|
|
|
# as the administrator user during the install process of CentOS 7).
|
2015-11-04 05:57:54 +01:00
|
|
|
useradd zulip
|
|
|
|
|
|
|
|
# Create a password for zulip user
|
|
|
|
passwd zulip
|
|
|
|
|
|
|
|
# Allow zulip to sudo
|
|
|
|
visudo
|
|
|
|
# Add this line after line `root ALL=(ALL) ALL`
|
|
|
|
zulip ALL=(ALL) ALL
|
|
|
|
|
|
|
|
# Switch to zulip user
|
|
|
|
su zulip
|
|
|
|
|
2016-03-21 04:40:10 +01:00
|
|
|
# Enable EPEL 7 repo so we can install rabbitmq-server, redis and
|
|
|
|
# other dependencies
|
2015-11-04 05:57:54 +01:00
|
|
|
sudo yum install https://dl.fedoraproject.org/pub/epel/epel-release-latest-7.noarch.rpm
|
|
|
|
|
|
|
|
# Install dependencies
|
2016-05-20 04:41:33 +02:00
|
|
|
sudo yum install libffi-devel memcached rabbitmq-server openldap-devel \
|
2016-03-21 04:40:10 +01:00
|
|
|
python-devel redis postgresql-server postgresql-devel postgresql \
|
|
|
|
libmemcached-devel wget python-pip openssl-devel freetype-devel \
|
|
|
|
libjpeg-turbo-devel zlib-devel nodejs yuicompressor \
|
|
|
|
closure-compiler gettext
|
2015-11-04 05:57:54 +01:00
|
|
|
|
|
|
|
# We need these packages to compile tsearch-extras
|
|
|
|
sudo yum groupinstall "Development Tools"
|
|
|
|
|
|
|
|
# clone Zulip's git repo and cd into it
|
|
|
|
cd && git clone https://github.com/zulip/zulip && cd zulip/
|
|
|
|
|
2015-11-04 06:04:05 +01:00
|
|
|
## NEEDS TESTING: The next few DB setup items may not be required at all.
|
2015-11-04 05:57:54 +01:00
|
|
|
# Initialize the postgres db
|
|
|
|
sudo postgresql-setup initdb
|
|
|
|
|
|
|
|
# Edit the postgres settings:
|
|
|
|
sudo vi /var/lib/pgsql/data/pg_hba.conf
|
|
|
|
|
|
|
|
# Change these lines:
|
|
|
|
host all all 127.0.0.1/32 ident
|
|
|
|
host all all ::1/128 ident
|
|
|
|
# to this:
|
|
|
|
host all all 127.0.0.1/32 md5
|
|
|
|
host all all ::1/128 md5
|
2015-11-04 06:04:05 +01:00
|
|
|
```
|
|
|
|
|
2016-05-05 01:16:31 +02:00
|
|
|
Now continue with the [Common to Fedora/CentOS](#common-to-fedoracentos-instructions) instructions below.
|
2015-11-04 06:04:05 +01:00
|
|
|
|
2016-01-12 13:08:43 +01:00
|
|
|
### On OpenBSD 5.8 (experimental):
|
|
|
|
|
2016-03-21 04:40:10 +01:00
|
|
|
These instructions are experimental and may have bugs; patches
|
|
|
|
welcome!
|
2016-01-12 13:08:43 +01:00
|
|
|
|
2016-05-05 01:16:31 +02:00
|
|
|
Start by cloning this repository: `git clone
|
|
|
|
https://github.com/zulip/zulip.git`
|
|
|
|
|
2016-01-12 13:08:43 +01:00
|
|
|
```
|
2016-03-21 04:40:10 +01:00
|
|
|
doas pkg_add sudo bash gcc postgresql-server redis rabbitmq \
|
|
|
|
memcached node libmemcached py-Pillow py-cryptography py-cffi
|
2016-01-12 13:08:43 +01:00
|
|
|
|
2016-03-21 04:40:10 +01:00
|
|
|
# Get tsearch_extras and build it (using a modified version which
|
|
|
|
# aliases int4 on OpenBSD):
|
2016-01-12 13:08:43 +01:00
|
|
|
git clone https://github.com/blablacio/tsearch_extras
|
|
|
|
cd tsearch_extras
|
|
|
|
gmake && sudo gmake install
|
|
|
|
|
2016-03-21 04:40:10 +01:00
|
|
|
# Point environment to custom include locations and use newer GCC
|
|
|
|
# (needed for Node modules):
|
2016-01-12 13:08:43 +01:00
|
|
|
export CFLAGS="-I/usr/local/include -I/usr/local/include/sasl"
|
|
|
|
export CXX=eg++
|
|
|
|
|
|
|
|
# Create tsearch_data directory:
|
|
|
|
sudo mkdir /usr/local/share/postgresql/tsearch_data
|
|
|
|
|
|
|
|
|
2016-03-21 04:40:10 +01:00
|
|
|
# Hack around missing dictionary files -- need to fix this to get the
|
|
|
|
# proper dictionaries from what in debian is the hunspell-en-us
|
|
|
|
# package.
|
2016-01-12 13:08:43 +01:00
|
|
|
sudo touch /usr/local/share/postgresql/tsearch_data/english.stop
|
|
|
|
sudo touch /usr/local/share/postgresql/tsearch_data/en_us.dict
|
|
|
|
sudo touch /usr/local/share/postgresql/tsearch_data/en_us.affix
|
|
|
|
```
|
|
|
|
|
2016-05-05 01:16:31 +02:00
|
|
|
Finally continue with the [All Systems](#all-systems) instructions below.
|
2016-01-12 13:08:43 +01:00
|
|
|
|
2015-11-04 06:04:05 +01:00
|
|
|
### Common to Fedora/CentOS instructions
|
|
|
|
|
2016-05-05 01:16:31 +02:00
|
|
|
Start by cloning this repository: `git clone
|
|
|
|
https://github.com/zulip/zulip.git`
|
|
|
|
|
2015-11-04 06:04:05 +01:00
|
|
|
```
|
|
|
|
# Build and install postgres tsearch-extras module
|
|
|
|
wget https://launchpad.net/~tabbott/+archive/ubuntu/zulip/+files/tsearch-extras_0.1.3.tar.gz
|
|
|
|
tar xvzf tsearch-extras_0.1.3.tar.gz
|
|
|
|
cd ts2
|
|
|
|
make
|
|
|
|
sudo make install
|
|
|
|
|
2016-03-21 04:40:10 +01:00
|
|
|
# Hack around missing dictionary files -- need to fix this to get the
|
|
|
|
# proper dictionaries from what in debian is the hunspell-en-us
|
|
|
|
# package.
|
2015-11-04 06:04:05 +01:00
|
|
|
sudo touch /usr/share/pgsql/tsearch_data/english.stop
|
|
|
|
sudo touch /usr/share/pgsql/tsearch_data/en_us.dict
|
|
|
|
sudo touch /usr/share/pgsql/tsearch_data/en_us.affix
|
|
|
|
|
|
|
|
# Edit the postgres settings:
|
|
|
|
sudo vi /var/lib/pgsql/data/pg_hba.conf
|
|
|
|
|
2016-03-21 04:40:10 +01:00
|
|
|
# Add this line before the first uncommented line to enable password
|
|
|
|
# auth:
|
2015-11-04 06:04:05 +01:00
|
|
|
host all all 127.0.0.1/32 md5
|
2015-11-04 05:57:54 +01:00
|
|
|
|
|
|
|
# Start the services
|
2015-11-04 06:04:05 +01:00
|
|
|
sudo systemctl start redis memcached rabbitmq-server postgresql
|
2015-11-04 05:57:54 +01:00
|
|
|
|
|
|
|
# Enable automatic service startup after the system startup
|
|
|
|
sudo systemctl enable redis rabbitmq-server memcached postgresql
|
|
|
|
```
|
|
|
|
|
2016-05-05 01:16:31 +02:00
|
|
|
Finally continue with the [All Systems](#all-systems) instructions below.
|
2015-11-04 05:57:54 +01:00
|
|
|
|
2015-11-04 05:59:28 +01:00
|
|
|
### All Systems:
|
2015-11-04 05:57:54 +01:00
|
|
|
|
2016-05-05 01:16:31 +02:00
|
|
|
Make sure you have followed the steps specific for your platform:
|
|
|
|
|
|
|
|
* [Debian or Ubuntu systems](#on-debian-or-ubuntu-systems)
|
|
|
|
* [Fedora 22 (experimental)](#on-fedora-22-experimental)
|
|
|
|
* [CentOS 7 Core (experimental)](#on-centos-7-core-experimental)
|
|
|
|
* [OpenBSD 5.8 (experimental)](#on-openbsd-58-experimental)
|
|
|
|
* [Fedora/CentOS](#common-to-fedoracentos-instructions)
|
|
|
|
|
2016-06-21 06:16:44 +02:00
|
|
|
For managing Zulip's python dependencies, we recommend using a
|
|
|
|
[virtualenv](https://virtualenv.pypa.io/en/stable/).
|
|
|
|
|
|
|
|
Once you have created and activated a virtualenv, do the following:
|
2016-05-05 01:16:31 +02:00
|
|
|
|
2015-11-04 05:57:54 +01:00
|
|
|
```
|
2016-06-21 06:16:44 +02:00
|
|
|
pip install --upgrade pip # upgrade pip itself because older versions have known issues.
|
2016-07-02 05:51:10 +02:00
|
|
|
pip install --no-deps -r requirements/py2_dev.txt # install python packages required for development
|
2016-05-26 13:21:55 +02:00
|
|
|
./tools/setup/install-phantomjs
|
2016-04-27 09:34:17 +02:00
|
|
|
./tools/install-mypy
|
2016-05-26 12:28:45 +02:00
|
|
|
./tools/setup/download-zxcvbn
|
2016-07-08 00:11:26 +02:00
|
|
|
./tools/setup/emoji_dump/build_emoji
|
2015-11-04 05:57:54 +01:00
|
|
|
./scripts/setup/generate_secrets.py -d
|
2016-07-08 00:12:37 +02:00
|
|
|
if [ $(uname) = "OpenBSD" ]; then sudo cp ./puppet/zulip/files/postgresql/zulip_english.stop /var/postgresql/tsearch_data/; else sudo cp ./puppet/zulip/files/postgresql/zulip_english.stop /usr/share/postgresql/9.*/tsearch_data/; fi
|
2015-11-04 05:57:54 +01:00
|
|
|
./scripts/setup/configure-rabbitmq
|
2016-05-26 12:44:30 +02:00
|
|
|
./tools/setup/postgres-init-dev-db
|
2015-11-04 05:57:54 +01:00
|
|
|
./tools/do-destroy-rebuild-database
|
2016-05-26 12:45:58 +02:00
|
|
|
./tools/setup/postgres-init-test-db
|
2015-11-04 05:57:54 +01:00
|
|
|
./tools/do-destroy-rebuild-test-database
|
2016-05-02 10:20:00 +02:00
|
|
|
./manage.py compilemessages
|
2016-03-30 06:56:19 +02:00
|
|
|
npm install
|
2015-11-04 05:57:54 +01:00
|
|
|
```
|
|
|
|
|
2016-04-07 00:42:53 +02:00
|
|
|
If `npm install` fails, the issue may be that you need a newer version
|
|
|
|
of `npm`. You can use `npm install -g npm` to update your version of
|
|
|
|
`npm` and try again.
|
|
|
|
|
2015-11-04 05:57:54 +01:00
|
|
|
To start the development server:
|
|
|
|
|
|
|
|
```
|
|
|
|
./tools/run-dev.py
|
|
|
|
```
|
|
|
|
|
|
|
|
… and visit [http://localhost:9991/](http://localhost:9991/).
|
|
|
|
|
2016-04-13 18:02:44 +02:00
|
|
|
#### Proxy setup for by-hand installation
|
|
|
|
|
|
|
|
If you are building the development environment on a network where a
|
|
|
|
proxy is required to access the Internet, you will need to set the
|
|
|
|
proxy in the environment as follows:
|
|
|
|
|
|
|
|
- On Ubuntu, set the proxy environment variables using:
|
|
|
|
```
|
|
|
|
export https_proxy=http://proxy_host:port
|
|
|
|
export http_proxy=http://proxy_host:port
|
|
|
|
```
|
|
|
|
|
|
|
|
- And set the npm proxy and https-proxy using:
|
|
|
|
```
|
|
|
|
npm config set proxy http://proxy_host:port
|
|
|
|
npm config set https-proxy http://proxy_host:port
|
|
|
|
```
|
|
|
|
|
2016-04-30 01:15:14 +02:00
|
|
|
Using Docker (experimental)
|
|
|
|
---------------------------
|
2016-07-15 19:47:25 +02:00
|
|
|
See [the Docker instructions](https://zulip.readthedocs.io/en/latest/install-docker-dev.html).
|
2015-12-12 14:17:30 +01:00
|
|
|
|
2016-07-15 20:43:09 +02:00
|
|
|
[using-dev]: https://zulip.readthedocs.io/en/latest/using-dev-environment.html
|
|
|
|
|
2015-11-04 05:57:54 +01:00
|
|
|
|
2015-11-15 23:25:04 +01:00
|
|
|
Using the Development Environment
|
|
|
|
=================================
|
|
|
|
|
2016-07-15 20:43:09 +02:00
|
|
|
See [this guide](https://zulip.readthedocs.io/en/latest/using-dev-environment.html).
|
2015-11-15 23:25:04 +01:00
|
|
|
|
2016-03-21 04:40:10 +01:00
|
|
|
[django-runserver]: https://docs.djangoproject.com/en/1.8/ref/django-admin/#runserver-port-or-address-port
|
2016-04-30 01:00:06 +02:00
|
|
|
[new-feature-tutorial]: http://zulip.readthedocs.io/en/latest/new-feature-tutorial.html
|
|
|
|
[testing-docs]: http://zulip.readthedocs.io/en/latest/testing.html
|
2016-03-21 04:40:10 +01:00
|
|
|
|
2016-07-15 06:51:37 +02:00
|
|
|
[dev-install]: http://zulip.readthedocs.io/en/latest/dev-install-choices.html
|
2016-07-15 06:58:43 +02:00
|
|
|
[vagrant-dl]: https://www.vagrantup.com/downloads.html
|
|
|
|
[vagrant-lxc]: https://github.com/fgrehm/vagrant-lxc
|
|
|
|
[vbox-dl]: https://www.virtualbox.org/wiki/Downloads
|
|
|
|
[avoiding-sudo]: https://github.com/fgrehm/vagrant-lxc#avoiding-sudo-passwords
|
2016-07-15 19:47:25 +02:00
|
|
|
|
|
|
|
Running the test suite
|
|
|
|
======================
|
|
|
|
|
|
|
|
See [the developer testing
|
|
|
|
guide)[https://zulip.readthedocs.org/en/latest/test-suite-dev.html).
|