Skip to content

Commit

Permalink
Remove old footer code (#11836)
Browse files Browse the repository at this point in the history
Requests to `/_/api/v2/footer_html`:

* 3k in last 30 days in community:
https://dash.cloudflare.com/76f653d51b8df4e9e956eb83a5ff42f4/readthedocs.io/analytics/traffic?path=%2F_%2Fapi%2Fv2%2Ffooter_html&time-window=43200
* 1k in the last 30 days in commercial:
https://dash.cloudflare.com/76f653d51b8df4e9e956eb83a5ff42f4/readthedocs-hosted.com/analytics/traffic?path=%2F_%2Fapi%2Fv2%2Ffooter_html&time-window=43200

The amount of requests is pretty low, so I guess is just spam or
similar. I checked those Host from where the request was performed and
those projects are using addons correctly and not hitting the old footer
endpoint.

The only project that still hits `footer_html` API is
https://dogapi.readthedocs.io/en/latest/. This is because it's pretty
old (last build on 2016) and our CF Worker is not removing old URL of
our js. We can add it to
https://github.com/readthedocs/common/blob/f5a5c301a3fdb4b03d6176a6980c999c219b14a2/packages/addons-inject/index.js#L23-L54
if we want, tho.

Closes readthedocs/ext-theme#464
  • Loading branch information
humitos authored Dec 12, 2024
1 parent 400e17d commit 7e2d8be
Show file tree
Hide file tree
Showing 19 changed files with 8 additions and 1,635 deletions.
301 changes: 0 additions & 301 deletions media/css/readthedocs-doc-embed.css

This file was deleted.

2 changes: 1 addition & 1 deletion readthedocs/api/v2/permissions.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ class IsAuthorizedToViewVersion(permissions.BasePermission):
"""
Checks if the user from the request has permissions to see the version.
This permission class used in the FooterHTML and PageSearchAPIView views.
This permission class used in PageSearchAPIView views.
.. note::
Expand Down
7 changes: 3 additions & 4 deletions readthedocs/api/v2/proxied_urls.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,14 +8,13 @@
from django.urls import path

from readthedocs.analytics.proxied_api import AnalyticsView
from readthedocs.api.v2.views.proxied import ProxiedEmbedAPI, ProxiedFooterHTML
from readthedocs.api.v2.views.proxied import ProxiedEmbedAPI
from readthedocs.search.api.v2.views import ProxiedPageSearchAPIView

api_footer_urls = [
path("footer_html/", ProxiedFooterHTML.as_view(), name="footer_html"),
api_proxied_urls = [
path("search/", ProxiedPageSearchAPIView.as_view(), name="search_api"),
path("embed/", ProxiedEmbedAPI.as_view(), name="embed_api"),
path("analytics/", AnalyticsView.as_view(), name="analytics_api"),
]

urlpatterns = api_footer_urls
urlpatterns = api_proxied_urls
Loading

0 comments on commit 7e2d8be

Please sign in to comment.