Skip to content
This repository was archived by the owner on Aug 14, 2024. It is now read-only.
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
36 changes: 36 additions & 0 deletions src/docs/self-hosted/index.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,42 @@ In addition to making its source code available publicly, Sentry offers and main

Our recommendation is to download the [latest release of the self-hosted repository](https://github.com/getsentry/self-hosted/releases/latest), and then run `./install.sh` inside this directory. This script will take care of all the things you need to get started, including a base-line configuration, and then will tell you to run `docker-compose up -d` to start Sentry. Sentry binds to port `9000` by default. You should be able to reach the login page at [http://127.0.0.1:9000](http://127.0.0.1:9000/).

### Installing Behind a Proxy

In some enterprise setups there is no direct Internet connection, so you must use an HTTP proxy server. How do you install Sentry in this environment? Let us assume:

1. Your Sentry installation is running on Linux.
1. `http://proxy:3128` is your proxy address.
1. `127.0.0.0/8` is the only network that should be accessed without a proxy.

Here are the steps to follow:

1. Set `http_proxy`, `https_proxy` and `no_proxy` variables in the `/etc/environment` file.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this really a necessity?

We're using http proxy in some of our servers which are using docker and we have only changed docker systemd file.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

When you change systemd file - it makes docker daemon to use proxy for docker pull. When you config proxy in .docker/config.json - it makes docker to set env proxy variables during docker run. /etc/environment file is required for docker build, so without it this code fails.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah, I didn't know that docker build is different, thanks!

https://github.com/getsentry/self-hosted/blob/e028a5ed52f835ef2fefcab0104ff047889e5470/install/build-docker-images.sh#L6 :
$dc build --build-arg "http_proxy=${http_proxy:-}" --build-arg "https_proxy=${https_proxy:-}" --build-arg "no_proxy=${no_proxy:-}" --force-rm web

So if changing /etc/environment is necessary why are we passing these build arguments to docker build and if we are passing these build arguments to docker build why we need to change /etc/environment?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

/etc/environment provide env variables for shell and the command $dc build --build-arg "http_proxy=${http_proxy:-}" --build-arg "https_proxy=${https_proxy:-}" --build-arg "no_proxy=${no_proxy:-}" --force-rm web passes this variables to docker build. But actually we can remove all --build-arg from docker build and remove proxy args from https://github.com/getsentry/self-hosted/blob/e028a5ed52f835ef2fefcab0104ff047889e5470/install/install-wal2json.sh#L10, because ./docker/config.json does all required things. Actually we don't need /etc/environment, we need only ~/.docker/config.json and /etc/systemd/system/docker.service.d/http-proxy.conf.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

2. To make the `docker pull` command respect your proxy settings, create a `/etc/systemd/system/docker.service.d/http-proxy.conf` file with these contents:
```
[Service]
Environment="HTTP_PROXY=http://proxy:3128"
Environment="HTTPS_PROXY=http://proxy:3128"
Environment="NO_PROXY=127.0.0.0/8"
```
3. Run `systemctl daemon-reload` and restart Docker with `systemctl restart docker.service`.
4. To add your proxy environment variables into Sentry's Docker containers, create `~/.docker/config.json` with these contents:
```json
{
"proxies":
{
"default":
{
"httpProxy": "http://proxy:3128",
"httpsProxy": "http://proxy:3128",
"noProxy": "127.0.0.0/8"
}
}
}
```

From there you can run `./install.sh` like usual.

## Configuration

You very likely will want to adjust the default configuration for Sentry. These facilities are available for that purpose:
Expand Down