Compare commits
3 Commits
Author | SHA1 | Date |
---|---|---|
|
ffdec7b354 | |
|
dfd3e4fd63 | |
|
d4a0f483df |
|
@ -43,6 +43,7 @@ func logMiddleware(h http.HandlerFunc) http.HandlerFunc {
|
|||
func main() {
|
||||
listenAddr := flag.String("listen", ":1612", "HTTP listen address")
|
||||
debPath := flag.String("debpath", "debs", "Path to directory containing deb files.")
|
||||
privKey := flag.String("privkey", "privkey.gpg", "Path to private key file. Will be created if it doesn't exist")
|
||||
httpUser := flag.String("httpuser", "debanator", "Username for HTTP basic auth")
|
||||
httpPass := flag.String("httppass", "", "Enable HTTP basic auth with this password")
|
||||
showVersion := flag.Bool("version", false, "Show version")
|
||||
|
@ -58,11 +59,11 @@ func main() {
|
|||
"commit": debanator.Commit,
|
||||
}).Info("Starting debanator...")
|
||||
var ecKey *crypto.Key
|
||||
kb, err := os.ReadFile("privkey.gpg")
|
||||
kb, err := os.ReadFile(*privKey)
|
||||
if err != nil {
|
||||
log.Infof("Generating new key...")
|
||||
ecKey = debanator.Unwrap(crypto.GenerateKey("Debanator", "packager@example.com", "x25519", 0))
|
||||
f := debanator.Unwrap(os.Create("privkey.gpg"))
|
||||
f := debanator.Unwrap(os.Create(*privKey))
|
||||
defer f.Close()
|
||||
armored := debanator.Unwrap(ecKey.Armor())
|
||||
f.WriteString(armored)
|
||||
|
|
4
go.mod
4
go.mod
|
@ -7,7 +7,7 @@ require (
|
|||
github.com/go-chi/chi/v5 v5.0.8
|
||||
github.com/sirupsen/logrus v1.9.0
|
||||
golang.org/x/exp v0.0.0-20230420155640-133eef4313cb
|
||||
pault.ag/go/debian v0.12.0
|
||||
pault.ag/go/debian v0.12.1-0.20221005163303-f50faa5a0bdf
|
||||
tailscale.com v1.40.0
|
||||
)
|
||||
|
||||
|
@ -46,7 +46,7 @@ require (
|
|||
github.com/josharian/native v1.1.1-0.20230202152459-5c7d0dd6ab86 // indirect
|
||||
github.com/jsimonetti/rtnetlink v1.1.2-0.20220408201609-d380b505068b // indirect
|
||||
github.com/kjk/lzma v0.0.0-20161016003348-3fd93898850d // indirect
|
||||
github.com/klauspost/compress v1.15.4 // indirect
|
||||
github.com/klauspost/compress v1.15.7 // indirect
|
||||
github.com/kortschak/wol v0.0.0-20200729010619-da482cc4850a // indirect
|
||||
github.com/mdlayher/genetlink v1.2.0 // indirect
|
||||
github.com/mdlayher/netlink v1.7.1 // indirect
|
||||
|
|
4
go.sum
4
go.sum
|
@ -139,6 +139,8 @@ github.com/kjk/lzma v0.0.0-20161016003348-3fd93898850d/go.mod h1:phT/jsRPBAEqjAi
|
|||
github.com/klauspost/compress v1.10.3/go.mod h1:aoV0uJVorq1K+umq18yTdKaF57EivdYsUV+/s2qKfXs=
|
||||
github.com/klauspost/compress v1.15.4 h1:1kn4/7MepF/CHmYub99/nNX8az0IJjfSOU/jbnTVfqQ=
|
||||
github.com/klauspost/compress v1.15.4/go.mod h1:PhcZ0MbTNciWF3rruxRgKxI5NkcHHrHUDtV4Yw2GlzU=
|
||||
github.com/klauspost/compress v1.15.7 h1:7cgTQxJCU/vy+oP/E3B9RGbQTgbiVzIJWIKOLoAsPok=
|
||||
github.com/klauspost/compress v1.15.7/go.mod h1:PhcZ0MbTNciWF3rruxRgKxI5NkcHHrHUDtV4Yw2GlzU=
|
||||
github.com/kortschak/wol v0.0.0-20200729010619-da482cc4850a h1:+RR6SqnTkDLWyICxS1xpjCi/3dhyV+TgZwA6Ww3KncQ=
|
||||
github.com/kortschak/wol v0.0.0-20200729010619-da482cc4850a/go.mod h1:YTtCCM3ryyfiu4F7t8HQ1mxvp1UBdWM2r6Xa+nGWvDk=
|
||||
github.com/kr/fs v0.1.0 h1:Jskdu9ieNAYnjxsi0LbQp1ulIKZV1LAFgK1tWhpZgl8=
|
||||
|
@ -352,6 +354,8 @@ nhooyr.io/websocket v1.8.7 h1:usjR2uOr/zjjkVMy0lW+PPohFok7PCow5sDjLgX4P4g=
|
|||
nhooyr.io/websocket v1.8.7/go.mod h1:B70DZP8IakI65RVQ51MsWP/8jndNma26DVA/nFSCgW0=
|
||||
pault.ag/go/debian v0.12.0 h1:b8ctSdBSGJ98NE1VLn06aSx70EUpczlP2qqSHEiYYJA=
|
||||
pault.ag/go/debian v0.12.0/go.mod h1:UbnMr3z/KZepjq7VzbYgBEfz8j4+Pyrm2L5X1fzhy/k=
|
||||
pault.ag/go/debian v0.12.1-0.20221005163303-f50faa5a0bdf h1:kvMXcvFkwyv9AjTb0algRDstix24+l2cQhalnaijeA4=
|
||||
pault.ag/go/debian v0.12.1-0.20221005163303-f50faa5a0bdf/go.mod h1:mLGXvkSUptUk8qv2gNrQ1vyqxTcWKn9UzbheKNEcKho=
|
||||
pault.ag/go/topsort v0.0.0-20160530003732-f98d2ad46e1a h1:WwS7vlB5H2AtwKj1jsGwp2ZLud1x6WXRXh2fXsRqrcA=
|
||||
pault.ag/go/topsort v0.0.0-20160530003732-f98d2ad46e1a/go.mod h1:INqx0ClF7kmPAMk2zVTX8DRnhZ/yaA/Mg52g8KFKE7k=
|
||||
software.sslmate.com/src/go-pkcs12 v0.2.0 h1:nlFkj7bTysH6VkC4fGphtjXRbezREPgrHuJG20hBGPE=
|
||||
|
|
|
@ -6,7 +6,6 @@ import (
|
|||
"crypto/sha256"
|
||||
"fmt"
|
||||
"io"
|
||||
"strconv"
|
||||
"strings"
|
||||
|
||||
"pault.ag/go/debian/control"
|
||||
|
@ -42,8 +41,8 @@ func BinaryIndexFromDeb(r ReaderAtCloser, filePath string) (*control.BinaryIndex
|
|||
Package: debFile.Control.Package,
|
||||
Source: debFile.Control.Source,
|
||||
Version: debFile.Control.Version,
|
||||
InstalledSize: fmt.Sprintf("%d", debFile.Control.InstalledSize),
|
||||
Size: strconv.Itoa(int(size)),
|
||||
InstalledSize: debFile.Control.InstalledSize,
|
||||
Size: int(size),
|
||||
Maintainer: debFile.Control.Maintainer,
|
||||
Architecture: debFile.Control.Architecture,
|
||||
MultiArch: debFile.Control.MultiArch,
|
||||
|
|
|
@ -13,6 +13,9 @@ Proof of concept. Neither fast, efficient, secure, neat, or featureful. Don't us
|
|||
production unless you are really sure you know what you're doing and even then prepare
|
||||
to have your laundry eaten.
|
||||
|
||||
## Contributing
|
||||
Contributions welcome! You may find the Github mirror at https://github.com/wlcx/debanator easier if you're not already there.
|
||||
|
||||
|
||||
## Usage
|
||||
|
||||
|
|
Loading…
Reference in New Issue