Compare commits
No commits in common. "master" and "v0.1.5" have entirely different histories.
1
.gitignore
vendored
1
.gitignore
vendored
@ -1,3 +1,2 @@
|
|||||||
gitinfo.go
|
gitinfo.go
|
||||||
dist
|
dist
|
||||||
privkey.pem
|
|
||||||
|
@ -36,8 +36,7 @@ signs:
|
|||||||
# args: ["-u", "<key id, fingerprint, email, ...>", "--output", "${signature}", "--detach-sign", "${artifact}"]
|
# args: ["-u", "<key id, fingerprint, email, ...>", "--output", "${signature}", "--detach-sign", "${artifact}"]
|
||||||
#
|
#
|
||||||
# defaults to `["--output", "${signature}", "--detach-sign", "${artifact}"]`
|
# defaults to `["--output", "${signature}", "--detach-sign", "${artifact}"]`
|
||||||
args: ["dgst", "-sha256", "-sign", "privkey.pem", "-out", "${artifact}.sig", "${artifact}"]
|
args: ["dgst", "-sha256", "-sign", "privkey.pem", "${artifact}.sig", "${artifact}"]
|
||||||
|
|
||||||
artifacts: all
|
artifacts: all
|
||||||
gitea_urls:
|
gitea_urls:
|
||||||
api: https://git.lbsfilm.at/api/v1/
|
api: https://git.lbsfilm.at/api/v1/
|
||||||
|
@ -1,3 +0,0 @@
|
|||||||
#!/bin/sh
|
|
||||||
openssl ecparam -name prime256v1 -genkey -noout -out privkey.pem
|
|
||||||
openssl ec -in privkey.pem -pubout -out pubkey.pem
|
|
5
go.mod
5
go.mod
@ -4,7 +4,4 @@ go 1.15
|
|||||||
|
|
||||||
replace github.com/creativeprojects/go-selfupdate => /Users/LB/Desktop/z_Projects/go-selfupdate
|
replace github.com/creativeprojects/go-selfupdate => /Users/LB/Desktop/z_Projects/go-selfupdate
|
||||||
|
|
||||||
require (
|
require github.com/creativeprojects/go-selfupdate v0.0.0-00010101000000-000000000000
|
||||||
github.com/creativeprojects/go-selfupdate v0.0.0-00010101000000-000000000000
|
|
||||||
github.com/kenshaw/pemutil v0.1.0
|
|
||||||
)
|
|
||||||
|
2
go.sum
2
go.sum
@ -107,8 +107,6 @@ github.com/hashicorp/golang-lru v0.5.1/go.mod h1:/m3WP610KZHVQ1SGc6re/UDhFvYD7pJ
|
|||||||
github.com/ianlancetaylor/demangle v0.0.0-20181102032728-5e5cf60278f6/go.mod h1:aSSvb/t6k1mPoxDqO4vJh6VOCGPwU4O0C2/Eqndh1Sc=
|
github.com/ianlancetaylor/demangle v0.0.0-20181102032728-5e5cf60278f6/go.mod h1:aSSvb/t6k1mPoxDqO4vJh6VOCGPwU4O0C2/Eqndh1Sc=
|
||||||
github.com/jstemmer/go-junit-report v0.0.0-20190106144839-af01ea7f8024/go.mod h1:6v2b51hI/fHJwM22ozAgKL4VKDeJcHhJFhtBdhmNjmU=
|
github.com/jstemmer/go-junit-report v0.0.0-20190106144839-af01ea7f8024/go.mod h1:6v2b51hI/fHJwM22ozAgKL4VKDeJcHhJFhtBdhmNjmU=
|
||||||
github.com/jstemmer/go-junit-report v0.9.1/go.mod h1:Brl9GWCQeLvo8nXZwPNNblvFj/XSXhF0NWZEnDohbsk=
|
github.com/jstemmer/go-junit-report v0.9.1/go.mod h1:Brl9GWCQeLvo8nXZwPNNblvFj/XSXhF0NWZEnDohbsk=
|
||||||
github.com/kenshaw/pemutil v0.1.0 h1:rA3FC1PkBPlt/ez3iHgMzdEEFq4Bhnpkh/g2C68oRac=
|
|
||||||
github.com/kenshaw/pemutil v0.1.0/go.mod h1:KDF39i6NCZ2UJYtdyVVQi8l+G5S3zgE26GzAjFiLmHQ=
|
|
||||||
github.com/kisielk/gotool v1.0.0/go.mod h1:XhKaO+MFFWcvkIS/tQcRk01m1F5IRFswLeQ+oQHNcck=
|
github.com/kisielk/gotool v1.0.0/go.mod h1:XhKaO+MFFWcvkIS/tQcRk01m1F5IRFswLeQ+oQHNcck=
|
||||||
github.com/kr/pretty v0.1.0/go.mod h1:dAy3ld7l9f0ibDNOQOHHMYYIIbhfbHSm3C4ZsoJORNo=
|
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/pty v1.1.1/go.mod h1:pFQYn66WHrOpPYNljwOMqo10TkYh1fy3cYio2l3bCsQ=
|
||||||
|
20
main.go
20
main.go
@ -8,7 +8,6 @@ import (
|
|||||||
"runtime"
|
"runtime"
|
||||||
|
|
||||||
selfupdate "github.com/creativeprojects/go-selfupdate"
|
selfupdate "github.com/creativeprojects/go-selfupdate"
|
||||||
"github.com/kenshaw/pemutil"
|
|
||||||
)
|
)
|
||||||
|
|
||||||
//go:generate sh injectGitVars.sh
|
//go:generate sh injectGitVars.sh
|
||||||
@ -27,7 +26,7 @@ func main() {
|
|||||||
} else {
|
} else {
|
||||||
fmt.Println("Success")
|
fmt.Println("Success")
|
||||||
}
|
}
|
||||||
} else if os.Args[1] == "version" || os.Args[1] == "v" {
|
} else if os.Args[1] == "version" {
|
||||||
fmt.Print("Version ")
|
fmt.Print("Version ")
|
||||||
fmt.Println(gitTag)
|
fmt.Println(gitTag)
|
||||||
} else {
|
} else {
|
||||||
@ -37,24 +36,9 @@ func main() {
|
|||||||
|
|
||||||
func update(version string) error {
|
func update(version string) error {
|
||||||
source, _ := selfupdate.NewGiteaSource(selfupdate.GiteaConfig{BaseURL: "https://git.lbsfilm.at/"})
|
source, _ := selfupdate.NewGiteaSource(selfupdate.GiteaConfig{BaseURL: "https://git.lbsfilm.at/"})
|
||||||
|
|
||||||
store := make(pemutil.Store)
|
|
||||||
err := pemutil.Decode(store, []byte(`-----BEGIN PUBLIC KEY-----
|
|
||||||
MFkwEwYHKoZIzj0CAQYIKoZIzj0DAQcDQgAE0+99Oxlx+P6F9Cd5pUIw6oGY2oFL
|
|
||||||
qCf//kV/S27OpD6skuEveQG+M1k6eT/o8oVDJ0sj3aIyaF+vruZaBB9HeA==
|
|
||||||
-----END PUBLIC KEY-----`))
|
|
||||||
if err != nil {
|
|
||||||
return err
|
|
||||||
}
|
|
||||||
pubkey, ok := store.ECPublicKey()
|
|
||||||
if !ok {
|
|
||||||
return fmt.Errorf("no pubkey")
|
|
||||||
}
|
|
||||||
updater, err := selfupdate.NewUpdater(selfupdate.Config{
|
updater, err := selfupdate.NewUpdater(selfupdate.Config{
|
||||||
Source: source,
|
Source: source,
|
||||||
Validator: &selfupdate.ECDSAValidator{
|
Validator: nil,
|
||||||
PublicKey: pubkey,
|
|
||||||
},
|
|
||||||
OS: runtime.GOOS,
|
OS: runtime.GOOS,
|
||||||
Arch: runtime.GOARCH,
|
Arch: runtime.GOARCH,
|
||||||
Arm: 0,
|
Arm: 0,
|
||||||
|
@ -1,4 +0,0 @@
|
|||||||
-----BEGIN PUBLIC KEY-----
|
|
||||||
MFkwEwYHKoZIzj0CAQYIKoZIzj0DAQcDQgAE0+99Oxlx+P6F9Cd5pUIw6oGY2oFL
|
|
||||||
qCf//kV/S27OpD6skuEveQG+M1k6eT/o8oVDJ0sj3aIyaF+vruZaBB9HeA==
|
|
||||||
-----END PUBLIC KEY-----
|
|
Loading…
x
Reference in New Issue
Block a user