From 989056d0b901c23a47a9c27308a565c7b48cf60f Mon Sep 17 00:00:00 2001
From: Matthew Baggett <matthew@baggett.me>
Date: Wed, 22 Mar 2023 08:12:05 +0100
Subject: [PATCH] If there is no secrets, just run like a normal system.

---
 syncer/Sync.php | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/syncer/Sync.php b/syncer/Sync.php
index 21c9c74..bd79e85 100644
--- a/syncer/Sync.php
+++ b/syncer/Sync.php
@@ -44,6 +44,12 @@ class Sync
         $this->storageFilesystem = new StorageFilesystem();
         $this->localFilesystem = new LocalFilesystem();
 
+        if(!isset($environment['S3_API_KEY']) || !isset($environment['S3_API_SECRET'])){
+            $this->logger->warning(sprintf('%s S3_API_KEY/S3_API_SECRET missing, so running in non-storing mode like a normal database.', Emoji::CHARACTER_NERD_FACE));
+            sleep(60);
+            exit;
+        }
+
         if ($this->args->hasOpt('postgres') || isset($environment['PG_VERSION'])) {
             // Postgres mode is enabled if --postgres is set, or PG_VERSION envvar is set,
             // which it is when we're built ontop of the postgres docker container