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

Commit

Permalink
Remove unused, undocumented "content repo" resource (#6628)
Browse files Browse the repository at this point in the history
* commit '98247c4a0':
  Remove unused, undocumented "content repo" resource (#6628)
  • Loading branch information
anoadragon453 committed Mar 20, 2020
2 parents 6d9f40c + 98247c4 commit 8fced9e
Show file tree
Hide file tree
Showing 9 changed files with 3 additions and 128 deletions.
1 change: 1 addition & 0 deletions changelog.d/6628.removal
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Remove unused, undocumented /_matrix/content API.
4 changes: 0 additions & 4 deletions docs/sample_config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -766,10 +766,6 @@ media_store_path: "DATADIR/media_store"
# config:
# directory: /mnt/some/other/directory

# Directory where in-progress uploads are stored.
#
uploads_path: "DATADIR/uploads"

# The largest allowed upload size in bytes
#
#max_upload_size: 10M
Expand Down
1 change: 0 additions & 1 deletion synapse/api/urls.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,6 @@
FEDERATION_UNSTABLE_PREFIX = FEDERATION_PREFIX + "/unstable"
STATIC_PREFIX = "/_matrix/static"
WEB_CLIENT_PREFIX = "/_matrix/client"
CONTENT_REPO_PREFIX = "/_matrix/content"
SERVER_KEY_V2_PREFIX = "/_matrix/key/v2"
MEDIA_PREFIX = "/_matrix/media/r0"
LEGACY_MEDIA_PREFIX = "/_matrix/media/v1"
Expand Down
10 changes: 1 addition & 9 deletions synapse/app/homeserver.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,6 @@
import synapse.config.logger
from synapse import events
from synapse.api.urls import (
CONTENT_REPO_PREFIX,
FEDERATION_PREFIX,
LEGACY_MEDIA_PREFIX,
MEDIA_PREFIX,
Expand All @@ -65,7 +64,6 @@
from synapse.rest import ClientRestResource
from synapse.rest.admin import AdminRestResource
from synapse.rest.key.v2 import KeyApiV2Resource
from synapse.rest.media.v0.content_repository import ContentRepoResource
from synapse.rest.well_known import WellKnownResource
from synapse.server import HomeServer
from synapse.storage import DataStore
Expand Down Expand Up @@ -223,13 +221,7 @@ def _configure_named_resource(self, name, compress=False):
if self.get_config().enable_media_repo:
media_repo = self.get_media_repository_resource()
resources.update(
{
MEDIA_PREFIX: media_repo,
LEGACY_MEDIA_PREFIX: media_repo,
CONTENT_REPO_PREFIX: ContentRepoResource(
self, self.config.uploads_path
),
}
{MEDIA_PREFIX: media_repo, LEGACY_MEDIA_PREFIX: media_repo}
)
elif name == "media":
raise ConfigError(
Expand Down
6 changes: 1 addition & 5 deletions synapse/app/media_repository.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@

import synapse
from synapse import events
from synapse.api.urls import CONTENT_REPO_PREFIX, LEGACY_MEDIA_PREFIX, MEDIA_PREFIX
from synapse.api.urls import LEGACY_MEDIA_PREFIX, MEDIA_PREFIX
from synapse.app import _base
from synapse.config._base import ConfigError
from synapse.config.homeserver import HomeServerConfig
Expand All @@ -37,7 +37,6 @@
from synapse.replication.slave.storage.transactions import SlavedTransactionStore
from synapse.replication.tcp.client import ReplicationClientHandler
from synapse.rest.admin import register_servlets_for_media_repo
from synapse.rest.media.v0.content_repository import ContentRepoResource
from synapse.server import HomeServer
from synapse.storage.data_stores.main.media_repository import MediaRepositoryStore
from synapse.util.httpresourcetree import create_resource_tree
Expand Down Expand Up @@ -82,9 +81,6 @@ def _listen_http(self, listener_config):
{
MEDIA_PREFIX: media_repo,
LEGACY_MEDIA_PREFIX: media_repo,
CONTENT_REPO_PREFIX: ContentRepoResource(
self, self.config.uploads_path
),
"/_synapse/admin": admin_resource,
}
)
Expand Down
5 changes: 0 additions & 5 deletions synapse/config/repository.py
Original file line number Diff line number Diff line change
Expand Up @@ -162,7 +162,6 @@ def read_config(self, config, **kwargs):
(provider_class, parsed_config, wrapper_config)
)

self.uploads_path = self.ensure_directory(config.get("uploads_path", "uploads"))
self.dynamic_thumbnails = config.get("dynamic_thumbnails", False)
self.thumbnail_requirements = parse_thumbnail_requirements(
config.get("thumbnail_sizes", DEFAULT_THUMBNAIL_SIZES)
Expand Down Expand Up @@ -237,10 +236,6 @@ def generate_config_section(self, data_dir_path, **kwargs):
# config:
# directory: /mnt/some/other/directory
# Directory where in-progress uploads are stored.
#
uploads_path: "%(uploads_path)s"
# The largest allowed upload size in bytes
#
#max_upload_size: 10M
Expand Down
Empty file removed synapse/rest/media/v0/__init__.py
Empty file.
103 changes: 0 additions & 103 deletions synapse/rest/media/v0/content_repository.py

This file was deleted.

1 change: 0 additions & 1 deletion tox.ini
Original file line number Diff line number Diff line change
Expand Up @@ -182,7 +182,6 @@ commands = mypy \
synapse/logging/ \
synapse/module_api \
synapse/rest/consent \
synapse/rest/media/v0 \
synapse/rest/saml2 \
synapse/spam_checker_api \
synapse/storage/engines \
Expand Down

0 comments on commit 8fced9e

Please sign in to comment.