1
0
mirror of https://github.com/taigrr/crocgui synced 2025-01-18 04:03:16 -08:00

croc hash algorithm setting

This commit is contained in:
Chris Howey 2021-04-29 19:35:01 -05:00
parent be3756cf2c
commit 42cab1ae20
7 changed files with 20 additions and 1 deletions

2
go.mod
View File

@ -4,7 +4,7 @@ go 1.16
require (
fyne.io/fyne/v2 v2.0.2
github.com/schollz/croc/v9 v9.0.0
github.com/schollz/croc/v9 v9.1.1
github.com/schollz/logger v1.2.0
)

6
go.sum
View File

@ -38,6 +38,8 @@ github.com/josephspurrier/goversioninfo v0.0.0-20200309025242-14b0ab84c6ca/go.mo
github.com/k0kubun/go-ansi v0.0.0-20180517002512-3bf9e2903213/go.mod h1:vNUNkEQ1e29fT/6vq2aBdFsgNPmy8qMdSay1npru+Sw=
github.com/kalafut/imohash v1.0.0 h1:LgCJ+p/BwM2HKpOxFopkeddpzVCfm15EtXMroXD1SYE=
github.com/kalafut/imohash v1.0.0/go.mod h1:c3RHT80ZAp5C/aYgQI92ZlrOymqkZnRDprU87kg75HI=
github.com/kalafut/imohash v1.0.2 h1:j/cUPa15YvXv7abJlM+kdJIycbBMpmO7WqhPl4YB76I=
github.com/kalafut/imohash v1.0.2/go.mod h1:PjHBF0vpo1q7zMqiTn0qwSTQU2wDn5QIe8S8sFQuZS8=
github.com/kr/pretty v0.1.0/go.mod h1:dAy3ld7l9f0ibDNOQOHHMYYIIbhfbHSm3C4ZsoJORNo=
github.com/kr/pty v1.1.1/go.mod h1:pFQYn66WHrOpPYNljwOMqo10TkYh1fy3cYio2l3bCsQ=
github.com/kr/text v0.1.0 h1:45sCR5RtlFHMR4UwH9sdQ5TC8v0qDQCHnXt+kaKSTVE=
@ -65,6 +67,8 @@ github.com/russross/blackfriday/v2 v2.1.0/go.mod h1:+Rmxgy9KzJVeS9/2gXHxylqXiyQD
github.com/schollz/cli/v2 v2.2.1/go.mod h1:My6bfphRLZUhZdlFUK8scAxMWHydE7k4s2ed2Dtnn+s=
github.com/schollz/croc/v9 v9.0.0 h1:q+/+F+IJXXrGqDBIasn0sr57PCZIeuhyrB+Q1Fb0QwY=
github.com/schollz/croc/v9 v9.0.0/go.mod h1:Vgg3AocoZzIi0hjVMOv4w7WGJWvzQXJ/j6I0L9JEGeA=
github.com/schollz/croc/v9 v9.1.1 h1:yCZrdzdzkHHC+7kRUrqPuHu9iCDQfKOfbogIFK7gNlM=
github.com/schollz/croc/v9 v9.1.1/go.mod h1:hP8kIHrhdvZMZ82af1F1zz2fSal82DcRtlrMFMU9zWU=
github.com/schollz/logger v1.2.0 h1:5WXfINRs3lEUTCZ7YXhj0uN+qukjizvITLm3Ca2m0Ho=
github.com/schollz/logger v1.2.0/go.mod h1:P6F4/dGMGcx8wh+kG1zrNEd4vnNpEBY/mwEMd/vn6AM=
github.com/schollz/mnemonicode v1.0.1 h1:LiH5hwADZwjwnfXsaD4xgnMyTAtaKHN+e5AyjRU6WSU=
@ -93,6 +97,8 @@ github.com/stretchr/testify v1.6.1 h1:hDPOHmpOpP40lSULcqw7IrRb/u7w6RpDC9399XyoNd
github.com/stretchr/testify v1.6.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg=
github.com/tscholl2/siec v0.0.0-20191122224205-8da93652b094 h1:tZWtuLE+LbUwT4OP1oWBSB9zXA8qmQ5qEm4kV9R72oo=
github.com/tscholl2/siec v0.0.0-20191122224205-8da93652b094/go.mod h1:KL9+ubr1JZdaKjgAaHr+tCytEncXBa1pR6FjbTsOJnw=
github.com/twmb/murmur3 v1.1.5 h1:i9OLS9fkuLzBXjt6dptlAEyk58fJsSTXbRg3SgVyqgk=
github.com/twmb/murmur3 v1.1.5/go.mod h1:Qq/R7NUyOfr65zD+6Q5IHKsJLwP7exErjN6lyyq3OSQ=
github.com/urfave/cli/v2 v2.3.0/go.mod h1:LJmUH05zAU44vOAcrfzZQKsZbVcdbOG8rtL3/XcUArI=
github.com/yuin/goldmark v1.1.25/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74=
golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w=

View File

@ -63,6 +63,7 @@ func main() {
a.Preferences().SetString("theme", a.Preferences().StringWithFallback("theme", "light"))
a.Preferences().SetString("debug-level", a.Preferences().StringWithFallback("debug-level", "error"))
a.Preferences().SetString("pake-curve", a.Preferences().StringWithFallback("pake-curve", "siec"))
a.Preferences().SetString("croc-hash", a.Preferences().StringWithFallback("croc-hash", "xxhash"))
setTheme(a.Preferences().String("theme"))
log.SetLevel(a.Preferences().String("debug-level"))

View File

@ -0,0 +1,2 @@
- new icon
- croc hash algorithm selection

View File

@ -69,6 +69,7 @@ func recvTabItem(a fyne.App, w fyne.Window) *container.TabItem {
OnlyLocal: a.Preferences().Bool("force-local"),
NoCompress: a.Preferences().Bool("disable-compression"),
Curve: a.Preferences().String("pake-curve"),
HashAlgorithm: a.Preferences().String("croc-hash"),
})
if err != nil {
log.Error("Receive setup error:", err)

View File

@ -149,6 +149,7 @@ func sendTabItem(a fyne.App, w fyne.Window) *container.TabItem {
OnlyLocal: a.Preferences().Bool("force-local"),
NoCompress: a.Preferences().Bool("disable-compression"),
Curve: a.Preferences().String("pake-curve"),
HashAlgorithm: a.Preferences().String("croc-hash"),
})
if err != nil {
log.Errorf("croc error: %s\n", err.Error())

View File

@ -69,6 +69,13 @@ func settingsTabItem(a fyne.App) *container.TabItem {
currentCurve, _ := curveBinding.Get()
curveSelect.SetSelected(currentCurve)
hashBinding := binding.BindPreferenceString("croc-hash", a.Preferences())
hashSelect := widget.NewSelect([]string{"imohash", "md5", "xxhash"}, func(selection string) {
hashBinding.Set(selection)
})
currentHash, _ := hashBinding.Get()
hashSelect.SetSelected(currentHash)
debugLevelBinding := binding.BindPreferenceString("debug-level", a.Preferences())
debugCheck := widget.NewCheck("Enable Debug Log", func(debug bool) {
if debug {
@ -104,6 +111,7 @@ func settingsTabItem(a fyne.App) *container.TabItem {
widget.NewLabelWithStyle("Transfer Options", fyne.TextAlignLeading, fyne.TextStyle{Bold: true}),
widget.NewForm(
widget.NewFormItem("PAKE Curve", curveSelect),
widget.NewFormItem("Hash Algorithm", hashSelect),
widget.NewFormItem("", widget.NewCheckWithData("Disable Multiplexing", binding.BindPreferenceBool("disable-multiplexing", a.Preferences()))),
widget.NewFormItem("", widget.NewCheckWithData("Disable Compression", binding.BindPreferenceBool("disable-compression", a.Preferences()))),
),