From 9030b1f00ef9a872eb2be49b4247a592276c5128 Mon Sep 17 00:00:00 2001 From: Evan Purkhiser Date: Tue, 28 Nov 2023 15:19:17 -0800 Subject: [PATCH] ref(devserver): Remove legacy https support After https://github.com/getsentry/sentry/pull/60673 we're doing https proxying via the webpack devserver. --- src/sentry/runner/commands/devserver.py | 38 ------------------------- 1 file changed, 38 deletions(-) diff --git a/src/sentry/runner/commands/devserver.py b/src/sentry/runner/commands/devserver.py index 0eddb2018af2b8..83442c86ffd9cb 100644 --- a/src/sentry/runner/commands/devserver.py +++ b/src/sentry/runner/commands/devserver.py @@ -1,11 +1,9 @@ from __future__ import annotations import re -import shutil import threading import types from typing import MutableSequence, NoReturn, Sequence -from urllib.parse import urlparse import click @@ -174,26 +172,8 @@ def devserver( from django.conf import settings - from sentry import options from sentry.services.http import SentryHTTPServer - url_prefix = options.get("system.url-prefix") - parsed_url = urlparse(url_prefix) - - # Make sure we're trying to use a port that we can actually bind to - needs_https = parsed_url.scheme == "https" and (parsed_url.port or 443) > 1024 - has_https = shutil.which("https") is not None - - if needs_https and not has_https: - from sentry.runner.initializer import show_big_error - - show_big_error( - [ - "missing `https` on your `$PATH`, but https is needed", - "`$ brew install mattrobenolt/stuff/https`", - ] - ) - uwsgi_overrides: dict[str, int | bool | str | None] = { "http-keepalive": True, # Make sure we reload really quickly for local dev in case it @@ -337,24 +317,6 @@ def devserver( if occurrence_ingest: kafka_consumers.add("ingest-occurrences") - if needs_https and has_https: - https_port = str(parsed_url.port) - https_host = parsed_url.hostname - - # Determine a random port for the backend http server - import socket - - s = socket.socket(socket.AF_INET, socket.SOCK_STREAM) - s.setsockopt(socket.SOL_SOCKET, socket.SO_REUSEADDR, 1) - s.bind((host, 0)) - port = s.getsockname()[1] - s.close() - bind = "%s:%d" % (host, port) - - daemons += [ - ("https", ["https", "-host", https_host, "-listen", host + ":" + https_port, bind]) - ] - # Create all topics if the Kafka eventstream is selected if kafka_consumers: with get_docker_client() as docker: