Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ref(devserver): Remove legacy https support #60734

Merged
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
38 changes: 0 additions & 38 deletions src/sentry/runner/commands/devserver.py
Original file line number Diff line number Diff line change
@@ -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

Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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:
Expand Down
Loading