requirements: Remove Thumbor.

Thumbor and tc-aws have been dragging their feet on Python 3 support
for years, and even the alphas and unofficial forks we’ve been running
don’t seem to be maintained anymore.  Depending on these projects is
no longer viable for us.

Signed-off-by: Anders Kaseorg <anders@zulip.com>
This commit is contained in:
Anders Kaseorg
2021-05-06 15:38:24 -07:00
committed by Tim Abbott
parent 779353b44e
commit 405bc8dabf
51 changed files with 26 additions and 2336 deletions

View File

@@ -50,7 +50,7 @@ parser.add_argument(
dest="clear_memcached",
help="Do not clear memcached on startup",
)
parser.add_argument("--streamlined", action="store_true", help="Avoid thumbor, etc.")
parser.add_argument("--streamlined", action="store_true", help="Avoid process_queue, etc.")
parser.add_argument(
"--enable-tornado-logging",
action="store_true",
@@ -98,7 +98,6 @@ proxy_port = base_port
django_port = base_port + 1
tornado_port = base_port + 2
webpack_port = base_port + 3
thumbor_port = base_port + 4
os.chdir(os.path.join(os.path.dirname(__file__), ".."))
@@ -149,7 +148,7 @@ def server_processes() -> List[List[str]]:
if options.streamlined:
# The streamlined operation allows us to do many
# things, but search/thumbor/etc. features won't work.
# things, but search/etc. features won't work.
return main_cmds
other_cmds = [
@@ -161,11 +160,6 @@ def server_processes() -> List[List[str]]:
"--quiet",
],
["./manage.py", "deliver_scheduled_messages"],
[
"/srv/zulip-thumbor-venv/bin/thumbor",
"--conf=./zthumbor/thumbor_settings.py",
f"--port={thumbor_port}",
],
]
# NORMAL (but slower) operation:
@@ -200,8 +194,6 @@ def transform_url(protocol: str, path: str, query: str, target_port: int, target
host = ":".join((target_host, str(target_port)))
# Here we are going to rewrite the path a bit so that it is in parity with
# what we will have for production
if path.startswith("/thumbor"):
path = path[len("/thumbor") :]
newpath = urlunparse((protocol, host, path, "", query, ""))
return newpath
@@ -320,10 +312,6 @@ class TornadoHandler(BaseHandler):
target_port = tornado_port
class ThumborHandler(BaseHandler):
target_port = thumbor_port
class ErrorHandler(BaseHandler):
@web.asynchronous
def prepare(self) -> None:
@@ -333,17 +321,12 @@ class ErrorHandler(BaseHandler):
self.finish()
def using_thumbor() -> bool:
return not options.streamlined
class Application(web.Application):
def __init__(self, enable_logging: bool = False) -> None:
handlers = [
(r"/json/events.*", TornadoHandler),
(r"/api/v1/events.*", TornadoHandler),
(r"/webpack.*", WebPackHandler),
(r"/thumbor.*", ThumborHandler if using_thumbor() else ErrorHandler),
(r"/.*", DjangoHandler),
]
super().__init__(handlers, enable_logging=enable_logging)
@@ -387,9 +370,6 @@ def print_listeners() -> None:
if not options.test:
ports.append((webpack_port, "webpack"))
if using_thumbor():
ports.append((thumbor_port, "Thumbor"))
for port, label in ports:
print(f" {port}: {label}")
print()