Skip to content

Commit

Permalink
updating version info with release url and matching built at with com…
Browse files Browse the repository at this point in the history
…mit timestamp
  • Loading branch information
shibme committed Mar 11, 2024
1 parent 0226f5e commit 3a1334b
Show file tree
Hide file tree
Showing 6 changed files with 33 additions and 30 deletions.
3 changes: 2 additions & 1 deletion .goreleaser.yaml
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
project_name: slv
builds:
- id: slv
binary: slv
main: ./cli
env:
- CGO_ENABLED=0
ldflags: "-X savesecrets.org/slv.Version={{.Version}} -X savesecrets.org/slv.BuildDate={{.Date}} -X savesecrets.org/slv.Commit={{.Commit}}"
ldflags: "-X savesecrets.org/slv.Version={{.Version}} -X savesecrets.org/slv.commitDate={{.CommitDate}} -X savesecrets.org/slv.fullCommit={{.FullCommit}} -X savesecrets.org/slv.releaseURL={{.ReleaseURL}}"
targets:
- darwin_amd64
- darwin_arm64
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# SLV - Secure Local Vault
Secure Local Vault - SLV (a.k.a Secrets Launch Vehicle 🔐🚀) is a tool to manage secrets locally in a secure manner. It is designed to be used by developers to manage secrets along with their code so that they can be shared with other developers and services in a secure manner.
Securely store, share and consume secrets alongside code.

SLV is designed based on the following **key principles**
- Anyone can add or update secrets, however will not be able to read them unless they have access to the vault
Expand Down
32 changes: 17 additions & 15 deletions const.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,35 +14,37 @@ import (
func VersionInfo() string {
if appInfo == nil {
appInfo = new(string)
buildAt := "unknown"
if builtAtTime, err := time.Parse(time.RFC3339, BuildDate); err == nil {
var committedAt string
if builtAtTime, err := time.Parse(time.RFC3339, commitDate); err == nil {
builtAtLocalTime := builtAtTime.Local()
buildAt = builtAtLocalTime.Format("02 Jan 2006 03:04:05 PM MST")
committedAt = builtAtLocalTime.Format("02 Jan 2006 03:04:05 PM MST")
}
appInfoBuilder := strings.Builder{}
appInfoBuilder.WriteString(config.Art)
appInfoBuilder.WriteString("\n")
appInfoBuilder.WriteString(config.AppNameUpperCase + ": " + config.Description)
appInfoBuilder.WriteString(config.Description)
appInfoBuilder.WriteString("\n")
appInfoBuilder.WriteString("-------------------------------------------------")
appInfoBuilder.WriteString("\n")
appInfoBuilder.WriteString(fmt.Sprintf("SLV Version : %s\n", Version))
appInfoBuilder.WriteString(fmt.Sprintf("Built At : %s\n", buildAt))
appInfoBuilder.WriteString(fmt.Sprintf("Git Commit : %s\n", Commit))
appInfoBuilder.WriteString(fmt.Sprintf("Web : %s\n", config.Website))
appInfoBuilder.WriteString(fmt.Sprintf("Platform : %s\n", runtime.GOOS+"/"+runtime.GOARCH))
appInfoBuilder.WriteString(fmt.Sprintf("Go Version : %s", runtime.Version()))
appInfoBuilder.WriteString(fmt.Sprintf("SLV Version : %s\n", Version))
appInfoBuilder.WriteString(fmt.Sprintf("Built At : %s\n", committedAt))
appInfoBuilder.WriteString(fmt.Sprintf("Release : %s\n", releaseURL))
appInfoBuilder.WriteString(fmt.Sprintf("Git Commit : %s\n", fullCommit))
appInfoBuilder.WriteString(fmt.Sprintf("Web : %s\n", config.Website))
appInfoBuilder.WriteString(fmt.Sprintf("Platform : %s\n", runtime.GOOS+"/"+runtime.GOARCH))
appInfoBuilder.WriteString(fmt.Sprintf("Go Version : %s", runtime.Version()))
*appInfo = appInfoBuilder.String()
}
return *appInfo
}

var (
Version = "dev"
Commit = "none"
BuildDate = ""
secretKey *crypto.SecretKey
appInfo *string
Version = ""
fullCommit = ""
commitDate = ""
releaseURL = ""
secretKey *crypto.SecretKey
appInfo *string
)

// Errors
Expand Down
2 changes: 1 addition & 1 deletion core/config/const.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ const (

AppNameLowerCase = "slv"
AppNameUpperCase = "SLV"
Description = "Secure Local Vault | Secrets Launch Vehicle"
Description = AppNameUpperCase + " (Secure Local Vault) : " + "Securely store, share and consume secrets alongside code."
Website = "https://savesecrets.org/slv"
Art = `
____ _ __ __
Expand Down
8 changes: 4 additions & 4 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -37,9 +37,9 @@ require (
go.opentelemetry.io/otel/trace v1.24.0 // indirect
golang.org/x/sync v0.6.0 // indirect
google.golang.org/api v0.169.0 // indirect
google.golang.org/genproto v0.0.0-20240308144416-29370a3891b7 // indirect
google.golang.org/genproto/googleapis/api v0.0.0-20240308144416-29370a3891b7 // indirect
google.golang.org/genproto/googleapis/rpc v0.0.0-20240308144416-29370a3891b7 // indirect
google.golang.org/genproto v0.0.0-20240311132316-a219d84964c2 // indirect
google.golang.org/genproto/googleapis/api v0.0.0-20240311132316-a219d84964c2 // indirect
google.golang.org/genproto/googleapis/rpc v0.0.0-20240311132316-a219d84964c2 // indirect
google.golang.org/grpc v1.62.1 // indirect
)

Expand Down Expand Up @@ -115,7 +115,7 @@ require (
k8s.io/component-base v0.29.2 // indirect
k8s.io/klog/v2 v2.120.1 // indirect
k8s.io/kube-openapi v0.0.0-20240228011516-70dd3763d340 // indirect
k8s.io/utils v0.0.0-20240102154912-e7106e64919e // indirect
k8s.io/utils v0.0.0-20240310230437-4693a0247e57 // indirect
sigs.k8s.io/json v0.0.0-20221116044647-bc3834ca7abd // indirect
sigs.k8s.io/structured-merge-diff/v4 v4.4.1 // indirect
sigs.k8s.io/yaml v1.4.0 // indirect
Expand Down
16 changes: 8 additions & 8 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -355,12 +355,12 @@ google.golang.org/appengine v1.6.8/go.mod h1:1jJ3jBArFh5pcgW8gCtRJnepW8FzD1V44FJ
google.golang.org/genproto v0.0.0-20180817151627-c66870c02cf8/go.mod h1:JiN7NxoALGmiZfu7CAH4rXhgtRTLTxftemlI0sWmxmc=
google.golang.org/genproto v0.0.0-20190819201941-24fa4b261c55/go.mod h1:DMBHOl98Agz4BDEuKkezgsaosCRResVns1a3J2ZsMNc=
google.golang.org/genproto v0.0.0-20200526211855-cb27e3aa2013/go.mod h1:NbSheEEYHJ7i3ixzK3sjbqSGDJWnxyFXZblF3eUsNvo=
google.golang.org/genproto v0.0.0-20240308144416-29370a3891b7 h1:5cmXPmmYZddhZs05mvqVzGwPsoE/uq+1YBCeRmBDyMo=
google.golang.org/genproto v0.0.0-20240308144416-29370a3891b7/go.mod h1:yA7a1bW1kwl459Ol0m0lV4hLTfrL/7Bkk4Mj2Ir1mWI=
google.golang.org/genproto/googleapis/api v0.0.0-20240308144416-29370a3891b7 h1:bITUotW/BD35GhBwrwGexWa8/P5CKHXACICrmuFJBa8=
google.golang.org/genproto/googleapis/api v0.0.0-20240308144416-29370a3891b7/go.mod h1:O1cOfN1Cy6QEYr7VxtjOyP5AdAuR0aJ/MYZaaof623Y=
google.golang.org/genproto/googleapis/rpc v0.0.0-20240308144416-29370a3891b7 h1:em/y72n4XlYRtayY/cVj6pnVzHa//BDA1BdoO+z9mdE=
google.golang.org/genproto/googleapis/rpc v0.0.0-20240308144416-29370a3891b7/go.mod h1:UCOku4NytXMJuLQE5VuqA5lX3PcHCBo8pxNyvkf4xBs=
google.golang.org/genproto v0.0.0-20240311132316-a219d84964c2 h1:rrOOzm+NteCjTNqCnDAdYhvKL1G/9N/Lj1GRxJtQEL0=
google.golang.org/genproto v0.0.0-20240311132316-a219d84964c2/go.mod h1:yA7a1bW1kwl459Ol0m0lV4hLTfrL/7Bkk4Mj2Ir1mWI=
google.golang.org/genproto/googleapis/api v0.0.0-20240311132316-a219d84964c2 h1:rIo7ocm2roD9DcFIX67Ym8icoGCKSARAiPljFhh5suQ=
google.golang.org/genproto/googleapis/api v0.0.0-20240311132316-a219d84964c2/go.mod h1:O1cOfN1Cy6QEYr7VxtjOyP5AdAuR0aJ/MYZaaof623Y=
google.golang.org/genproto/googleapis/rpc v0.0.0-20240311132316-a219d84964c2 h1:9IZDv+/GcI6u+a4jRFRLxQs0RUCfavGfoOgEW6jpkI0=
google.golang.org/genproto/googleapis/rpc v0.0.0-20240311132316-a219d84964c2/go.mod h1:UCOku4NytXMJuLQE5VuqA5lX3PcHCBo8pxNyvkf4xBs=
google.golang.org/grpc v1.19.0/go.mod h1:mqu4LbDTu4XGKhr4mRzUsmM4RtVoemTSY81AxZiDr8c=
google.golang.org/grpc v1.23.0/go.mod h1:Y5yQAOtifL1yxbo5wqy6BxZv8vAUGQwXBOALyacEbxg=
google.golang.org/grpc v1.25.1/go.mod h1:c3i+UQWmh7LiEpx4sFZnkU36qjEYZ0imhYfXVyQciAY=
Expand Down Expand Up @@ -412,8 +412,8 @@ k8s.io/klog/v2 v2.120.1 h1:QXU6cPEOIslTGvZaXvFWiP9VKyeet3sawzTOvdXb4Vw=
k8s.io/klog/v2 v2.120.1/go.mod h1:3Jpz1GvMt720eyJH1ckRHK1EDfpxISzJ7I9OYgaDtPE=
k8s.io/kube-openapi v0.0.0-20240228011516-70dd3763d340 h1:BZqlfIlq5YbRMFko6/PM7FjZpUb45WallggurYhKGag=
k8s.io/kube-openapi v0.0.0-20240228011516-70dd3763d340/go.mod h1:yD4MZYeKMBwQKVht279WycxKyM84kkAx2DPrTXaeb98=
k8s.io/utils v0.0.0-20240102154912-e7106e64919e h1:eQ/4ljkx21sObifjzXwlPKpdGLrCfRziVtos3ofG/sQ=
k8s.io/utils v0.0.0-20240102154912-e7106e64919e/go.mod h1:OLgZIPagt7ERELqWJFomSt595RzquPNLL48iOWgYOg0=
k8s.io/utils v0.0.0-20240310230437-4693a0247e57 h1:gbqbevonBh57eILzModw6mrkbwM0gQBEuevE/AaBsHY=
k8s.io/utils v0.0.0-20240310230437-4693a0247e57/go.mod h1:OLgZIPagt7ERELqWJFomSt595RzquPNLL48iOWgYOg0=
sigs.k8s.io/controller-runtime v0.17.2 h1:FwHwD1CTUemg0pW2otk7/U5/i5m2ymzvOXdbeGOUvw0=
sigs.k8s.io/controller-runtime v0.17.2/go.mod h1:+MngTvIQQQhfXtwfdGw/UOQ/aIaqsYywfCINOtwMO/s=
sigs.k8s.io/json v0.0.0-20221116044647-bc3834ca7abd h1:EDPBXCAspyGV4jQlpZSudPeMmr1bNJefnuqLsRAsHZo=
Expand Down

0 comments on commit 3a1334b

Please sign in to comment.