Skip to content

Commit 96474a7

Browse files
committed
Merge tag '10.18.0' into rel
2 parents 7ba6be4 + cee310d commit 96474a7

File tree

55 files changed

+510
-442
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

55 files changed

+510
-442
lines changed

.github/workflows/pip-tools.yaml

+1-1
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ jobs:
4040
run: invoke requirements.update
4141

4242
- name: Create Pull Request
43-
uses: peter-evans/create-pull-request@v5
43+
uses: peter-evans/create-pull-request@v6
4444
with:
4545
add-paths: |
4646
requirements/*.txt

CHANGELOG.rst

+31
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,34 @@
1+
Version 10.18.0
2+
---------------
3+
4+
:Date: February 06, 2024
5+
6+
* `@dependabot[bot] <https://github.com/dependabot[bot]>`__: Bump peter-evans/create-pull-request from 5 to 6 (`#11092 <https://github.com/readthedocs/readthedocs.org/pull/11092>`__)
7+
* `@man-chi <https://github.com/man-chi>`__: add example list for showing basic asciidoc using Antora (`#11091 <https://github.com/readthedocs/readthedocs.org/pull/11091>`__)
8+
* `@github-actions[bot] <https://github.com/github-actions[bot]>`__: Dependencies: all packages updated via pip-tools (`#11090 <https://github.com/readthedocs/readthedocs.org/pull/11090>`__)
9+
* `@stsewd <https://github.com/stsewd>`__: Use html_format instead of mark_safe + format (`#11086 <https://github.com/readthedocs/readthedocs.org/pull/11086>`__)
10+
* `@stsewd <https://github.com/stsewd>`__: Build: use version slug for get_version_slug (`#11085 <https://github.com/readthedocs/readthedocs.org/pull/11085>`__)
11+
* `@stsewd <https://github.com/stsewd>`__: Integrations: Don't allow webhooks without a secret (`#11083 <https://github.com/readthedocs/readthedocs.org/pull/11083>`__)
12+
* `@stsewd <https://github.com/stsewd>`__: Config file: add support for latest aliases (`#11081 <https://github.com/readthedocs/readthedocs.org/pull/11081>`__)
13+
* `@stsewd <https://github.com/stsewd>`__: Proxito: always add nginx internal path (`#11080 <https://github.com/readthedocs/readthedocs.org/pull/11080>`__)
14+
* `@stsewd <https://github.com/stsewd>`__: Redirects: remove unused status field (`#11079 <https://github.com/readthedocs/readthedocs.org/pull/11079>`__)
15+
* `@stsewd <https://github.com/stsewd>`__: Docs: fix redirects example (`#11078 <https://github.com/readthedocs/readthedocs.org/pull/11078>`__)
16+
* `@humitos <https://github.com/humitos>`__: Release 10.17.0 (`#11077 <https://github.com/readthedocs/readthedocs.org/pull/11077>`__)
17+
* `@stsewd <https://github.com/stsewd>`__: Docs: clarify search configuration patterns (`#11076 <https://github.com/readthedocs/readthedocs.org/pull/11076>`__)
18+
* `@humitos <https://github.com/humitos>`__: Build: add support for Ruby (`#11075 <https://github.com/readthedocs/readthedocs.org/pull/11075>`__)
19+
* `@humitos <https://github.com/humitos>`__: Build: update some `build.tools` versions (`#11074 <https://github.com/readthedocs/readthedocs.org/pull/11074>`__)
20+
* `@humitos <https://github.com/humitos>`__: Make Sphinx to share environment between commands (`#11073 <https://github.com/readthedocs/readthedocs.org/pull/11073>`__)
21+
* `@ericholscher <https://github.com/ericholscher>`__: Fix provier_name in notification template (`#11066 <https://github.com/readthedocs/readthedocs.org/pull/11066>`__)
22+
* `@humitos <https://github.com/humitos>`__: Build: don't attach notification when build failed `before_start` (`#11057 <https://github.com/readthedocs/readthedocs.org/pull/11057>`__)
23+
* `@humitos <https://github.com/humitos>`__: Notification: create an index for `attached_to` (`#11050 <https://github.com/readthedocs/readthedocs.org/pull/11050>`__)
24+
* `@stsewd <https://github.com/stsewd>`__: Redirects: fix infinite loop detection (`#11038 <https://github.com/readthedocs/readthedocs.org/pull/11038>`__)
25+
* `@ericholscher <https://github.com/ericholscher>`__: Release 10.15.1 (`#11034 <https://github.com/readthedocs/readthedocs.org/pull/11034>`__)
26+
* `@humitos <https://github.com/humitos>`__: Logging: reduce not useful lines (`#11030 <https://github.com/readthedocs/readthedocs.org/pull/11030>`__)
27+
* `@github-actions[bot] <https://github.com/github-actions[bot]>`__: Dependencies: all packages updated via pip-tools (`#10860 <https://github.com/readthedocs/readthedocs.org/pull/10860>`__)
28+
* `@stsewd <https://github.com/stsewd>`__: Fix docker setting (`#10565 <https://github.com/readthedocs/readthedocs.org/pull/10565>`__)
29+
* `@humitos <https://github.com/humitos>`__: Deprecation: remove code for config file v1 and default config file (`#10367 <https://github.com/readthedocs/readthedocs.org/pull/10367>`__)
30+
* `@benjaoming <https://github.com/benjaoming>`__: Docs: Re-scope Intersphinx article as a how-to (`#9622 <https://github.com/readthedocs/readthedocs.org/pull/9622>`__)
31+
132
Version 10.17.0
233
---------------
334

docs/conf.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,7 @@
7777

7878
master_doc = "index"
7979
copyright = "Read the Docs, Inc & contributors"
80-
version = "10.17.0"
80+
version = "10.18.0"
8181
release = version
8282
exclude_patterns = ["_build", "shared", "_includes"]
8383
default_role = "obj"

docs/user/config-file/v2.rst

+59-18
Original file line numberDiff line numberDiff line change
@@ -274,18 +274,37 @@ Image names refer to the operating system Read the Docs uses to build them.
274274
Arbitrary Docker images are not supported.
275275

276276
:Type: ``string``
277-
:Options: ``ubuntu-20.04``, ``ubuntu-22.04``
277+
:Options: ``ubuntu-20.04``, ``ubuntu-22.04``, ``ubuntu-lts-latest``
278278
:Required: ``true``
279279

280+
.. note::
281+
282+
The ``ubuntu-lts-latest`` option refers to the latest Ubuntu LTS version of Ubuntu available on Read the Docs,
283+
which may not match the latest Ubuntu LTS officially released.
284+
285+
.. warning::
286+
287+
Using ``ubuntu-lts-latest`` may break your builds unexpectedly if your project isn't compatible with the newest Ubuntu LTS version when it's updated by Read the Docs.
288+
280289
build.tools
281290
```````````
282291

283292
Version specifiers for each tool. It must contain at least one tool.
284293

285294
:Type: ``dict``
286-
:Options: ``python``, ``nodejs``, ``rust``, ``golang``
295+
:Options: ``python``, ``nodejs``, ``ruby``, ``rust``, ``golang``
287296
:Required: ``true``
288297

298+
.. note::
299+
300+
Each tool has a ``latest`` option available, which refers to the latest version available on Read the Docs,
301+
which may not match the latest version officially released.
302+
Versions and the ``latest`` option are updated at least once every six months to keep up with the latest releases.
303+
304+
.. warning::
305+
306+
Using ``latest`` may break your builds unexpectedly if your project isn't compatible with the newest version of the tool when it's updated by Read the Docs.
307+
289308
build.tools.python
290309
``````````````````
291310

@@ -301,17 +320,20 @@ You can use several interpreters and versions, from CPython, Miniconda, and Mamb
301320
:Type: ``string``
302321
:Options:
303322
- ``2.7``
304-
- ``3`` (last stable CPython version)
323+
- ``3`` (alias for the latest 3.x version available on Read the Docs)
305324
- ``3.6``
306325
- ``3.7``
307326
- ``3.8``
308327
- ``3.9``
309328
- ``3.10``
310329
- ``3.11``
311330
- ``3.12``
331+
- ``latest`` (alias for the latest version available on Read the Docs)
312332
- ``miniconda3-4.7``
333+
- ``miniconda-latest`` (alias for the latest version available on Read the Docs)
313334
- ``mambaforge-4.10``
314335
- ``mambaforge-22.9``
336+
- ``mambaforge-latest`` (alias for the latest version available on Read the Docs)
315337

316338
build.tools.nodejs
317339
``````````````````
@@ -325,6 +347,17 @@ Node.js version to use.
325347
- ``18``
326348
- ``19``
327349
- ``20``
350+
- ``latest`` (alias for the latest version available on Read the Docs)
351+
352+
build.tools.ruby
353+
````````````````
354+
355+
Ruby version to use.
356+
357+
:Type: ``string``
358+
:Options:
359+
- ``3.3``
360+
- ``latest`` (alias for the latest version available on Read the Docs)
328361

329362
build.tools.rust
330363
````````````````
@@ -337,6 +370,8 @@ Rust version to use.
337370
- ``1.61``
338371
- ``1.64``
339372
- ``1.70``
373+
- ``1.75``
374+
- ``latest`` (alias for the latest version available on Read the Docs)
340375

341376
build.tools.golang
342377
``````````````````
@@ -349,6 +384,8 @@ Go version to use.
349384
- ``1.18``
350385
- ``1.19``
351386
- ``1.20``
387+
- ``1.21``
388+
- ``latest`` (alias for the latest version available on Read the Docs)
352389

353390
build.apt_packages
354391
``````````````````
@@ -657,13 +694,13 @@ Set a custom search rank over pages matching a pattern.
657694
:Type: ``map`` of patterns to ranks
658695
:Default: ``{}``
659696

660-
Patterns are matched against the final html pages produced by the build
661-
(you should try to match `index.html`, not `docs/index.rst`).
662-
Patterns can include some special characters:
697+
Patterns are matched against the relative paths of the HTML files produced by the build,
698+
you should try to match ``index.html``, not ``docs/index.rst``, nor ``/en/latest/index.html``.
699+
Patterns can include one or more of the following special characters:
663700

664-
- ``*`` matches everything
665-
- ``?`` matches any single character
666-
- ``[seq]`` matches any character in ``seq``
701+
- ``*`` matches everything, including slashes.
702+
- ``?`` matches any single character.
703+
- ``[seq]`` matches any character in ``seq``.
667704

668705
The rank can be an integer number between -10 and 10 (inclusive).
669706
Pages with a rank closer to -10 will appear further down the list of results,
@@ -685,8 +722,10 @@ check :ref:`config-file/v2:search.ignore`.
685722
# Match all files under the api/v1 directory
686723
api/v1/*: -5
687724
688-
# Match all files that end with tutorial.html
689-
'*/tutorial.html': 3
725+
# Match all files named guides.html,
726+
# two patterns are needed to match both the root and nested files.
727+
'guides.html': 3
728+
'*/guides.html': 3
690729
691730
.. note::
692731

@@ -706,13 +745,13 @@ Paths matched will not be included in search results.
706745
:Type: ``list`` of patterns
707746
:Default: ``['search.html', 'search/index.html', '404.html', '404/index.html']``
708747

709-
Patterns are matched against the relative path of html files produced by the build
710-
(you should try to match `index.html`, not `docs/index.rst`).
711-
Patterns can include some special characters:
748+
Patterns are matched against the relative paths of the HTML files produced by the build,
749+
you should try to match ``index.html``, not ``docs/index.rst``, nor ``/en/latest/index.html``.
750+
Patterns can include one or more of the following special characters:
712751

713-
- ``*`` matches everything
714-
- ``?`` matches any single character
715-
- ``[seq]`` matches any character in ``seq``
752+
- ``*`` matches everything (including slashes).
753+
- ``?`` matches any single character.
754+
- ``[seq]`` matches any character in ``seq``.
716755

717756
.. code-block:: yaml
718757
@@ -726,7 +765,9 @@ Patterns can include some special characters:
726765
# Ignore all files under the search/ directory
727766
- search/*
728767
729-
# Ignore all files named ref.html nested inside one or more sub-folders
768+
# Ignore all files named ref.html,
769+
# two patterns are needed to match both the root and nested files.
770+
- 'ref.html'
730771
- '*/ref.html'
731772
732773
.. code-block:: yaml

docs/user/examples.rst

+4-1
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,10 @@ Sphinx and MkDocs examples
3232
- Jupyter Book and Sphinx
3333
- `[Git] <https://github.com/readthedocs-examples/example-jupyter-book/>`__ `[Rendered] <https://example-jupyter-book.readthedocs.io/>`__
3434
- Jupyter Book with popular integrations configured
35-
35+
* - Basic AsciiDoc
36+
- Antora
37+
- `[Git] <https://github.com/man-chi/example-antora-basic/>`__ `[Rendered] <https://example-antora-basic.readthedocs.io/>`__
38+
- Antora with asciidoctor-kroki extension configured for AsciiDoc and Diagram as Code.
3639

3740
Real-life examples
3841
------------------

docs/user/user-defined-redirects.rst

+1-1
Original file line numberDiff line numberDiff line change
@@ -326,7 +326,7 @@ for example::
326326

327327
Type: Exact Redirect
328328
From URL: /*
329-
To URL: https://newdocs.example.com/
329+
To URL: https://newdocs.example.com/:splat
330330
Force Redirect: True
331331

332332
Users will now be redirected:

package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "readthedocs",
3-
"version": "10.17.0",
3+
"version": "10.18.0",
44
"description": "Read the Docs build dependencies",
55
"author": "Read the Docs, Inc <[email protected]>",
66
"scripts": {

readthedocs/__init__.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
"""Read the Docs."""
22

33

4-
__version__ = "10.17.0"
4+
__version__ = "10.18.0"

readthedocs/api/v2/views/integrations.py

+6-41
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
"""Endpoints integrating with Github, Bitbucket, and other webhooks."""
22

3-
import datetime
43
import hashlib
54
import hmac
65
import json
@@ -10,7 +9,6 @@
109

1110
import structlog
1211
from django.shortcuts import get_object_or_404
13-
from django.utils import timezone
1412
from django.utils.crypto import constant_time_compare
1513
from rest_framework import permissions, status
1614
from rest_framework.exceptions import NotFound, ParseError
@@ -74,14 +72,6 @@ class WebhookMixin:
7472
integration = None
7573
integration_type = None
7674
invalid_payload_msg = 'Payload not valid'
77-
missing_secret_for_pr_events_msg = dedent(
78-
"""
79-
This webhook doesn't have a secret configured.
80-
For security reasons, webhooks without a secret can't process pull/merge request events.
81-
For more information, read our blog post: https://blog.readthedocs.com/security-update-on-incoming-webhooks/.
82-
"""
83-
).strip()
84-
8575
missing_secret_deprecated_msg = dedent(
8676
"""
8777
This webhook doesn't have a secret configured.
@@ -116,12 +106,9 @@ def post(self, request, project_slug):
116106
except Project.DoesNotExist as exc:
117107
raise NotFound("Project not found") from exc
118108

119-
# Deprecate webhooks without a secret
109+
# Webhooks without a secret are no longer permitted.
120110
# https://blog.readthedocs.com/security-update-on-incoming-webhooks/.
121-
now = timezone.now()
122-
deprecation_date = datetime.datetime(2024, 1, 31, tzinfo=datetime.timezone.utc)
123-
is_deprecated = now >= deprecation_date
124-
if is_deprecated and not self.has_secret():
111+
if not self.has_secret():
125112
return Response(
126113
{"detail": self.missing_secret_deprecated_msg},
127114
status=HTTP_400_BAD_REQUEST,
@@ -418,12 +405,9 @@ def is_payload_valid(self):
418405
See https://developer.github.com/webhooks/securing/.
419406
"""
420407
signature = self.request.headers.get(GITHUB_SIGNATURE_HEADER)
421-
secret = self.get_integration().secret
422-
if not secret:
423-
log.debug('Skipping payload signature validation.')
424-
return True
425408
if not signature:
426409
return False
410+
secret = self.get_integration().secret
427411
msg = self.request.body.decode()
428412
digest = WebhookMixin.get_digest(secret, msg)
429413
result = hmac.compare_digest(
@@ -492,13 +476,6 @@ def handle_webhook(self):
492476

493477
# Handle pull request events.
494478
if self.project.external_builds_enabled and event == GITHUB_PULL_REQUEST:
495-
# Requests from anonymous users are ignored.
496-
if not integration.secret:
497-
return Response(
498-
{"detail": self.missing_secret_for_pr_events_msg},
499-
status=HTTP_400_BAD_REQUEST,
500-
)
501-
502479
if action in [
503480
GITHUB_PULL_REQUEST_OPENED,
504481
GITHUB_PULL_REQUEST_REOPENED,
@@ -598,10 +575,9 @@ def is_payload_valid(self):
598575
See https://docs.gitlab.com/ee/user/project/integrations/webhooks.html#secret-token.
599576
"""
600577
token = self.request.headers.get(GITLAB_TOKEN_HEADER, "")
578+
if not token:
579+
return False
601580
secret = self.get_integration().secret
602-
if not secret:
603-
log.debug('Skipping payload signature validation.')
604-
return True
605581
return constant_time_compare(secret, token)
606582

607583
def get_external_version_data(self):
@@ -636,8 +612,6 @@ def handle_webhook(self):
636612
event=event,
637613
)
638614

639-
integration = self.get_integration()
640-
641615
# Always update `latest` branch to point to the default branch in the repository
642616
# even if the event is not gonna be handled. This helps us to keep our db in sync.
643617
default_branch = self.data.get("project", {}).get("default_branch", None)
@@ -665,12 +639,6 @@ def handle_webhook(self):
665639
raise ParseError('Parameter "ref" is required') from exc
666640

667641
if self.project.external_builds_enabled and event == GITLAB_MERGE_REQUEST:
668-
if not integration.secret:
669-
return Response(
670-
{"detail": self.missing_secret_for_pr_events_msg},
671-
status=HTTP_400_BAD_REQUEST,
672-
)
673-
674642
if action in [
675643
GITLAB_MERGE_REQUEST_OPEN,
676644
GITLAB_MERGE_REQUEST_REOPEN,
@@ -779,12 +747,9 @@ def is_payload_valid(self):
779747
See https://support.atlassian.com/bitbucket-cloud/docs/manage-webhooks/#Secure-webhooks.
780748
"""
781749
signature = self.request.headers.get(BITBUCKET_SIGNATURE_HEADER)
782-
secret = self.get_integration().secret
783-
if not secret:
784-
log.debug("Skipping payload signature validation.")
785-
return True
786750
if not signature:
787751
return False
752+
secret = self.get_integration().secret
788753
msg = self.request.body.decode()
789754
digest = WebhookMixin.get_digest(secret, msg)
790755
result = hmac.compare_digest(

0 commit comments

Comments
 (0)