Skip to content

Commit 7cdc6f8

Browse files
committed
Merge branch 'master' into davidfischer/version-truncated-message
2 parents 3f33541 + 50c63f7 commit 7cdc6f8

File tree

217 files changed

+22543
-3468
lines changed

Some content is hidden

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

217 files changed

+22543
-3468
lines changed

.dockerignore

+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
# We only use the requirements folder in the Dockerfile
2+
*
3+
!requirements/

.env

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
COMPOSE_PROJECT_NAME=community

.github/workflows/main.yml

+20
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
name: CI
2+
3+
on:
4+
push:
5+
branches:
6+
- master
7+
8+
jobs:
9+
build:
10+
11+
runs-on: ubuntu-latest
12+
13+
steps:
14+
- name: Trigger tests in corporate
15+
run: |
16+
curl --request POST \
17+
--silent --output /dev/null \
18+
--url https://circleci.com/api/v1.1/project/github/${{ secrets.CORPORATE_REPO }}/tree/master \
19+
--user '${{ secrets.CIRCLECI_USER_TOKEN }}:' \
20+
--data 'build_parameters[CIRCLE_JOB]=${{ secrets.CIRCLECI_JOB }}'

.gitignore

+5-1
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,8 @@ contrib/supervisord.pid
2222
celerybeat-schedule.*
2323
deploy/.vagrant
2424
dist/*
25+
docker/azurite
26+
docker/search
2527
local_settings.py
2628
locks/**
2729
logs/*
@@ -37,7 +39,6 @@ media/pdf
3739
media/static
3840
/static
3941
node_modules
40-
package-lock.json
4142
readthedocs/rtd_tests/builds
4243
readthedocs/rtd_tests/tests/builds
4344
user_builds
@@ -66,3 +67,6 @@ env.bak/
6667
venv.bak/
6768

6869
dev.db-journal
70+
/readthedocs/settings/build.py
71+
/readthedocs/settings/celery.py
72+
/readthedocs/settings/web.py

.travis.yml

+9-9
Original file line numberDiff line numberDiff line change
@@ -2,36 +2,36 @@ language: python
22
python:
33
- 3.6
44
dist: xenial
5-
matrix:
5+
6+
jobs:
67
include:
78
- python: 3.6
89
env: TOXENV=py36,codecov ES_VERSION=6.2.4 ES_DOWNLOAD_URL=https://artifacts.elastic.co/downloads/elasticsearch/elasticsearch-${ES_VERSION}.tar.gz
910
- python: 3.6
1011
env: TOXENV=docs
12+
- python: 3.6
13+
env: TOXENV=docs-linkcheck
1114
- python: 3.6
1215
env: TOXENV=docs-lint
1316
- python: 3.6
1417
env: TOXENV=lint
1518
script: tox
1619
- python: 3.6
17-
env: TOXENV=eslint
20+
env: TOXENV=eslint NODE_VERSION=10.17.0
1821
- python: 3.6
1922
env: TOXENV=migrations
23+
24+
allow_failures:
25+
- env: TOXENV=docs-linkcheck
2026
cache:
2127
directories:
2228
- ~/.cache/pip
2329
- ~/.nvm/nvm.sh
2430
- ~/.npm
2531
install:
2632
- ./scripts/travis/install_elasticsearch.sh
33+
- ./scripts/travis/install_node.sh
2734
- pip install tox-travis
28-
- curl -o- https://raw.githubusercontent.com/creationix/nvm/v0.33.2/install.sh | bash
29-
- source ~/.nvm/nvm.sh
30-
- nvm install --lts
31-
- nvm use --lts
32-
- npm install -g bower
33-
- npm install
34-
- bower install
3535
script:
3636
- ./scripts/travis/run_tests.sh
3737
notifications:

AUTHORS.rst

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
Read the Docs Team
22
==================
33

4-
The core Read the Docs team is described at http://docs.readthedocs.io/en/latest/team.html
4+
The core Read the Docs team is described at https://docs.readthedocs.io/en/latest/team.html
55

66
Original Authors
77
===============

CHANGELOG.rst

+1,759-1,517
Large diffs are not rendered by default.

README.rst

+2-2
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ Bazaar_, Git_, and Mercurial_ repositories.
1212
Then we build documentation and host it for you.
1313
Think of it as *Continuous Documentation*.
1414

15-
.. _Read the docs: http://readthedocs.org/
15+
.. _Read the docs: https://readthedocs.org/
1616
.. _Sphinx: http://www.sphinx-doc.org/
1717
.. _reStructuredText: http://www.sphinx-doc.org/en/master/usage/restructuredtext/basics.html
1818
.. _Subversion: http://subversion.tigris.org/
@@ -36,7 +36,7 @@ You can find information about getting in touch with Read the Docs at our `Contr
3636
Contributing
3737
------------
3838

39-
You can find information about contributing to Read the Docs at our `Contribution page <http://docs.readthedocs.io/en/latest/contribute.html>`_.
39+
You can find information about contributing to Read the Docs at our `Contribution page <https://docs.readthedocs.io/en/latest/contribute.html>`_.
4040

4141
Quickstart for GitHub-Hosted Projects
4242
-------------------------------------

contrib/changelog.hbs

-7
This file was deleted.

docker-compose.override.yml

+91
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,91 @@
1+
# docker-compose.override.yml file to launch a full instance of Read the Docs.
2+
#
3+
# Read the Docs' Core team is using docker-compose internally.
4+
# We do not offer support on this file and configuration at this point.
5+
# DO NOT USE DOCKER-COMPOSE SETUP FOR PRODUCTION OR CUSTOM INSTALLATION.
6+
7+
# We create this network here to be able to use a static IP for NGINX.
8+
# This is needed because hitting `community.dev.readthedocs.io` from
9+
# any service will fail since it will resolve to 127.0.0.1, but
10+
# instead we need to hit NGINX's IP (this is used on Embed API from
11+
# -ext for example) Setting a static IP for NGINX, allow us to
12+
# override /etc/hosts with this IP.
13+
version: '3'
14+
15+
networks:
16+
readthedocs:
17+
driver: bridge
18+
ipam:
19+
config:
20+
- subnet: 10.10.0.0/16
21+
22+
services:
23+
24+
server:
25+
build:
26+
args:
27+
GITHUB_TOKEN: ${GITHUB_TOKEN:-}
28+
29+
nginx:
30+
networks:
31+
readthedocs:
32+
ipv4_address: 10.10.0.100
33+
34+
proxito:
35+
image: community_server:latest
36+
volumes:
37+
- ${PWD}:/usr/src/app/checkouts/readthedocs.org
38+
- ${PWD}/dockerfiles/settings/proxito.py:/usr/src/app/checkouts/readthedocs.org/readthedocs/settings/proxito.py
39+
environment:
40+
- DJANGO_SETTINGS_MODULE=readthedocs.settings.proxito
41+
42+
web:
43+
image: community_server:latest
44+
volumes:
45+
- ${PWD}:/usr/src/app/checkouts/readthedocs.org
46+
- ${PWD}/dockerfiles/settings/web.py:/usr/src/app/checkouts/readthedocs.org/readthedocs/settings/web.py
47+
environment:
48+
- DJANGO_SETTINGS_MODULE=readthedocs.settings.web
49+
- HOSTIP=${HOSTIP:-}
50+
extra_hosts:
51+
- "community.dev.readthedocs.io:10.10.0.100"
52+
53+
celery:
54+
image: community_server:latest
55+
volumes:
56+
- ${PWD}:/usr/src/app/checkouts/readthedocs.org
57+
- ${PWD}/dockerfiles/settings/celery.py:/usr/src/app/checkouts/readthedocs.org/readthedocs/settings/celery.py
58+
environment:
59+
- DJANGO_SETTINGS_MODULE=readthedocs.settings.celery
60+
- CELERY_APP_NAME=readthedocs
61+
62+
build:
63+
image: community_server:latest
64+
volumes:
65+
- ${PWD}:/usr/src/app/checkouts/readthedocs.org
66+
- ${PWD}/dockerfiles/settings/build.py:/usr/src/app/checkouts/readthedocs.org/readthedocs/settings/build.py
67+
environment:
68+
- DJANGO_SETTINGS_MODULE=readthedocs.settings.build
69+
- CELERY_APP_NAME=readthedocs
70+
71+
storage:
72+
image: mcr.microsoft.com/azure-storage/azurite:latest
73+
volumes:
74+
- storage_data:/data
75+
ports:
76+
- "10000:10000"
77+
networks:
78+
readthedocs:
79+
command: ["azurite-blob", "--silent", "--blobPort", "10000", "--blobHost", "0.0.0.0", "--location", "/data"]
80+
81+
azure-cli:
82+
image: microsoft/azure-cli
83+
volumes:
84+
- ${PWD}/common/dockerfiles/scripts/create-containers.sh:/usr/local/bin/create-containers.sh
85+
links:
86+
- storage
87+
depends_on:
88+
- storage
89+
networks:
90+
readthedocs:
91+
command: ["/usr/local/bin/create-containers.sh"]

dockerfiles/Dockerfile

+54
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,54 @@
1+
FROM ubuntu:18.04
2+
3+
ARG GITHUB_TOKEN
4+
5+
ENV DEBIAN_FRONTEND noninteractive
6+
ENV LANG en_US.UTF-8
7+
ENV LANGUAGE en_US:en
8+
ENV LC_ALL en_US.UTF-8
9+
10+
RUN apt-get -y update
11+
RUN apt-get -y install \
12+
curl \
13+
g++ \
14+
git-core \
15+
libevent-dev \
16+
libpq-dev \
17+
libxml2-dev \
18+
libxslt1-dev \
19+
locales \
20+
build-essential \
21+
python3-pip \
22+
python3-dev \
23+
postgresql-client \
24+
libmysqlclient-dev \
25+
libfreetype6 \
26+
libjpeg-dev \
27+
sqlite \
28+
netcat \
29+
telnet
30+
31+
# Uncomment en_US.UTF-8 locale and generate it
32+
RUN sed -i -e 's/# en_US.UTF-8 UTF-8/en_US.UTF-8 UTF-8/' /etc/locale.gen && \
33+
locale-gen
34+
35+
RUN pip3 install --no-cache-dir --upgrade pip
36+
37+
# Ensure that ``python`` is in the PATH so that ``./manage.py`` works
38+
RUN ln -s /usr/bin/python3 /usr/bin/python
39+
40+
WORKDIR /tmp
41+
42+
RUN curl -O https://raw.githubusercontent.com/readthedocs/readthedocs.org/master/requirements/pip.txt
43+
RUN curl -O https://raw.githubusercontent.com/readthedocs/readthedocs.org/master/requirements/docker.txt
44+
RUN pip3 install --no-cache-dir -r docker.txt
45+
46+
# Install readthedocs-ext only if GITHUB_TOKEN is provided
47+
WORKDIR /usr/src/app/checkouts/
48+
RUN if [ -n "$GITHUB_TOKEN" ] ; \
49+
then \
50+
git clone --depth 1 https://${GITHUB_TOKEN}@github.com/readthedocs/readthedocs-ext ; \
51+
pip3 install --no-cache-dir -e readthedocs-ext ; \
52+
fi
53+
54+
WORKDIR /usr/src/app/checkouts/readthedocs.org

dockerfiles/README.rst

+7
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
Docker configuration files
2+
==========================
3+
4+
Read the Docs' Core team is using docker-compose internally.
5+
We do not offer support on this configuration at this point.
6+
7+
**DO NOT USE DOCKER-COMPOSE SETUP FOR PRODUCTION OR CUSTOM INSTALLATION**

dockerfiles/nginx/proxito.conf

+58
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,58 @@
1+
# Proxito
2+
server {
3+
listen 80 default_server;
4+
server_name *.community.dev.readthedocs.io *.org.dev.readthedocs.build;
5+
6+
# TODO: serve the favicon.ico from the project/version itself instead
7+
location /favicon.ico {
8+
proxy_pass http://storage:10000/devstoreaccount1/static/images/favicon.ico;
9+
break;
10+
}
11+
12+
# Redirect old URLs to our new domain
13+
# external-builds.readthedocs.io/<type>/<slug>/<pr-number>/
14+
location ~* ^/html/(?P<project>.+)/(?P<version>.+)/(?P<path>.*) {
15+
add_header X-Served Nginx-External-Redirect always;
16+
rewrite ^ http://$project--$version.org.dev.readthedocs.build/page/$path;
17+
}
18+
19+
# Proxito doc serving
20+
location / {
21+
proxy_pass http://proxito:8000;
22+
proxy_set_header Host $host;
23+
proxy_intercept_errors on;
24+
error_page 404 = @notfoundfallback;
25+
26+
add_header X-Served Django-Proxito always;
27+
}
28+
29+
# Sendfile support to serve the actual files that Proxito has specified
30+
location /proxito/ {
31+
internal;
32+
# Nginx will strip the `/proxito/` and pass just the `$storage/$type/$proj/$ver/$filename`
33+
proxy_pass http://storage:10000/;
34+
proxy_set_header Host storage:10000;
35+
proxy_set_header X-Real-IP $remote_addr;
36+
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
37+
proxy_set_header X-Forwarded-Host $host;
38+
39+
40+
proxy_intercept_errors on;
41+
error_page 404 = @notfoundfallback;
42+
43+
add_header X-Served Nginx-Proxito-Sendfile always;
44+
add_header X-RTD-Project $upstream_http_x_rtd_project always;
45+
}
46+
47+
# Serve 404 pages here
48+
location @notfoundfallback {
49+
proxy_pass http://proxito:8000/_proxito_404_$request_uri;
50+
51+
proxy_set_header Host $http_host;
52+
proxy_set_header X-Real-IP $remote_addr;
53+
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
54+
proxy_set_header X-Forwarded-Host $host;
55+
add_header X-Served Proxito-404-Fallback always;
56+
}
57+
58+
}

dockerfiles/nginx/web.conf

+21
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
server {
2+
listen 80;
3+
server_name community.dev.readthedocs.io;
4+
5+
location /favicon.ico {
6+
proxy_pass http://storage:10000/devstoreaccount1/static/images/favicon.ico;
7+
break;
8+
}
9+
10+
# FIXME: this is a workaround because CORS on the storage.
11+
# The command to enable it is failing without reason:
12+
# pip install azure-cli
13+
# AZURE_STORAGE_CONNECTION_STRING="UseDevelopmentStorage=true" az storage cors add --origins 'community.dev.readthedocs.io' --services 'b' --methods GET OPTIONS HEAD --allowed-headers '*'
14+
location /devstoreaccount1 {
15+
proxy_pass http://storage:10000$request_uri;
16+
}
17+
18+
location / {
19+
proxy_pass http://web:8000/;
20+
}
21+
}

dockerfiles/requirements

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
../requirements

dockerfiles/settings/build.py

+12
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
from .docker_compose import DockerBaseSettings
2+
3+
4+
class BuildDevSettings(DockerBaseSettings):
5+
6+
@property
7+
def DATABASES(self): # noqa
8+
return {}
9+
10+
DONT_HIT_DB = True
11+
12+
BuildDevSettings.load_settings(__name__)

0 commit comments

Comments
 (0)