Skip to content

Commit

Permalink
Fix libsodium missing from GitHub Releases (#1062)
Browse files Browse the repository at this point in the history
* Fix release GitHub action to enable libsodium

* Exit with failure if keys are detected but not compiled with libsodium support

Adds a check for the existence of libsodium keys in non-libsodium builds. If keys are detected then
exit with failure as the user likely wanted to encrypt all file activity but it is not possible as
the application was not compiled with support for libsodium.

Previously, wal-g would continue to operate as if no encryption was requested.

* Add option to manually trigger GitHub Action CI
  • Loading branch information
sehrope committed Aug 12, 2021
1 parent e6c2090 commit cadf598
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 0 deletions.
1 change: 1 addition & 0 deletions .github/workflows/release.yml
Expand Up @@ -7,6 +7,7 @@ on:

env:
GO_VERSION: 1.15
USE_LIBSODIUM: 1

jobs:
release-ubuntu:
Expand Down
1 change: 1 addition & 0 deletions .github/workflows/unittests.yml
@@ -1,6 +1,7 @@
name: Unit tests

on:
workflow_dispatch:
push:
branches: [ master ]
pull_request:
Expand Down
10 changes: 10 additions & 0 deletions internal/configure_crypter.go
Expand Up @@ -14,9 +14,19 @@ package internal
// If there is a tag, we can configure the correct implementation of crypter.

import (
"github.com/spf13/viper"
"github.com/wal-g/tracelog"
"github.com/wal-g/wal-g/internal/crypto"
)

func configureLibsodiumCrypter() crypto.Crypter {
if viper.IsSet(LibsodiumKeySetting) {
tracelog.ErrorLogger.Fatalf("non-empty WALG_LIBSODIUM_KEY but wal-g was not compiled with libsodium")
}

if viper.IsSet(LibsodiumKeyPathSetting) {
tracelog.ErrorLogger.Fatalf("non-empty WALG_LIBSODIUM_KEY_PATH but wal-g was not compiled with libsodium")
}

return nil
}

0 comments on commit cadf598

Please sign in to comment.