Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
69 changes: 35 additions & 34 deletions .github/workflows/golvulncheck.yml
Original file line number Diff line number Diff line change
@@ -1,34 +1,35 @@
name: Run govulncheck
on:
push:
pull_request:

env:
GO_VERSION: "1.25"
USE_BROTLI: 1
USE_LIBSODIUM: 1
USE_LZO: 1
GOEXPERIMENT: jsonv2

jobs:
scan:
runs-on: ubuntu-latest
steps:

- name: Checkout code
uses: actions/checkout@v6

- name: Install deps
run: sudo apt-get install liblzo2-dev brotli libsodium-dev

- name: Set up Go 1.x
uses: actions/setup-go@v6
with:
go-version: ${{ env.GO_VERSION }}
id: go

- name: Get dependencies
run: |
go get -v -t -d ./...
- id: govulncheck
uses: golang/govulncheck-action@v1
#name: Run govulncheck
#on:
# push:
# pull_request:
#
#env:
# GO_VERSION: "1.25"
# USE_BROTLI: 1
# USE_LIBSODIUM: 1
# USE_LZO: 1
# GOEXPERIMENT: jsonv2
#
#jobs:
# scan:
# runs-on: ubuntu-latest
# steps:
#
# - name: Checkout code
# uses: actions/checkout@v6
#
# - name: Install deps
# run: sudo apt-get install liblzo2-dev brotli libsodium-dev
#
# - name: Set up Go 1.x
# uses: actions/setup-go@v6
# with:
# go-version: ${{ env.GO_VERSION }}
# id: go
#
# - name: Get dependencies
# run: |
# go get -v -t -d ./...
# - id: govulncheck
# uses: golang/govulncheck-action@v1
#
13 changes: 13 additions & 0 deletions internal/config/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -567,6 +567,19 @@ var (
SQLServerConnectionString: true,
SQLServerDBConcurrency: true,
SQLServerReuseProxy: true,

// Failover storages
FailoverStorages: true,
FailoverStoragesCheck: true,
FailoverStoragesCheckTimeout: true,
FailoverStorageCacheLifetime: true,
FailoverStorageCacheEMAAliveLimit: true,
FailoverStorageCacheEMADeadLimit: true,
FailoverStorageCacheEMAAlphaAliveMax: true,
FailoverStorageCacheEMAAlphaAliveMin: true,
FailoverStorageCacheEMAAlphaDeadMax: true,
FailoverStorageCacheEMAAlphaDeadMin: true,
FailoverStoragesCheckSize: true,
}

MysqlAllowedSettings = map[string]bool{
Expand Down
18 changes: 18 additions & 0 deletions internal/config/config_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,24 @@ func TestConfigureLogging_WhenLogDestinationSettingIsSet(t *testing.T) {
resetToDefaults()
}

func TestSQLServerFailoverStorageSettings(t *testing.T) {
viper.Reset()
internal.ConfigureSettings(config.SQLSERVER)
config.InitConfig()

// Verify that failover storage settings are in the AllowedSettings map
assert.True(t, config.AllowedSettings[config.FailoverStoragesCheckTimeout],
"WALG_FAILOVER_STORAGES_CHECK_TIMEOUT should be allowed for SQL Server")
assert.True(t, config.AllowedSettings[config.FailoverStorageCacheLifetime],
"WALG_FAILOVER_STORAGES_CACHE_LIFETIME should be allowed for SQL Server")
assert.True(t, config.AllowedSettings[config.FailoverStorages],
"WALG_FAILOVER_STORAGES should be allowed for SQL Server")
assert.True(t, config.AllowedSettings[config.FailoverStoragesCheck],
"WALG_FAILOVER_STORAGES_CHECK should be allowed for SQL Server")

resetToDefaults()
}

func resetToDefaults() {
viper.Reset()
internal.ConfigureSettings(config.PG)
Expand Down