Skip to content
This repository has been archived by the owner on Apr 26, 2024. It is now read-only.

Commit

Permalink
fixup! media/create: add /create endpoint
Browse files Browse the repository at this point in the history
Signed-off-by: Sumner Evans <[email protected]>
  • Loading branch information
sumnerevans committed Oct 24, 2023
1 parent fdf42cd commit d44faef
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 20 deletions.
21 changes: 3 additions & 18 deletions flake.nix
Original file line number Diff line number Diff line change
Expand Up @@ -104,6 +104,7 @@
libxml2
libxslt
sqlite
gcc

# Native dependencies for unit tests (SyTest also requires OpenSSL).
openssl
Expand Down Expand Up @@ -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.
Expand All @@ -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
Expand All @@ -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";
Expand Down
5 changes: 3 additions & 2 deletions synapse/rest/media/create_resource.py
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand All @@ -28,7 +29,7 @@
logger = logging.getLogger(__name__)


class CreateResource(DirectServeJsonResource):
class CreateResource(RestServlet):
PATTERNS = [re.compile("/_matrix/media/v1/create")]
isLeaf = True

Expand Down

0 comments on commit d44faef

Please sign in to comment.