קוד: |
$ sudo certbot renew --pre-hook "service nginx stop" --post-hook "service nginx start"
Saving debug log to /var/log/letsencrypt/letsencrypt.log - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Processing /etc/letsencrypt/renewal/kafkafim.privatedns.org.conf - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Cert is due for renewal, auto-renewing... Plugins selected: Authenticator standalone, Installer None Running pre-hook command: service nginx stop Renewing an existing certificate Performing the following challenges: http-01 challenge for kafkafim.privatedns.org Waiting for verification... Cleaning up challenges Attempting to renew cert (kafkafim.privatedns.org) from /etc/letsencrypt/renewal/kafkafim.privatedns.org.conf produced an unexpected error: Failed authorization procedure. kafkafim.privatedns.org (http-01): urn:ietf:params:acme:error:connection :: The server could not connect to the client to verify the domain :: Fetching http://kafkafim.privatedns.org/.well-known/acme-challenge/v8fTDIq-SEVVaxUKCOtCM0B9Rt_yRq6267vhTEq-6kI: Timeout during connect (likely firewall problem). Skipping. All renewal attempts failed. The following certs could not be renewed: /etc/letsencrypt/live/kafkafim.privatedns.org/fullchain.pem (failure) - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - All renewal attempts failed. The following certs could not be renewed: /etc/letsencrypt/live/kafkafim.privatedns.org/fullchain.pem (failure) - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Running post-hook command: service nginx start 1 renew failure(s), 0 parse failure(s) IMPORTANT NOTES: - The following errors were reported by the server: Domain: kafkafim.privatedns.org Type: connection Detail: Fetching http://kafkafim.privatedns.org/.well-known/acme-challenge/v8fTDIq-SEVVaxUKCOtCM0B9Rt_yRq6267vhTEq-6kI: Timeout during connect (likely firewall problem) To fix these errors, please make sure that your domain name was entered correctly and the DNS A/AAAA record(s) for that domain contain(s) the right IP address. Additionally, please check that your computer has a publicly routable IP address and that no firewalls are preventing the server from communicating with the client. If you're using the webroot plugin, you should also verify that you are serving files from the webroot path you provided. |
קוד: |
http://kafkafim.privatedns.org/.well-known/acme-challenge/v8fTDIq-SEVVaxUKCOtCM0B9Rt_yRq6267vhTEq-6kI:
Timeout during connect (likely firewall problem) |
ציטוט: |
בשביל חידוש אוטומטי אתה צריך לתזמן אותו בשרת עם timer או cron. זה לא תלוי ב־certbot. |
ציטוט: |
בחלק מההפצות ההתקנה של certbot כבר כוללת את התזמון האוטומטי של החידוש אם בעזרת cron או systemd |
קוד: |
# /etc/crontab: system-wide crontab
# Unlike any other crontab you don't have to run the `crontab' # command to install the new version when you edit this file # and files in /etc/cron.d. These files also have username fields, # that none of the other crontabs do. SHELL=/bin/sh PATH=/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin # Example of job definition: # .---------------- minute (0 - 59) # | .------------- hour (0 - 23) # | | .---------- day of month (1 - 31) # | | | .------- month (1 - 12) OR jan,feb,mar,apr ... # | | | | .---- day of week (0 - 6) (Sunday=0 or 7) OR sun,mon,tue,wed,thu,fri,sat # | | | | | # * * * * * user-name command to be executed 17 * * * * root cd / && run-parts --report /etc/cron.hourly 25 6 * * * root test -x /usr/sbin/anacron || ( cd / && run-parts --report /etc/cron.daily ) 47 6 * * 7 root test -x /usr/sbin/anacron || ( cd / && run-parts --report /etc/cron.weekly ) 52 6 1 * * root test -x /usr/sbin/anacron || ( cd / && run-parts --report /etc/cron.monthly ) # |
קוד: |
# /etc/cron.d/certbot: crontab entries for the certbot package
# # Upstream recommends attempting renewal twice a day # # Eventually, this will be an opportunity to validate certificates # haven't been revoked, etc. Renewal will only occur if expiration # is within 30 days. # # Important Note! This cronjob will NOT be executed if you are # running systemd as your init system. If you are running systemd, # the cronjob.timer function takes precedence over this cronjob. For # more details, see the systemd.timer manpage, or use systemctl show # certbot.timer. SHELL=/bin/sh PATH=/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin 0 */12 * * * root test -x /usr/bin/certbot -a \! -d /run/systemd/system && perl -e 'sleep int(rand(43200))' && certbot -q renew |
Anonymous : |
נראה שאכן ההפצה שלי כבר כוללת את החידוש האוטומטי. פשוט לא מכיר את הפיצ'ר cron אבל מבין שיש כמה אפשרויות הגדרה: כללית יותר דרך crontab ופרטנית מתחת לתיקיה cron.d (ראו קבצים מצורפים).
רואה שהחידוש כבר מופיע בקובץ cerbot תחת cron.d: אם אני מבין נכון את השורה (לפי ההגדרות שמופיעות בקובץ crontab), אז כל 12 שעות מתבצעת הפקודה שמופיעה שם. לא ברור מה היא אמורה לעשות: לבצע חידוש או לבדוק אם דרוש חידוש? |
Anonymous : |
בנוסף לכך, אני צריך לבדוק מדוע החידוש לא בוצע עד כה: יתכן שבעיית התקשורת שצוינה לעיל - חוסר גישה מבחוץ עקב שינוי IP ובעיה בעדכון DDNS - גרמה למניעת החידוש.. ואם כבר אנחנו מדברים על בעיית DDNS : אני צריך לבדוק האם ניתן באמצעות cron - בדיקה אחת לכמה זמן ואם IP השתנה אז לעדכן אותו באתר freedns.afraid.org. רק עכשיו הכרתי את cron ולא יודע אם זה אפשרי?? |
ציטוט: |
לא בדקתי בקוד. מאחר שזה כל 12 שעות, אני מנחש שזה בודק, לא מבצע. אבל אולי אם הבדיקה מראה שנדרש חידוש, זה גם יבצע. צריך לבדוק בקוד. |
ציטוט: |
זה אפשרי. לפני זה אתה צריך סקריפט לא אינטראקטיבי, |
Anonymous : | ||
איפה נמצא הקוד? רוצה לבדוק מה עושה בדיוק.. |
ציטוט: |
זה אפשרי. לפני זה אתה צריך סקריפט לא אינטראקטיבי, |
Anonymous : | ||||||
כנראה ש usr/bin/certbot/
מציע לעזוב לעת עתה את ענין ה"לא אינטראקטיבי". תתחיל בזה שב shell תכתוב, ידנית, פקודה, או פקודות, שימצאו מה ה IP החיצוני שלך. ופקודה, או פקודות, אחרות, שימצאו מה ה IP שה DNS מצביע עליו. בשביל סקריפט לא חסרים קישורים באינטרנט. נסה לחפש sh script howto, או bash script howto. משהו קצר בעברית, רק כדי לקבל מושג, יש, למשל, ב https://he.wikipedia.org/wiki/%D7%91%D7%90%D7%A9#Bash_Scripting . |
ציטוט: |
# Important Note! This cronjob will NOT be executed if you are
# running systemd as your init system. If you are running systemd, # the cronjob.timer function takes precedence over this cronjob. For # more details, see the systemd.timer manpage, or use systemctl show # certbot.timer. |
ציטוט: |
האם אין סקריפט מוכן באתר של ה ddns? אם לא עובד טוב, יכול להיות שיהיה קל יותר לבדוק למה. |
Anonymous : |
אני הולך ללמוד את מה שהצעת לגבי כתיבת סקריפט בהדרגה..
אבל אני רואה את ההערה הבאה שמופיעה בקובץ certbot שנמצא תחת תיקיית cron.d שהצגתי בפוסט קודם, ויכול להיות שאני מבין מדוע החידוש האוטומטי לא עבד.. הם טוענים שאם init מבוסס על systemd (שזה המצב ב PI שלי), |
Anonymous : |
אז צריך להפעיל את החידוש עם timer במקום cron. לא ברור לי למה אבל זה ההסבר.. תודה |
קוד: |
# Important Note! This cronjob will NOT be executed if you are
# running systemd as your init system. If you are running systemd, # the cronjob.timer function takes precedence over this cronjob. For # more details, see the systemd.timer manpage, or use systemctl show # certbot.timer. |
Anonymous : | ||
הגיוני מה שאתה אומר אבל מסתבר שהמנגנון הזה לפעמים לא עובד.. יש סקריפט מובנה בראוטר שלי DLINK ויש הוראות איך להפעיל אותו עם קוד מסוים שמקבלים מהאתר freedns.afraid.org .. המנגנון הזה עובד בשוטף. אם אני מנתק את הכבל לבזק ומחזיר אותו ובודק שהתחלף IP, אני רואה שזה עובד ויש גישה לאתר שלי. אבל לפעמים זה פתאום לא עובד, במיוחד כשיש הפסקות חשמל.. אם יש דרך לדבג את זה אשמח לדעת. לכן הייתי רוצה לעשות את זה עם סקריפט.. |