Files
labca/patches/updater_continuous.patch
2024-08-31 16:04:55 +02:00

43 lines
998 B
Diff

diff --git a/crl/updater/continuous.go b/crl/updater/continuous.go
index 4597fd60a..5ee00d765 100644
--- a/crl/updater/continuous.go
+++ b/crl/updater/continuous.go
@@ -3,6 +3,7 @@ package updater
import (
"context"
"math/rand/v2"
+ "os"
"sync"
"time"
@@ -16,6 +17,29 @@ import (
func (cu *crlUpdater) Run(ctx context.Context) error {
var wg sync.WaitGroup
+ // If there is no .crl file yet, generate one (after a delay to let all other
+ // components start up fully).
+ // Dirty hack to check filesystem directly instead of using the crl-storer...
+ files, err := os.ReadDir("/opt/wwwstatic/crl/")
+ if err != nil {
+ return err
+ }
+ present := false
+ for _, file := range files {
+ if file.Name() != "root-ca.crl" {
+ present = true
+ }
+ }
+ if !present {
+ select {
+ case <-ctx.Done():
+ return ctx.Err()
+ case <-time.After(2 * time.Minute):
+ }
+
+ cu.RunOnce(ctx)
+ }
+
shardWorker := func(issuerNameID issuance.NameID, shardIdx int) {
defer wg.Done()