From e2af94a540c122151d385de6b0a94b0509dbbc22 Mon Sep 17 00:00:00 2001 From: Saint Wish <6036821+SaintWish@users.noreply.github.com> Date: Fri, 27 Sep 2024 21:07:22 -0500 Subject: [PATCH] add config option to disable enforcement --- cmd/app/app.go | 4 ++++ internal/config/config.go | 1 + runtime/config.example.yaml | 1 + 3 files changed, 6 insertions(+) diff --git a/cmd/app/app.go b/cmd/app/app.go index 4d92334..fdc344a 100644 --- a/cmd/app/app.go +++ b/cmd/app/app.go @@ -55,6 +55,10 @@ func New() (app *App) { } func (a *App) CalcHashes() error { + if (!a.Config.Verify.EnforceBins) { + return nil + } + // Calculate hash for win32 server binary a.Logger.Info("Calculating hash for Server win32 binary", "file", a.Config.Verify.ServerWinBin) fh, err := os.Open(a.Config.Verify.ServerWinBin) diff --git a/internal/config/config.go b/internal/config/config.go index e12cbc7..cc1e031 100644 --- a/internal/config/config.go +++ b/internal/config/config.go @@ -38,6 +38,7 @@ type Config struct { Verify struct { EnforceBan bool EnforceMap bool + EnforceBins bool MapListFile string BanListFile string AdminListFile string diff --git a/runtime/config.example.yaml b/runtime/config.example.yaml index 0accfbb..7603e89 100644 --- a/runtime/config.example.yaml +++ b/runtime/config.example.yaml @@ -24,6 +24,7 @@ apiauth: verify: enforceban: false enforcemap: false + enforcebins: false maplistfile: ./runtime/game/maps.json banlistfile: ./runtime/game/bans.json adminlistfile: ./runtime/game/admins.json