浏览代码

Fix static build

Tulir Asokan 5 年之前
父节点
当前提交
168a6ff93f
共有 3 个文件被更改,包括 4 次插入2 次删除
  1. 1 1
      crypto.go
  2. 2 0
      database/cryptostore.go
  3. 1 1
      no-cgo.go

+ 1 - 1
crypto.go

@@ -49,7 +49,7 @@ type CryptoHelper struct {
 	baseLog maulogger.Logger
 }
 
-func NewCryptoHelper(bridge *Bridge) *CryptoHelper {
+func NewCryptoHelper(bridge *Bridge) Crypto {
 	if !bridge.Config.Bridge.Encryption.Allow {
 		bridge.Log.Debugln("Bridge built with end-to-bridge encryption, but disabled in config")
 		return nil

+ 2 - 0
database/cryptostore.go

@@ -14,6 +14,8 @@
 // You should have received a copy of the GNU Affero General Public License
 // along with this program.  If not, see <https://www.gnu.org/licenses/>.
 
+// +build cgo
+
 package database
 
 import (

+ 1 - 1
no-cgo.go

@@ -25,7 +25,7 @@ import (
 	"golang.org/x/image/webp"
 )
 
-func (bridge *Bridge) initCrypto() error {
+func NewCryptoHelper(bridge *Bridge) Crypto {
 	if !bridge.Config.Bridge.Encryption.Allow {
 		bridge.Log.Warnln("Bridge built without end-to-bridge encryption, but encryption is enabled in config")
 	}