-
-
Notifications
You must be signed in to change notification settings - Fork 3.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fire a signal for domain verification (eg. for SSL) #5071
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I like the idea!
I left two comments about minor things to be improved if you consider.
readthedocs/projects/tasks.py
Outdated
@@ -1393,3 +1394,17 @@ def finish_inactive_builds(): | |||
'Builds marked as "Terminated due inactivity": %s', | |||
builds_finished, | |||
) | |||
|
|||
|
|||
@app.task |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I suppose that you should pass queue='web'
since we are accessing the database from inside the task.
@@ -726,7 +727,14 @@ def get_success_url(self): | |||
|
|||
|
|||
class DomainList(DomainMixin, ListViewWithForm): | |||
pass | |||
def get_context_data(self, **kwargs): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think it's better to put this code under get
method, don't you think?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think that would be worse, actually. We need access to the domain_list
from the context. The get
method both calls get_context_data
and consumes the context (but doesn't return it). As a result, we'd have to replace get
and not merely call the super method and add functionality. Does that make sense?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good after the update to the web
queue.
Pushed a commit to fix my only issue. This is 👍 for shipping. |
We have had a few issues where domains have taken a long time to issue SSL certificates (example #4736 (comment)). Cloudflare -- who provides our SSL certs for custom domains -- automatically retries verification requests but they have an exponential backoff and then they stop retrying after a couple weeks. That means that if you add your domain to RTD and then don't fix your DNS for a day or two, it can take days to verify your domain. Users could of course remove the domain from RTD and re-add it but few people seem to do that.
This PR fires a task which fires signals which are handled in the cloudflare code (not in the readthedocs.org repo) to automatically retry verification whenever somebody visits the domain list screen (
/dashboard/<project_slug>/domains/
)