-
-
Notifications
You must be signed in to change notification settings - Fork 607
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
WP cron in development needs to use curl -k
#353
Comments
We use a separate cron file for this. See here. The path it exists at is something like I just tested a default Trellis install and this file exists. Running your script says "no crontab" for all users though so I'm not sure that command finds files in Is the cron actually not working? Or you just couldn't find it? |
i do not believe that the cron is working. i have a backup plugin thats supposed to run once a day and it hasn't ran. it could be a plugin issue. i have found the file in the |
Try |
Don't forget that the default cron is set to run each 15 minutes. So there may be a delay of up to 15 minutes after the time you set you post to be published before it actually is processed. |
i have found the issue! i am using a self signed certificate and the curl request is failing. is there an appropriate way to add the |
@erikbelusic this looks like it needs to be fixed in the upstream. I'm guessing we need to add edit: or we could add the self-signed cert to the machine's root CAs. |
curl -k
@erikbelusic great debugging! @austinpray is correct that this needs to be fixed in Trellis. We'll need to check for SSL on development in here
I renamed this issue to reflect the problem. |
curl -k
curl -k
@austinpray also had a good idea to add the self-signed certificate as a root cert so it's recognized as valid. |
Haven't tried, but can't we call php directly without making an http request? Something like
|
I'd prefer to keep curl. php-cli scripts do not timeout. So if WordPress or a plugin does something horrible you can possibly get stuck with a hung process. Also curl runs the code through fpm. |
Which route do you think you want to go? I have no problem helping out. Especially since u guys did all this awesome work for the community this far =] |
Looking at this: http://unix.stackexchange.com/questions/90450/adding-a-self-signed-certificate-to-the-trusted-list @austinpray I'm not even sure that the @erikbelusic it would be great if you could test out the two methods in that post. See if curl works after doing the |
@swalkinshaw @austinpray - my findings thus far... WORKING: (same command)
OR
ALSO WORKING:
NOT WORKING:
followed by
followed by choosing "ask" presents a list of certificates, however the self signed certificate does not appear. i may have did something wrong though... not sure out of the two above options, the we should check for a self signed cert and alter cron command to include the i am not exactly sure how to do this. i know control structures aren't supported in .yml files, but i see you can trigger different tasks conditionally using the when directive within ansible. i could use some guidance here.... |
@erikbelusic this is great. Thanks for testing these out. I agree that the best solution is the You can actually can use control structures/Jinja in the YML files. It just gets ugly and should ideally be avoided. Example: https://github.com/nickjj/ansible-ferm/blob/v0.1.2/tasks/main.yml#L33-L37 The solution is probably to duplicate the Cron task and modify the |
ill give it a shot and see if i can make it work. |
i am not completely understanding register the what i am currently thinking is that in the existing cron task, we can check if {% if item.value.ssl is defined and item.value.ssl and item.value.ssl.key is not defined and item.value.ssl.cert is not defined %}
job="curl -s --cacert /etc/nginx/ssl/{{ item.key }}_self_signed.pem {{ item.value.env.wp_siteurl }}/wp-cron.php"
{% else %}
job="curl -s {{ item.value.env.wp_siteurl }}/wp-cron.php"
{% endif %}
currently untested |
@erikbelusic the registration would be done where the task is done. Just by adding I believe that variable would be available during the cron task. See http://docs.ansible.com/ansible/playbooks_variables.html#registered-variables I suggested the variable method because as you figured out that conditional is quite messy. |
Fix #353 - Allow insecure curl reqs for cron
@erikbelusic thanks for reporting and debugging this. Decided to go with the simple |
In development with an https site, the curl command for WP cron will fail due to the "insecure" self-signed certificate. Adding the `-k` flag means curl will ignore this and continue on.
* bringing-up-to-date: Added cherry-picking notice to future-me. Added TODO commit. Replace strip_www with optional redirect to www/non-www Added TODO commit. Fix roots#353 - Allow insecure curl reqs for cron Fixes roots#374 - Remove composer vendor/bin from $PATH Added 2 TODO commits. Fix roots#436 - Let WP handle 404s for PHP files Fix roots#297 - Use `php_flag` vs `php_admin_flag` Update CHANGELOG Add wp-cli command to enable permalinks when none are set Use https://api.ipify.org for IP lookup Fix bug in Vagrantfile where VMware provider variable was encapsulated as a string Add HTTP/2 notes to README WP-CLI role improvements Fix CHANGELOG entry regarding roots#435 Add variable for whitelisted IPs Switch to mainline Nginx, replaces SPDY with HTTP2
noticed my WPcrons werent running. bedrock disables them, but my trellis config has
in the wordpress_sites.yml
i checked the production server, and found that no crons were set up with the following:
am i doing something wrong or is this a bug?
The text was updated successfully, but these errors were encountered: