Skip to content

Commit 4ac0c87

Browse files
humitosagjohnson
authored andcommitted
Merge pull request #8559 from readthedocs/humitos/update-ca-certificates
Build: update ca-certificates before cloning
1 parent 5c9a6ab commit 4ac0c87

File tree

2 files changed

+23
-0
lines changed

2 files changed

+23
-0
lines changed

readthedocs/projects/models.py

+5
Original file line numberDiff line numberDiff line change
@@ -1642,6 +1642,7 @@ def add_features(sender, **kwargs):
16421642
ALL_VERSIONS_IN_HTML_CONTEXT = 'all_versions_in_html_context'
16431643
CACHED_ENVIRONMENT = 'cached_environment'
16441644
LIMIT_CONCURRENT_BUILDS = 'limit_concurrent_builds'
1645+
UPDATE_CA_CERTIFICATES = 'update_ca_certificates'
16451646

16461647
# Versions sync related features
16471648
SKIP_SYNC_TAGS = 'skip_sync_tags'
@@ -1725,6 +1726,10 @@ def add_features(sender, **kwargs):
17251726
LIMIT_CONCURRENT_BUILDS,
17261727
_('Limit the amount of concurrent builds'),
17271728
),
1729+
(
1730+
UPDATE_CA_CERTIFICATES,
1731+
_('Update ca-certificates Ubuntu package before VCS clone'),
1732+
),
17281733

17291734
# Versions sync related features
17301735
(

readthedocs/projects/tasks.py

+18
Original file line numberDiff line numberDiff line change
@@ -901,6 +901,24 @@ def setup_vcs(self, environment):
901901
"""
902902
environment.update_build(state=BUILD_STATE_CLONING)
903903

904+
# Install a newer version of ca-certificates packages because it's
905+
# required for Let's Encrypt certificates
906+
# https://github.com/readthedocs/readthedocs.org/issues/8555
907+
# https://community.letsencrypt.org/t/openssl-client-compatibility-changes-for-let-s-encrypt-certificates/143816
908+
# TODO: remove this when a newer version of ``ca-certificates`` gets
909+
# pre-installed in the Docker images
910+
if self.project.has_feature(Feature.UPDATE_CA_CERTIFICATES):
911+
self.setup_env.run(
912+
'apt-get', 'update', '--assume-yes', '--quiet',
913+
user=settings.RTD_DOCKER_SUPER_USER,
914+
record=False,
915+
)
916+
self.setup_env.run(
917+
'apt-get', 'install', '--assume-yes', '--quiet', 'ca-certificates',
918+
user=settings.RTD_DOCKER_SUPER_USER,
919+
record=False,
920+
)
921+
904922
log.info(
905923
LOG_TEMPLATE,
906924
{

0 commit comments

Comments
 (0)