Skip to content

Commit e40965f

Browse files
committed
Merge tag '4.0.1' into rel
2 parents 6045a3d + d67ae9e commit e40965f

38 files changed

+556
-194
lines changed

.gitignore

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -67,6 +67,7 @@ env.bak/
6767
venv.bak/
6868

6969
dev.db-journal
70-
/readthedocs/settings/build.py
71-
/readthedocs/settings/celery.py
72-
/readthedocs/settings/web.py
70+
/readthedocs/settings/build_docker.py
71+
/readthedocs/settings/celery_docker.py
72+
/readthedocs/settings/proxito_docker.py
73+
/readthedocs/settings/web_docker.py

.travis.yml

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,14 @@ python:
33
- 3.6
44
dist: xenial
55

6+
addons:
7+
hosts:
8+
- search
9+
610
jobs:
711
include:
812
- python: 3.6
9-
env: TOXENV=py36,codecov ES_VERSION=6.2.4 ES_DOWNLOAD_URL=https://artifacts.elastic.co/downloads/elasticsearch/elasticsearch-${ES_VERSION}.tar.gz
13+
env: TOXENV=py36,codecov TOX_POSARGS='' ES_VERSION=6.2.4 ES_DOWNLOAD_URL=https://artifacts.elastic.co/downloads/elasticsearch/elasticsearch-${ES_VERSION}.tar.gz
1014
- python: 3.6
1115
env: TOXENV=docs
1216
- python: 3.6
@@ -33,7 +37,7 @@ install:
3337
- ./scripts/travis/install_node.sh
3438
- pip install tox-travis
3539
script:
36-
- ./scripts/travis/run_tests.sh
40+
- tox
3741
notifications:
3842
slack:
3943
rooms:

CHANGELOG.rst

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,31 @@
1+
Version 4.0.1
2+
-------------
3+
4+
:Date: March 03, 2020
5+
6+
* `@ericholscher <https://github.com/ericholscher>`__: Add feature flag for branch & tag syncing to API. (`#6729 <https://github.com/readthedocs/readthedocs.org/pull/6729>`__)
7+
* `@stsewd <https://github.com/stsewd>`__: Don't fail a build on api timing out (`#6719 <https://github.com/readthedocs/readthedocs.org/pull/6719>`__)
8+
* `@stsewd <https://github.com/stsewd>`__: Be explicit on privacy level for search tests (`#6713 <https://github.com/readthedocs/readthedocs.org/pull/6713>`__)
9+
* `@stsewd <https://github.com/stsewd>`__: Make easy to run search tests in docker compose (`#6711 <https://github.com/readthedocs/readthedocs.org/pull/6711>`__)
10+
* `@davidfischer <https://github.com/davidfischer>`__: Docker settings improvements (`#6709 <https://github.com/readthedocs/readthedocs.org/pull/6709>`__)
11+
* `@davidfischer <https://github.com/davidfischer>`__: Workaround SameSite cookies (`#6708 <https://github.com/readthedocs/readthedocs.org/pull/6708>`__)
12+
* `@davidfischer <https://github.com/davidfischer>`__: Figure out the host IP when using Docker (`#6707 <https://github.com/readthedocs/readthedocs.org/pull/6707>`__)
13+
* `@davidfischer <https://github.com/davidfischer>`__: Pin the version of Azurite for docker-compose development (`#6706 <https://github.com/readthedocs/readthedocs.org/pull/6706>`__)
14+
* `@ericholscher <https://github.com/ericholscher>`__: Release 4.0.0 (`#6704 <https://github.com/readthedocs/readthedocs.org/pull/6704>`__)
15+
* `@humitos <https://github.com/humitos>`__: Rename docker settings to fix local environment (`#6703 <https://github.com/readthedocs/readthedocs.org/pull/6703>`__)
16+
* `@sduthil <https://github.com/sduthil>`__: API v3 doc: fix typos in URL for PATCH /versions/slug/ (`#6698 <https://github.com/readthedocs/readthedocs.org/pull/6698>`__)
17+
* `@humitos <https://github.com/humitos>`__: Sort vesions in-place to help performance (`#6696 <https://github.com/readthedocs/readthedocs.org/pull/6696>`__)
18+
* `@humitos <https://github.com/humitos>`__: Use .iterator when sorting versions (`#6694 <https://github.com/readthedocs/readthedocs.org/pull/6694>`__)
19+
* `@agjohnson <https://github.com/agjohnson>`__: Add feature flag to just completely skip sync and symlink operations (`#6689 <https://github.com/readthedocs/readthedocs.org/pull/6689>`__)
20+
* `@humitos <https://github.com/humitos>`__: Disable more loggings in development environment (`#6683 <https://github.com/readthedocs/readthedocs.org/pull/6683>`__)
21+
* `@davidfischer <https://github.com/davidfischer>`__: Use x-forwarded-host in local docker environment (`#6679 <https://github.com/readthedocs/readthedocs.org/pull/6679>`__)
22+
* `@humitos <https://github.com/humitos>`__: Allow user to set `build.image: testing` in the config file (`#6676 <https://github.com/readthedocs/readthedocs.org/pull/6676>`__)
23+
* `@agjohnson <https://github.com/agjohnson>`__: Add azurite --loose option (`#6669 <https://github.com/readthedocs/readthedocs.org/pull/6669>`__)
24+
* `@stsewd <https://github.com/stsewd>`__: Have more control over search tests (`#6644 <https://github.com/readthedocs/readthedocs.org/pull/6644>`__)
25+
* `@davidfischer <https://github.com/davidfischer>`__: Enable content security policy in report-only mode (`#6642 <https://github.com/readthedocs/readthedocs.org/pull/6642>`__)
26+
* `@stsewd <https://github.com/stsewd>`__: Add test settings file for proxito (`#6623 <https://github.com/readthedocs/readthedocs.org/pull/6623>`__)
27+
* `@stsewd <https://github.com/stsewd>`__: Guide: using private submodules in rtd.com (`#6527 <https://github.com/readthedocs/readthedocs.org/pull/6527>`__)
28+
129
Version 4.0.0
230
-------------
331

docker-compose.override.yml

Lines changed: 12 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -35,17 +35,17 @@ services:
3535
image: community_server:latest
3636
volumes:
3737
- ${PWD}:/usr/src/app/checkouts/readthedocs.org
38-
- ${PWD}/dockerfiles/settings/proxito.py:/usr/src/app/checkouts/readthedocs.org/readthedocs/settings/proxito.py
38+
- ${PWD}/dockerfiles/settings/proxito.py:/usr/src/app/checkouts/readthedocs.org/readthedocs/settings/proxito_docker.py
3939
environment:
40-
- DJANGO_SETTINGS_MODULE=readthedocs.settings.proxito
40+
- DJANGO_SETTINGS_MODULE=readthedocs.settings.proxito_docker
4141

4242
web:
4343
image: community_server:latest
4444
volumes:
4545
- ${PWD}:/usr/src/app/checkouts/readthedocs.org
46-
- ${PWD}/dockerfiles/settings/web.py:/usr/src/app/checkouts/readthedocs.org/readthedocs/settings/web.py
46+
- ${PWD}/dockerfiles/settings/web.py:/usr/src/app/checkouts/readthedocs.org/readthedocs/settings/web_docker.py
4747
environment:
48-
- DJANGO_SETTINGS_MODULE=readthedocs.settings.web
48+
- DJANGO_SETTINGS_MODULE=readthedocs.settings.web_docker
4949
- HOSTIP=${HOSTIP:-}
5050
extra_hosts:
5151
- "community.dev.readthedocs.io:10.10.0.100"
@@ -54,29 +54,31 @@ services:
5454
image: community_server:latest
5555
volumes:
5656
- ${PWD}:/usr/src/app/checkouts/readthedocs.org
57-
- ${PWD}/dockerfiles/settings/celery.py:/usr/src/app/checkouts/readthedocs.org/readthedocs/settings/celery.py
57+
- ${PWD}/dockerfiles/settings/celery.py:/usr/src/app/checkouts/readthedocs.org/readthedocs/settings/celery_docker.py
5858
environment:
59-
- DJANGO_SETTINGS_MODULE=readthedocs.settings.celery
59+
- DJANGO_SETTINGS_MODULE=readthedocs.settings.celery_docker
6060
- CELERY_APP_NAME=readthedocs
6161

6262
build:
6363
image: community_server:latest
6464
volumes:
6565
- ${PWD}:/usr/src/app/checkouts/readthedocs.org
66-
- ${PWD}/dockerfiles/settings/build.py:/usr/src/app/checkouts/readthedocs.org/readthedocs/settings/build.py
66+
- ${PWD}/dockerfiles/settings/build.py:/usr/src/app/checkouts/readthedocs.org/readthedocs/settings/build_docker.py
6767
environment:
68-
- DJANGO_SETTINGS_MODULE=readthedocs.settings.build
68+
- DJANGO_SETTINGS_MODULE=readthedocs.settings.build_docker
6969
- CELERY_APP_NAME=readthedocs
7070

7171
storage:
72-
image: mcr.microsoft.com/azure-storage/azurite:latest
72+
# https://github.com/Azure/Azurite
73+
# Pin the version of Azurite as there are sometimes backwards incompatible changes
74+
image: mcr.microsoft.com/azure-storage/azurite:3.5.0
7375
volumes:
7476
- storage_data:/data
7577
ports:
7678
- "10000:10000"
7779
networks:
7880
readthedocs:
79-
command: ["azurite-blob", "--silent", "--blobPort", "10000", "--blobHost", "0.0.0.0", "--location", "/data"]
81+
command: ["azurite-blob", "--silent", "--blobPort", "10000", "--blobHost", "0.0.0.0", "--location", "/data", "--loose"]
8082

8183
azure-cli:
8284
image: microsoft/azure-cli

dockerfiles/nginx/web.conf

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
server {
22
listen 80;
3+
4+
# This should match settings.PRODUCTION_DOMAIN
35
server_name community.dev.readthedocs.io;
46

57
location /favicon.ico {
@@ -17,5 +19,6 @@ server {
1719

1820
location / {
1921
proxy_pass http://web:8000/;
22+
proxy_set_header X-Forwarded-Host $host;
2023
}
2124
}

dockerfiles/settings/proxito.py

Lines changed: 3 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,25 +1,14 @@
1+
from readthedocs.settings.proxito.base import CommunityProxitoSettingsMixin
2+
13
from .docker_compose import DockerBaseSettings
24

35

4-
class ProxitoDevSettings(DockerBaseSettings):
5-
ROOT_URLCONF = 'readthedocs.proxito.urls'
6+
class ProxitoDevSettings(CommunityProxitoSettingsMixin, DockerBaseSettings):
67

78
# El Proxito does not have django-debug-toolbar installed
89
DEBUG_TOOLBAR_CONFIG = {
910
'SHOW_TOOLBAR_CALLBACK': lambda request: False,
1011
}
1112

12-
@property
13-
def MIDDLEWARE(self): # noqa
14-
classes = list(super().MIDDLEWARE)
15-
index = classes.index(
16-
'readthedocs.core.middleware.SubdomainMiddleware'
17-
)
18-
# Use our new middleware instead of the old one
19-
classes[index] = 'readthedocs.proxito.middleware.ProxitoMiddleware'
20-
classes.remove('readthedocs.core.middleware.SingleVersionMiddleware')
21-
classes.remove('django.middleware.locale.LocaleMiddleware')
22-
23-
return tuple(classes)
2413

2514
ProxitoDevSettings.load_settings(__name__)

docs/api/v3.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -436,15 +436,15 @@ Version update
436436

437437
$ curl \
438438
-X PATCH \
439-
-H "Authorization: Token <token>" https://readthedocs.org/api/v3/projects/pip/version/0.23/ \
439+
-H "Authorization: Token <token>" https://readthedocs.org/api/v3/projects/pip/versions/0.23/ \
440440
-H "Content-Type: application/json" \
441441
-d @body.json
442442

443443
.. code-tab:: python
444444

445445
import requests
446446
import json
447-
URL = 'https://readthedocs.org/api/v3/projects/pip/ersion/0.23/'
447+
URL = 'https://readthedocs.org/api/v3/projects/pip/versions/0.23/'
448448
TOKEN = '<token>'
449449
HEADERS = {'Authorization': f'token {TOKEN}'}
450450
data = json.load(open('body.json', 'rb'))

docs/development/search.rst

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ Local Development Configuration
1111

1212
Installing and running Elasticsearch
1313
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
14+
1415
You need to install and run Elasticsearch_ version 6.3 on your local development machine.
1516
You can get the installation instructions
1617
`here <https://www.elastic.co/guide/en/elasticsearch/reference/6.3/install-elasticsearch.html>`_.
@@ -20,6 +21,8 @@ Otherwise, you can also start an Elasticsearch Docker container by running the f
2021
-e "discovery.type=single-node" \
2122
docker.elastic.co/elasticsearch/elasticsearch:6.3.2
2223

24+
You need to override the ``ES_HOSTS`` and ``ELASTICSEARCH_DSL`` settings to point to ``127.0.0.1:9200``.
25+
2326
Indexing into Elasticsearch
2427
^^^^^^^^^^^^^^^^^^^^^^^^^^^
2528
For using search, you need to index data to the Elasticsearch Index. Run ``reindex_elasticsearch``

docs/development/tests.rst

Lines changed: 13 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,10 +17,20 @@ environments by running::
1717

1818
tox
1919

20-
In order to run all test including the search tests, include `"'--including-search'"`
21-
argument::
20+
By default, tox won't run tests from search,
21+
in order to run all test including the search tests,
22+
you need to override tox's posargs.
23+
If you don't have any additional arguments to pass,
24+
you can also set the ``TOX_POSARGS`` environment variable to an empty string::
2225

23-
tox "'--including-search'"
26+
TOX_POSARGS='' tox
27+
28+
.. note::
29+
30+
If you need to override tox's posargs, but you still don't want to run the search tests,
31+
you need to include ``-m 'not search'`` to your command::
32+
33+
tox -- -m 'not search' -x
2434

2535
.. warning::
2636

docs/guides/index.rst

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,3 +46,14 @@ These guides will help you customize or tune aspects of Read the Docs.
4646
sitemaps
4747
specifying-dependencies
4848
wipe-environment
49+
50+
51+
Read the Docs for Business how-to guides
52+
----------------------------------------
53+
54+
These guides are specific to :doc:`/commercial/index`.
55+
56+
.. toctree::
57+
:maxdepth: 1
58+
59+
private-submodules

docs/guides/private-submodules.rst

Lines changed: 113 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,113 @@
1+
Using Private Git Submodules
2+
============================
3+
4+
.. warning::
5+
6+
This guide is for :doc:`/commercial/index`.
7+
8+
Read the Docs uses SSH keys (with read only permissions) in order to clone private repositories.
9+
A SSH key is automatically generated and added to your main repository, but not to your submodules.
10+
In order to give Read the Docs access to clone your submodules you'll need to add the public SSH key to each repository of your submodules.
11+
12+
.. note::
13+
14+
You can manage which submodules Read the Docs should clone using a configuration file.
15+
See :ref:`config-file/v2:submodules`.
16+
17+
18+
.. contents:: Table of contents
19+
:local:
20+
:backlinks: none
21+
:depth: 2
22+
23+
24+
Copy your project's SSH Key
25+
---------------------------
26+
27+
You can find the public SSH key of your Read the Docs project by
28+
29+
#. Going to the :guilabel:`Admin` tab of your project
30+
#. Click on :guilabel:`SSH Keys`
31+
#. Click on the fingerprint of the SSH key (it looks like ``6d:ca:6d:ca:6d:ca:6d:ca``)
32+
#. Copy the text from the ``Public key`` section
33+
34+
.. note::
35+
36+
The private part of the SSH key is kept secret.
37+
38+
Add the SSH key to your submodules
39+
----------------------------------
40+
41+
GitHub
42+
~~~~~~
43+
44+
For GitHub, Read the Docs uses `deploy keys with read only access <https://developer.github.com/v3/guides/managing-deploy-keys/#deploy-keys>`__.
45+
Since GitHub doesn't allow you to reuse a deploy key across different repositories,
46+
you'll need to use `machine users <https://developer.github.com/v3/guides/managing-deploy-keys/#machine-users>`__
47+
to give read access to several repositories using only one SSH key.
48+
49+
#. Remove the SSH deploy key that was added to the main repository on GitHub
50+
51+
#. Go to your project on GitHub
52+
#. Click on :guilabel:`Settings`
53+
#. Click on :guilabel:`Deploy Keys`
54+
#. Delete the key added by ``Read the Docs Commercial (readthedocs.com)``
55+
56+
#. Create a GitHub user and give it read only permissions to all the necessary repositories.
57+
You can do this by adding the account as:
58+
59+
- A `collaborator <https://help.github.com/en/github/setting-up-and-managing-your-github-user-account/inviting-collaborators-to-a-personal-repository>`__
60+
- An `outside collaborator <https://help.github.com/en/github/setting-up-and-managing-organizations-and-teams/adding-outside-collaborators-to-repositories-in-your-organization>`__
61+
- A `team in an organization <https://help.github.com/en/github/setting-up-and-managing-organizations-and-teams/adding-organization-members-to-a-team>`__
62+
63+
#. Attach the public SSH key from your project on Read the Docs to the GitHub user you just created
64+
65+
#. Go to the user's settings
66+
#. Click on :guilabel:`SSH and GPG keys`
67+
#. Click on :guilabel:`New SSH key`
68+
#. Put a descriptive title and paste the
69+
#. :ref:`public SSH key from your Read the Docs project <guides/private-submodules:Copy your project's SSH key>`
70+
#. Click on :guilabel:`Add SSH key`
71+
72+
GitLab
73+
~~~~~~
74+
75+
For GitLab, Read the Docs uses `deploy keys with read only access <https://docs.gitlab.com/ee/ssh/#deploy-keys>`__,
76+
which allows you to reuse a SSH key across different repositories.
77+
Since Read the Docs already added the public SSH key on your main repository,
78+
you only need to add it to each repository of your submodules.
79+
80+
#. Go to the project of your submodule on GitLab
81+
#. Click on :guilabel:`Settings`
82+
#. Click on :guilabel:`Repository`
83+
#. Expand the :guilabel:`Deploy Keys` section
84+
#. Put a descriptive title and paste the
85+
#. :ref:`public SSH key from your Read the Docs project <guides/private-submodules:Copy your project's SSH key>`
86+
#. Click on :guilabel:`Add key`
87+
#. Repeat the previous steps for each submodule
88+
89+
Bitbucket
90+
~~~~~~~~~
91+
92+
For Bitbucket, Read the Docs uses `access keys with read only access <https://confluence.atlassian.com/bitbucket/access-keys-294486051.html>`__,
93+
which allows you to reuse a SSH key across different repositories.
94+
Since Read the Docs already set the public SSH key on your main repository,
95+
you only need to add it to each repository of your submodules.
96+
97+
#. Go to the project of your submodule on Bitbucket
98+
#. Click on :guilabel:`Settings`
99+
#. Click on :guilabel:`Access keys`
100+
#. Click on :guilabel:`Add key`
101+
#. Put a descriptive label and paste the
102+
#. :ref:`public SSH key from your Read the Docs project <guides/private-submodules:Copy your project's SSH key>`
103+
#. Click on :guilabel:`Add key`
104+
#. Repeat the previous steps for each submodule
105+
106+
Others
107+
~~~~~~
108+
109+
If you are not using any of the above providers.
110+
Read the Docs will still generate a pair of SSH keys.
111+
You'll need to add the :ref:`public SSH key from your Read the Docs project <guides/private-submodules:Copy your project's SSH key>`
112+
to the main repository and each of its submodules.
113+
Refer to your provider's documentation for the steps required to do this.

0 commit comments

Comments
 (0)