Skip to content

Commit

Permalink
add config option to disable enforcement
Browse files Browse the repository at this point in the history
  • Loading branch information
SaintWish committed Sep 28, 2024
1 parent 52b5475 commit e2af94a
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 0 deletions.
4 changes: 4 additions & 0 deletions cmd/app/app.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
1 change: 1 addition & 0 deletions internal/config/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ type Config struct {
Verify struct {
EnforceBan bool
EnforceMap bool
EnforceBins bool
MapListFile string
BanListFile string
AdminListFile string
Expand Down
1 change: 1 addition & 0 deletions runtime/config.example.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit e2af94a

Please sign in to comment.