Skip to content

chore(na): nginx restart in certbot cronjob#2114

Merged
mrjones-plip merged 1 commit intomainfrom
mrjones-plip-patch-1
Mar 25, 2026
Merged

chore(na): nginx restart in certbot cronjob#2114
mrjones-plip merged 1 commit intomainfrom
mrjones-plip-patch-1

Conversation

@mrjones-plip
Copy link
Copy Markdown
Contributor

@mrjones-plip mrjones-plip commented Jan 15, 2026

Description

Our TLS docs have certbot attempt to renew the cert, but it does not restart nginx. This means new certs won't get loaded.

This PR adds an nginx reload call to the cronjob.

this issue was discovered in a Medic production instance (see private ticket)

License

The software is provided under AGPL-3.0. Contributions to this project are accepted under the same license.

@mrjones-plip mrjones-plip requested a review from 1yuv January 15, 2026 14:44
@andrablaj andrablaj moved this to 💻 In Progress in CHT Stewardship Activities Q1 2026 Jan 16, 2026
@mrjones-plip mrjones-plip changed the title Add nginx restart to certbot cronjob chore(na): nginx restart in certbot cronjob Jan 19, 2026
@andrablaj
Copy link
Copy Markdown
Member

@1yuv would you be available to review this small PR? Thanks!

Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Updates the TLS/Certbot hosting documentation to ensure nginx reloads after automated certificate renewal so renewed certs are actually picked up by the running nginx container.

Changes:

  • Extend the documented certbot cronjob to reload nginx after running certbot.
  • Add clarification to verify the nginx container name (cht_nginx_1) before using the cronjob command.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread content/en/hosting/cht/docker/adding-tls-certificates.md
Comment thread content/en/hosting/cht/docker/adding-tls-certificates.md
Comment thread content/en/hosting/cht/docker/adding-tls-certificates.md
Copy link
Copy Markdown
Member

@1yuv 1yuv left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi @mrjones-plip , I tagged @copilot to review and there are some good points that need to address.

Copy link
Copy Markdown
Contributor

Copilot AI commented Mar 19, 2026

@1yuv I've opened a new pull request, #2153, to work on those changes. Once the pull request is ready, I'll request review from you.

@mrjones-plip
Copy link
Copy Markdown
Contributor Author

Thanks for the review @1yuv!

This PR does not mention anything about renewing daily. Indeed, the line 124 literally says Attempt to renew your certificates once a week.

Can you confirm you tested all the suggested copilot changes in an environment with a public IP and DNS entry to ensure the certbot cert gets issued and restarts nginx correctly? That's what I did when authoring this ticket so I want to be sure this level of detail is done when making changes with so many dependencies.

@1yuv
Copy link
Copy Markdown
Member

1yuv commented Mar 25, 2026

#2114 (comment) about renewing daily.

First line of this PR description has this

Our TLS docs have certbot attempt to renew every day, but it does not restart nginx. This means new certs won't get loaded.

That's why Copilot was suggesting

Either update the PR description or adjust the documented schedule so they match.

I did not test the copilot suggestions. When I checked them, they appeard like only an enhancement to the commands you used. If you saw anything misleading, please discard the suggestion.

@mrjones-plip
Copy link
Copy Markdown
Contributor Author

Ah - I see that now - thanks for taking a second to call it out. I thought it had hallucinated - I'm sorry for my confusion!

I've updated my PR description and given comments on the PR feedback

@mrjones-plip mrjones-plip requested a review from 1yuv March 25, 2026 13:40
Copy link
Copy Markdown
Member

@1yuv 1yuv left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me.

@mrjones-plip mrjones-plip merged commit 8c988e1 into main Mar 25, 2026
6 checks passed
@github-project-automation github-project-automation Bot moved this from 💻 In Progress to 🚀 Done in CHT Stewardship Activities Q1 2026 Mar 25, 2026
@mrjones-plip mrjones-plip deleted the mrjones-plip-patch-1 branch March 25, 2026 20:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

No open projects
Status: 🚀 Done

Development

Successfully merging this pull request may close these issues.

5 participants