diff --git a/flake.nix b/flake.nix index 31f283293971..8daf7b017b97 100644 --- a/flake.nix +++ b/flake.nix @@ -104,6 +104,7 @@ libxml2 libxslt sqlite + gcc # Native dependencies for unit tests (SyTest also requires OpenSSL). openssl @@ -152,7 +153,7 @@ # Postgres is needed to run Synapse with postgres support and # to run certain unit tests that require postgres. - services.postgres.enable = true; + services.postgres.enable = false; # On the first invocation of `devenv up`, create a database for # Synapse to store data in. @@ -168,7 +169,7 @@ ''; # Redis is needed in order to run Synapse in worker mode. - services.redis.enable = true; + services.redis.enable = false; # Configure and start Synapse. Before starting Synapse, this shell code: # * generates a default homeserver.yaml config file if one does not exist, and @@ -178,22 +179,6 @@ process.before = '' python -m synapse.app.homeserver -c homeserver.yaml --generate-config --server-name=synapse.dev --report-stats=no mkdir -p homeserver-config-overrides.d - cat > homeserver-config-overrides.d/database.yaml << EOF - ## Do not edit this file. This file is generated by flake.nix - database: - name: psycopg2 - args: - user: synapse_user - database: synapse - host: $PGHOST - cp_min: 5 - cp_max: 10 - EOF - cat > homeserver-config-overrides.d/redis.yaml << EOF - ## Do not edit this file. This file is generated by flake.nix - redis: - enabled: true - EOF ''; # Start synapse when `devenv up` is run. processes.synapse.exec = "poetry run python -m synapse.app.homeserver -c homeserver.yaml -c homeserver-config-overrides.d"; diff --git a/synapse/rest/media/create_resource.py b/synapse/rest/media/create_resource.py index 84d6d9f1b955..c30438790c65 100644 --- a/synapse/rest/media/create_resource.py +++ b/synapse/rest/media/create_resource.py @@ -18,7 +18,8 @@ from synapse.api.errors import LimitExceededError from synapse.api.ratelimiting import Ratelimiter -from synapse.http.server import DirectServeJsonResource, respond_with_json +from synapse.http.server import respond_with_json +from synapse.http.servlet import RestServlet from synapse.http.site import SynapseRequest if TYPE_CHECKING: @@ -28,7 +29,7 @@ logger = logging.getLogger(__name__) -class CreateResource(DirectServeJsonResource): +class CreateResource(RestServlet): PATTERNS = [re.compile("/_matrix/media/v1/create")] isLeaf = True