+horcrux -- Split your file into encrypted fragments (#3328)

* +horcrux -- Split your file into encrypted fragments so that you don't need to remember a passcode

* test

this should work, but doesn't on my machine. directory error.

* fix logic bug in v0.3

---------

Co-authored-by: Jacob Heider <jacob@tea.xyz>
This commit is contained in:
Kevin Chen 2023-09-16 14:32:41 -04:00 committed by GitHub
parent f2341a3477
commit c7c4379e4d
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -0,0 +1,45 @@
distributable:
url: https://github.com/jesseduffield/horcrux/archive/refs/tags/v{{version.raw}}.tar.gz
strip-components: 1
versions:
github: jesseduffield/horcrux/tags
strip: /^v/
provides:
- bin/horcrux
build:
dependencies:
go.dev: ^1.14
script:
- go mod download
# Bug in split.go that prevents it from splitting
- run: |
sed -i.bak 's/Split(path, path, total, threshold)/Split(path, filepath.Dir(path), total, threshold)/' split.go
rm split.go.bak
working-directory: pkg/commands
- go build -v -trimpath -ldflags="$LDFLAGS" -o $BUILDLOC .
env:
GOPROXY: https://proxy.golang.org,direct
GOSUMDB: sum.golang.org
GO111MODULE: on
CGO_ENABLED: 0
BUILDLOC: '{{prefix}}/bin/horcrux'
LDFLAGS:
- -s
- -w
linux:
# or segmentation fault
# fix found here https://github.com/docker-library/golang/issues/402#issuecomment-982204575
LDFLAGS:
- -buildmode=pie
test:
fixture: packages by tea
script:
- cp $FIXTURE tea.txt
- horcrux -t 3 -n 5 split tea.txt
- rm tea.txt tea_1_of_5.horcrux tea_4_of_5.horcrux
- horcrux bind
- cmp tea.txt $FIXTURE