2020-08-11 01:47:54 +02:00
|
|
|
# Advanced setup (non-Vagrant)
|
2016-11-28 02:50:33 +01:00
|
|
|
|
|
|
|
Contents:
|
|
|
|
|
2018-12-18 15:03:05 +01:00
|
|
|
* [Installing directly on Ubuntu, Debian, Centos, or Fedora](#installing-directly-on-ubuntu-debian-centos-or-fedora)
|
2020-04-08 07:59:44 +02:00
|
|
|
* [Installing directly on Windows 10](#installing-directly-on-windows-10-experimental)
|
2019-03-10 01:23:43 +01:00
|
|
|
* [Installing manually on other Linux/UNIX](#installing-manually-on-unix)
|
2018-04-02 07:13:38 +02:00
|
|
|
* [Installing directly on cloud9](#installing-on-cloud9)
|
2016-11-28 02:50:33 +01:00
|
|
|
|
2018-12-17 23:34:38 +01:00
|
|
|
## Installing directly on Ubuntu, Debian, Centos, or Fedora
|
2016-11-28 02:50:33 +01:00
|
|
|
|
2018-05-30 18:42:03 +02:00
|
|
|
If you'd like to install a Zulip development environment on a computer
|
|
|
|
that's running one of:
|
|
|
|
|
2020-04-17 20:00:24 +02:00
|
|
|
* Ubuntu 20.04 Focal, 18.04 Bionic
|
|
|
|
* Debian 10 Buster
|
2018-12-17 23:34:38 +01:00
|
|
|
* Centos 7 (beta)
|
|
|
|
* Fedora 29 (beta)
|
2018-12-19 00:41:56 +01:00
|
|
|
* RHEL 7 (beta)
|
2018-05-30 18:42:03 +02:00
|
|
|
|
|
|
|
You can just run the Zulip provision script on your machine.
|
|
|
|
|
2018-10-20 05:52:38 +02:00
|
|
|
**Note**: you should not use the `root` user to run the installation.
|
2019-09-30 19:37:56 +02:00
|
|
|
If you are using a [remote server](../development/remote.md), see
|
2018-10-20 05:52:38 +02:00
|
|
|
the
|
2019-04-06 02:58:44 +02:00
|
|
|
[section on creating appropriate user accounts](../development/remote.html#setting-up-user-accounts).
|
2018-10-20 05:52:38 +02:00
|
|
|
|
2019-10-10 06:33:59 +02:00
|
|
|
```eval_rst
|
|
|
|
.. warning::
|
|
|
|
there is no supported uninstallation process with this
|
|
|
|
method. If you want that, use the Vagrant environment, where you can
|
|
|
|
just do `vagrant destroy` to clean up the development environment.
|
|
|
|
```
|
2018-05-30 18:42:03 +02:00
|
|
|
|
2018-02-16 11:42:34 +01:00
|
|
|
Start by [cloning your fork of the Zulip repository][zulip-rtd-git-cloning]
|
|
|
|
and [connecting the Zulip upstream repository][zulip-rtd-git-connect]:
|
2017-10-17 04:13:46 +02:00
|
|
|
|
2018-02-16 11:42:34 +01:00
|
|
|
```
|
2020-05-21 22:05:57 +02:00
|
|
|
git clone --config pull.rebase git@github.com:YOURUSERNAME/zulip.git
|
2018-05-06 11:30:15 +02:00
|
|
|
cd zulip
|
2018-02-16 11:42:34 +01:00
|
|
|
git remote add -f upstream https://github.com/zulip/zulip.git
|
|
|
|
```
|
2016-11-28 02:50:33 +01:00
|
|
|
|
|
|
|
```
|
2019-01-04 21:29:52 +01:00
|
|
|
# On CentOS/RHEL, you must first install epel-release, and then python36,
|
2019-01-04 21:29:52 +01:00
|
|
|
# and finally you must run `sudo ln -nsf /usr/bin/python36 /usr/bin/python3`
|
2018-12-18 14:58:52 +01:00
|
|
|
# On Fedora, you must first install python3
|
2016-11-28 02:50:33 +01:00
|
|
|
# From a clone of zulip.git
|
2017-01-14 11:19:26 +01:00
|
|
|
./tools/provision
|
2017-08-09 00:44:40 +02:00
|
|
|
source /srv/zulip-py3-venv/bin/activate
|
2016-11-28 02:50:33 +01:00
|
|
|
./tools/run-dev.py # starts the development server
|
|
|
|
```
|
|
|
|
|
|
|
|
Once you've done the above setup, you can pick up the [documentation
|
|
|
|
on using the Zulip development
|
2019-04-06 02:58:44 +02:00
|
|
|
environment](../development/setup-vagrant.html#step-4-developing),
|
2016-11-28 02:50:33 +01:00
|
|
|
ignoring the parts about `vagrant` (since you're not using it).
|
|
|
|
|
2020-08-11 01:47:54 +02:00
|
|
|
## Installing directly on Windows 10 (experimental)
|
2020-04-08 07:59:44 +02:00
|
|
|
|
|
|
|
We will be using Microsoft's new feature [WSL
|
|
|
|
2](https://docs.microsoft.com/en-us/windows/wsl/wsl2-about) for
|
|
|
|
installation.
|
|
|
|
|
|
|
|
1. Install WSL 2 by following the instructions provided by Microsoft
|
|
|
|
[here](https://docs.microsoft.com/en-us/windows/wsl/wsl2-install).
|
|
|
|
|
|
|
|
1. Install the `Ubuntu 18.04` Linux distribution from the Microsoft
|
|
|
|
Store.
|
|
|
|
|
|
|
|
1. Launch the `Ubuntu 18.04` shell and run the following commands:
|
|
|
|
|
|
|
|
```
|
|
|
|
sudo apt update && sudo apt upgrade
|
|
|
|
sudo apt install rabbitmq-server memcached redis-server postgresql
|
|
|
|
```
|
|
|
|
|
2020-04-18 19:20:38 +02:00
|
|
|
1. Open `/etc/rabbitmq/rabbitmq-env.conf` using e.g.:
|
2020-04-08 07:59:44 +02:00
|
|
|
|
|
|
|
```
|
2020-04-18 19:20:38 +02:00
|
|
|
sudo vim /etc/rabbitmq/rabbitmq-env.conf
|
2020-04-08 07:59:44 +02:00
|
|
|
```
|
|
|
|
|
|
|
|
Add the following lines at the end of your file and save:
|
|
|
|
|
|
|
|
```
|
|
|
|
NODE_IP_ADDRESS=127.0.0.1
|
|
|
|
NODE_PORT=5672
|
|
|
|
```
|
|
|
|
|
|
|
|
1. [Clone your fork of the Zulip repository][zulip-rtd-git-cloning]
|
|
|
|
and [connecting the Zulip upstream repository][zulip-rtd-git-connect]:
|
|
|
|
|
|
|
|
```
|
2020-05-21 22:05:57 +02:00
|
|
|
git clone --config pull.rebase git@github.com:YOURUSERNAME/zulip.git ~/zulip
|
|
|
|
cd zulip
|
2020-04-08 07:59:44 +02:00
|
|
|
git remote add -f upstream https://github.com/zulip/zulip.git
|
|
|
|
```
|
|
|
|
|
|
|
|
1. Run the following to install the Zulip development environment and
|
|
|
|
start it (click `Allow access` if you get popups for Windows Firewall
|
|
|
|
blocking some services)
|
|
|
|
|
|
|
|
```
|
|
|
|
# Start database, cache, and other services
|
|
|
|
./tools/wsl/start_services
|
|
|
|
# Install/update the Zulip development environment
|
|
|
|
./tools/provision
|
|
|
|
# Enter the Zulip Python environment
|
|
|
|
source /srv/zulip-py3-venv/bin/activate
|
|
|
|
# Start the development server
|
|
|
|
./tools/run-dev.py
|
|
|
|
```
|
|
|
|
|
|
|
|
```eval_rst
|
|
|
|
.. note::
|
|
|
|
If you shutdown WSL, after starting it again, you will have to manually start
|
|
|
|
the services using ``./tools/wsl/start_services``.
|
|
|
|
```
|
|
|
|
|
2020-04-21 07:38:19 +02:00
|
|
|
1. If you are facing problems or you see error messages after running `./tools/run-dev.py`,
|
|
|
|
you can try running `./tools/provision` again.
|
|
|
|
|
|
|
|
1. [Visual Studio Code Remote - WSL](https://code.visualstudio.com/docs/remote/wsl) is
|
|
|
|
recommended for editing files when developing with WSL.
|
|
|
|
|
2020-04-08 07:59:44 +02:00
|
|
|
1. You're done! You can pick up the [documentation on using the
|
|
|
|
Zulip development
|
|
|
|
environment](../development/setup-vagrant.html#step-4-developing),
|
|
|
|
ignoring the parts about `vagrant` (since you're not using it).
|
|
|
|
|
2019-03-10 01:23:43 +01:00
|
|
|
## Installing manually on Unix
|
2016-11-28 02:50:33 +01:00
|
|
|
|
2019-03-10 01:23:43 +01:00
|
|
|
We recommend one of the other installation methods, since they are
|
|
|
|
extremely well-tested and generally Just Work. But if you know what
|
|
|
|
you're doing, these instructions can help you install a Zulip
|
|
|
|
development environment on other Linux/UNIX platforms.
|
2018-05-24 18:47:18 +02:00
|
|
|
|
2019-03-10 01:23:43 +01:00
|
|
|
* [Newer versions of supported distributions](#newer-versions-of-supported-distributions)
|
2016-11-28 02:50:33 +01:00
|
|
|
* [OpenBSD 5.8 (experimental)](#on-openbsd-5-8-experimental)
|
2019-03-10 01:23:43 +01:00
|
|
|
* [Common steps](#common-steps)
|
2016-11-28 02:50:33 +01:00
|
|
|
|
2019-03-10 01:23:43 +01:00
|
|
|
Because copy-pasting the steps documented here can be error-prone, we
|
|
|
|
prefer to extend `tools/provision` to support additional platforms
|
|
|
|
over adding new platforms to this documentation (and likely will
|
|
|
|
eventually eliminate this documentation section altogether).
|
2016-11-28 02:50:33 +01:00
|
|
|
|
2019-03-10 01:23:43 +01:00
|
|
|
### Newer versions of supported distributions
|
2016-11-28 02:50:33 +01:00
|
|
|
|
2019-03-10 01:23:43 +01:00
|
|
|
You can use
|
|
|
|
[our provisioning tool](#installing-directly-on-ubuntu-debian-centos-or-fedora)
|
2020-08-11 01:47:54 +02:00
|
|
|
to set up the Zulip development environment on current versions of
|
2019-03-10 01:23:43 +01:00
|
|
|
these platforms reliably and easily, so we no long maintain manual
|
|
|
|
installation instructions for these platforms.
|
2016-11-28 02:50:33 +01:00
|
|
|
|
2019-03-10 01:23:43 +01:00
|
|
|
If `tools/provision` doesn't yet support a newer release of Debian or
|
|
|
|
Ubuntu that you're using, we'd love to add support for it. It's
|
|
|
|
likely only a few lines of changes to `tools/lib/provision.py` and
|
|
|
|
`scripts/lib/setup-apt-repo` if you'd like to do it yourself and
|
|
|
|
submit a pull request, or you can ask for help in
|
|
|
|
[#development help](https://chat.zulip.org/#narrow/stream/49-development-help)
|
|
|
|
on chat.zulip.org, and a core team member can help add support for you.
|
2016-11-28 02:50:33 +01:00
|
|
|
|
|
|
|
### On OpenBSD 5.8 (experimental):
|
|
|
|
|
|
|
|
These instructions are experimental and may have bugs; patches
|
|
|
|
welcome!
|
|
|
|
|
2018-02-16 11:42:34 +01:00
|
|
|
Start by [cloning your fork of the Zulip repository][zulip-rtd-git-cloning]
|
|
|
|
and [connecting the Zulip upstream repository][zulip-rtd-git-connect]:
|
2017-10-17 04:13:46 +02:00
|
|
|
|
2018-02-16 11:42:34 +01:00
|
|
|
```
|
2020-05-21 22:05:57 +02:00
|
|
|
git clone --config pull.rebase git@github.com:YOURUSERNAME/zulip.git
|
|
|
|
cd zulip
|
2018-02-16 11:42:34 +01:00
|
|
|
git remote add -f upstream https://github.com/zulip/zulip.git
|
|
|
|
```
|
2016-11-28 02:50:33 +01:00
|
|
|
|
|
|
|
```
|
|
|
|
doas pkg_add sudo bash gcc postgresql-server redis rabbitmq \
|
2020-05-09 22:23:33 +02:00
|
|
|
memcached py-Pillow py-cryptography py-cffi
|
2016-11-28 02:50:33 +01:00
|
|
|
|
|
|
|
# Point environment to custom include locations and use newer GCC
|
|
|
|
# (needed for Node modules):
|
|
|
|
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
|
|
|
|
|
|
|
|
|
|
|
|
# Hack around missing dictionary files -- need to fix this to get the
|
|
|
|
# proper dictionaries from what in debian is the hunspell-en-us
|
|
|
|
# package.
|
|
|
|
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
|
|
|
|
```
|
|
|
|
|
2019-03-10 01:23:43 +01:00
|
|
|
Finally continue with the [Common steps](#common-steps) instructions below.
|
2016-11-28 02:50:33 +01:00
|
|
|
|
2019-03-10 01:23:43 +01:00
|
|
|
### Common steps
|
2016-11-28 02:50:33 +01:00
|
|
|
|
|
|
|
Make sure you have followed the steps specific for your platform:
|
|
|
|
|
|
|
|
* [OpenBSD 5.8 (experimental)](#on-openbsd-5-8-experimental)
|
|
|
|
|
|
|
|
For managing Zulip's python dependencies, we recommend using
|
|
|
|
[virtualenvs](https://virtualenv.pypa.io/en/stable/).
|
|
|
|
|
2017-05-11 13:59:07 +02:00
|
|
|
You must create a Python 3 virtualenv. You must also install appropriate
|
|
|
|
python packages in it.
|
2016-11-28 02:50:33 +01:00
|
|
|
|
2017-05-11 13:59:07 +02:00
|
|
|
You should either install the virtualenv in `/srv`, or put a symlink to it in
|
|
|
|
`/srv`. If you don't do that, some scripts might not work correctly.
|
2016-11-28 02:50:33 +01:00
|
|
|
|
2017-05-11 13:59:07 +02:00
|
|
|
You can run `python3 tools/setup/setup_venvs.py`. This script will create a
|
|
|
|
virtualenv `/srv/zulip-py3-venv`.
|
2016-11-28 02:50:33 +01:00
|
|
|
|
|
|
|
If you want to do it manually, here are the steps:
|
|
|
|
|
|
|
|
```
|
|
|
|
sudo virtualenv /srv/zulip-py3-venv -p python3 # Create a python3 virtualenv
|
2019-08-14 23:58:26 +02:00
|
|
|
sudo chown -R `whoami`: /srv/zulip-py3-venv
|
2016-11-28 02:50:33 +01:00
|
|
|
source /srv/zulip-py3-venv/bin/activate # Activate python3 virtualenv
|
|
|
|
pip install --upgrade pip # upgrade pip itself because older versions have known issues
|
2017-11-17 02:41:06 +01:00
|
|
|
pip install --no-deps -r requirements/dev.txt # install python packages required for development
|
2016-11-28 02:50:33 +01:00
|
|
|
```
|
|
|
|
|
|
|
|
Now run these commands:
|
|
|
|
|
|
|
|
```
|
2017-07-08 21:27:25 +02:00
|
|
|
sudo ./scripts/lib/install-node
|
2017-07-27 23:22:52 +02:00
|
|
|
yarn install
|
2016-12-28 04:58:41 +01:00
|
|
|
./tools/setup/emoji/build_emoji
|
2020-04-06 02:40:19 +02:00
|
|
|
./scripts/setup/inline_email_css.py
|
2017-09-26 05:10:46 +02:00
|
|
|
./tools/setup/build_pygments_data
|
2018-12-09 16:13:46 +01:00
|
|
|
./tools/setup/generate_zulip_bots_static_files.py
|
2016-11-28 02:50:33 +01:00
|
|
|
./scripts/setup/generate_secrets.py --development
|
2017-01-05 23:23:16 +01:00
|
|
|
if [ $(uname) = "OpenBSD" ]; then
|
|
|
|
sudo cp ./puppet/zulip/files/postgresql/zulip_english.stop /var/postgresql/tsearch_data/
|
|
|
|
else
|
2018-05-23 21:23:21 +02:00
|
|
|
sudo cp ./puppet/zulip/files/postgresql/zulip_english.stop /usr/share/postgresql/*/tsearch_data/
|
2017-01-05 23:23:16 +01:00
|
|
|
fi
|
2016-11-28 02:50:33 +01:00
|
|
|
./scripts/setup/configure-rabbitmq
|
|
|
|
./tools/setup/postgres-init-dev-db
|
2020-04-21 22:03:12 +02:00
|
|
|
./tools/rebuild-dev-database
|
2016-11-28 02:50:33 +01:00
|
|
|
./tools/setup/postgres-init-test-db
|
2020-04-21 22:03:12 +02:00
|
|
|
./tools/rebuild-test-database
|
2016-11-28 02:50:33 +01:00
|
|
|
./manage.py compilemessages
|
|
|
|
```
|
|
|
|
|
|
|
|
To start the development server:
|
|
|
|
|
|
|
|
```
|
|
|
|
./tools/run-dev.py
|
|
|
|
```
|
|
|
|
|
2017-03-19 13:07:57 +01:00
|
|
|
… and visit <http://localhost:9991/>.
|
2016-11-28 02:50:33 +01:00
|
|
|
|
2018-10-20 06:21:52 +02:00
|
|
|
If you're running your development server on a remote server, look at
|
|
|
|
[the remote development docs][port-forward-setup] for port forwarding
|
|
|
|
advice.
|
|
|
|
|
2016-11-28 02:50:33 +01: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
|
|
|
|
```
|
|
|
|
|
2017-07-27 23:22:52 +02:00
|
|
|
- And set the yarn proxy and https-proxy using:
|
2016-11-28 02:50:33 +01:00
|
|
|
```
|
2017-07-27 23:22:52 +02:00
|
|
|
yarn config set proxy http://proxy_host:port
|
|
|
|
yarn config set https-proxy http://proxy_host:port
|
2016-11-28 02:50:33 +01:00
|
|
|
```
|
|
|
|
|
2018-02-01 22:58:58 +01:00
|
|
|
## Installing on cloud9
|
|
|
|
|
|
|
|
AWS Cloud9 is a cloud-based integrated development environment (IDE)
|
|
|
|
that lets you write, run, and debug your code with just a browser. It
|
|
|
|
includes a code editor, debugger, and terminal.
|
|
|
|
|
2020-08-11 01:47:54 +02:00
|
|
|
This section documents how to set up the Zulip development environment
|
2018-02-01 22:58:58 +01:00
|
|
|
in a cloud9 workspace. If you don't have an existing cloud9 account,
|
|
|
|
you can sign up [here](https://aws.amazon.com/cloud9/).
|
|
|
|
|
|
|
|
* Create a Workspace, and select the blank template.
|
|
|
|
* Resize the workspace to be 1GB of memory and 4GB of disk
|
|
|
|
space. (This is under free limit for both the old Cloud9 and the AWS
|
|
|
|
Free Tier).
|
|
|
|
* Clone the zulip repo: `git clone --config pull.rebase
|
|
|
|
https://github.com/<your-username>/zulip.git`
|
|
|
|
* Restart rabbitmq-server since its broken on cloud9: `sudo service
|
|
|
|
rabbitmq-server restart`.
|
|
|
|
* And run provision `cd zulip && ./tools/provision`, once this is done.
|
|
|
|
* Activate the zulip virtual environment by `source
|
|
|
|
/srv/zulip-py3-venv/bin/activate` or by opening a new terminal.
|
|
|
|
|
|
|
|
#### Install zulip-cloud9
|
|
|
|
|
|
|
|
There's an NPM package, `zulip-cloud9`, that provides a wrapper around
|
|
|
|
the Zulip development server for use in the Cloud9 environment.
|
|
|
|
|
|
|
|
Note: `npm i -g zulip-cloud9` does not work in zulip's virtual
|
|
|
|
environment. Although by default, any packages installed in workspace
|
|
|
|
folder (i.e. the top level folder) are added to `$PATH`.
|
|
|
|
|
|
|
|
```bash
|
|
|
|
cd .. # switch to workspace folder if you are in zulip directory
|
|
|
|
npm i zulip-cloud9
|
|
|
|
zulip-dev start # to start the development server
|
|
|
|
```
|
|
|
|
|
|
|
|
If you get error of the form `bash: cannot find command zulip-dev`,
|
|
|
|
you need to start a new terminal.
|
|
|
|
|
|
|
|
Your development server would be running at
|
|
|
|
`https://<workspace-name>-<username>.c9users.io` on port 8080. You
|
|
|
|
dont need to add `:8080` to your url, since the cloud9 proxy should
|
|
|
|
automatically forward the connection. You might want to visit
|
|
|
|
[zulip-cloud9 repo](https://github.com/cPhost/zulip-cloud9) and it's
|
|
|
|
[wiki](https://github.com/cPhost/zulip-cloud9/wiki) for more info on
|
|
|
|
how to use zulip-cloud9 package.
|
|
|
|
|
2019-04-06 02:58:44 +02:00
|
|
|
[zulip-rtd-git-cloning]: ../git/cloning.html#step-1b-clone-to-your-machine
|
|
|
|
[zulip-rtd-git-connect]: ../git/cloning.html#step-1c-connect-your-fork-to-zulip-upstream
|
|
|
|
[port-forward-setup]: ../development/remote.html#running-the-development-server
|