added fs encryption overlay

This commit is contained in:
ston1th 2022-04-06 01:08:19 +02:00
commit fd1e8118a4
28 changed files with 3994 additions and 30 deletions

View file

@ -3,6 +3,7 @@
package main
import (
"encoding/hex"
"flag"
"fmt"
"os"
@ -15,15 +16,26 @@ var (
version string
dst string
dstkey string
metadata string
)
func main() {
flag.StringVar(&dst, "dst", "", "url path to cache files (example: file:///mnt/cache)")
flag.StringVar(&dstkey, "dstkey", "", "hex encoded encryption key for dst")
flag.StringVar(&metadata, "data", "", "path to metadata file")
flag.Parse()
dstfs, err := parse.FS(dst)
var (
dstk []byte
err error
)
if dstkey != "" {
dstk, err = hex.DecodeString(dstkey)
fmt.Println(err)
os.Exit(1)
}
dstfs, err := parse.FS(dst, dstk)
if err != nil {
fmt.Println(err)
os.Exit(1)