From 2845b41d11eb9017dc1fe070cc6b22f97f57b581 Mon Sep 17 00:00:00 2001 From: Ryan Albrecht Date: Tue, 8 Oct 2024 09:52:38 -0700 Subject: [PATCH 1/3] docs: Bring back self-signed cert docs and expand with reverse-proxy note --- .../development/environment/index.mdx | 22 +++++++++++++++++++ 1 file changed, 22 insertions(+) diff --git a/develop-docs/development/environment/index.mdx b/develop-docs/development/environment/index.mdx index 525697e0a019f7..824f582b780609 100644 --- a/develop-docs/development/environment/index.mdx +++ b/develop-docs/development/environment/index.mdx @@ -55,6 +55,28 @@ You can create other users with `sentry createuser`. Please refer to [Frontend Development Server](/frontend/development-server/) and [Backend Development Server](/backend/development-server/) for alternative ways to bring up the Sentry UI. +### Enabling HTTPS + +You may wish to run the development server over a secure HTTPS connection. This can be done by generating & installing local certificates and running a reverse proxy. + +We will be using [mkcert](https://github.com/FiloSottile/mkcert) to create and install a locally-trusted, development certificate and [Caddy](https://caddyserver.com/) as our reverse proxy. The following will install `mkcert` and `caddy` and then create and install the local certificates, and run the server. + +```shell +brew install mkcert +brew install nss # if you use Firefox +brew install caddy +yarn mkcert-localhost +yarn https-proxy +``` + +Now you can visit the dev server using `https` at port `:8003` instead of over `http` at `:8000`. + + + You might get into a situation where [HSTS](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Strict-Transport-Security) is enabled for your domain and you're unable to visit using `http` anymore. + + To clear the HSTS visit `chrome://net-internals/#hsts` in Chrome based browsers and use the "Delete domain security policies" form. + + ### Ingestion Pipeline (Relay) aka Sending Events to your Dev Environment Relay and the ingest workers are not started by default. Follow the instructions below to start them so you can send events to your dev environment Sentry instance: From e01ee6491a5e346be7c6cf47027b746e11e4de57 Mon Sep 17 00:00:00 2001 From: Ryan Albrecht Date: Tue, 8 Oct 2024 09:58:12 -0700 Subject: [PATCH 2/3] split install/setup from runtime instructions --- develop-docs/development/environment/index.mdx | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/develop-docs/development/environment/index.mdx b/develop-docs/development/environment/index.mdx index 824f582b780609..f0ae935838fb68 100644 --- a/develop-docs/development/environment/index.mdx +++ b/develop-docs/development/environment/index.mdx @@ -59,17 +59,21 @@ Please refer to [Frontend Development Server](/frontend/development-server/) and You may wish to run the development server over a secure HTTPS connection. This can be done by generating & installing local certificates and running a reverse proxy. -We will be using [mkcert](https://github.com/FiloSottile/mkcert) to create and install a locally-trusted, development certificate and [Caddy](https://caddyserver.com/) as our reverse proxy. The following will install `mkcert` and `caddy` and then create and install the local certificates, and run the server. +First we will use [mkcert](https://github.com/FiloSottile/mkcert) to create and install a locally-trusted, development certificate and [Caddy](https://caddyserver.com/) as our reverse proxy. ```shell brew install mkcert brew install nss # if you use Firefox brew install caddy yarn mkcert-localhost +``` + +Then we will run the reverse proxy as needed: +```shell yarn https-proxy ``` -Now you can visit the dev server using `https` at port `:8003` instead of over `http` at `:8000`. +After the server is running we can visit the dev server using `https` at port `:8003` instead of over `http` at `:8000`. You might get into a situation where [HSTS](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Strict-Transport-Security) is enabled for your domain and you're unable to visit using `http` anymore. From 680d42580ca545a077539dfa3121b53592e6d704 Mon Sep 17 00:00:00 2001 From: Ryan Albrecht Date: Tue, 8 Oct 2024 12:00:55 -0700 Subject: [PATCH 3/3] Update develop-docs/development/environment/index.mdx Co-authored-by: joshuarli --- develop-docs/development/environment/index.mdx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/develop-docs/development/environment/index.mdx b/develop-docs/development/environment/index.mdx index f0ae935838fb68..f3f4a36c22d3ac 100644 --- a/develop-docs/development/environment/index.mdx +++ b/develop-docs/development/environment/index.mdx @@ -57,7 +57,7 @@ Please refer to [Frontend Development Server](/frontend/development-server/) and ### Enabling HTTPS -You may wish to run the development server over a secure HTTPS connection. This can be done by generating & installing local certificates and running a reverse proxy. +Optionally, you may wish to run the development server over HTTPS, for certain situations (like testing JS APIs that require a secure context). First we will use [mkcert](https://github.com/FiloSottile/mkcert) to create and install a locally-trusted, development certificate and [Caddy](https://caddyserver.com/) as our reverse proxy.