Jump to content
View in the app

A better way to browse. Learn more.

Froxlor Forum

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

[gelöst] webserver konfiguration wird auf zwei Servern alle 5 Minuten erneuert

Featured Replies

  • Author

Das Problem entsteht in

/var/www/froxlor/lib/Froxlor/Cron/Http/LetsEncrypt/AcmeSh.php
 

und zwar durch diese Zuweisung in Zeile 65:

$renew_domains = self::renewDomains();

Da kommt hier true raus und deswegen sollen die Configs neu geschrieben werden. Wenn ich $renew_domains eine Zeile danach auf false setze wird kein false-renew der Config mehr gemacht.

 

EDIT:

Da kommt nicht true raus - da werden alle Domains mit letsencrypt als Array zurückgegeben. Und damit ist die nachfolgende Bedingung immer erfüllt - es sei denn, man hat keine Domains mit letsencrypt. Oder sehe ich da was falsch? Eigentlich kann das auf keiner denkbaren Installation laufen wie gedacht...

jap - da hast du recht....wieso zur hölle werden bei mir nirgends die configs erneuert? xD Probier mal folgenden Patch, der sollte das eigentlich beheben:

diff --git a/lib/Froxlor/Cron/Http/LetsEncrypt/AcmeSh.php b/lib/Froxlor/Cron/Http/LetsEncrypt/AcmeSh.php
index e0e152c9..209e51b4 100644
--- a/lib/Froxlor/Cron/Http/LetsEncrypt/AcmeSh.php
+++ b/lib/Froxlor/Cron/Http/LetsEncrypt/AcmeSh.php
@@ -62,7 +62,7 @@ class AcmeSh extends \Froxlor\Cron\FroxlorCron
                        $issue_froxlor = self::issueFroxlorVhost();
                        $issue_domains = self::issueDomains();
                        $renew_froxlor = self::renewFroxlorVhost();
-                       $renew_domains = self::renewDomains();
+                       $renew_domains = self::renewDomains(true);
                        if ($issue_froxlor || $issue_domains || $renew_froxlor || $renew_domains) {
                                // insert task to generate certificates and vhost-configs
                                \Froxlor\System\Cronjob::inserttask(1);
@@ -409,7 +409,7 @@ class AcmeSh extends \Froxlor\Cron\FroxlorCron
        /**
         * get a list of domains that have a lets encrypt certificate (possible renew)
         */
-       private static function renewDomains()
+       private static function renewDomains($check = false)
        {
                $certificates_stmt = Database::query("
                        SELECT
@@ -437,6 +437,13 @@ class AcmeSh extends \Froxlor\Cron\FroxlorCron
                ");
                $renew_certs = $certificates_stmt->fetchAll(\PDO::FETCH_ASSOC);
                if ($renew_certs) {
+                       if ($check) {
+                               foreach ($renew_certs as $cert) {
+                                       if (self::checkFsFilesAreNewer($cert['domain'], $cert['expirationdate'])) {
+                                               return true;
+                                       }
+                               }
+                       }
                        return $renew_certs;
                }
                return array();

 

  • Author

Nein, funktioniert immer noch nicht. Ich habe vor der Entscheidung ein var_dump($renew_domains) eingefügt und dort wird mir nach wie vor die komplette Liste aller Domains incl. der Keys ausgegeben - auch nach dem Patch.

 

Könnte hier dran liegen:

private static function renewDomains($check = false)

damit ist $check immer false und das Ergebnis immer so wie vorher - oder nicht?

jau, nach der for schleife noch ein return false 😛

kommt sofort in git, sekunde

  • Author

Bingo - solved.

Archived

This topic is now archived and is closed to further replies.

Account

Navigation

Search

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.