add do-release script and injection of version

This commit is contained in:
Callan Bryant 2020-05-07 17:16:35 +01:00
parent 6220d4d71e
commit 5e2573a992
No known key found for this signature in database
GPG Key ID: C31FA9DF3ACBFFAA
2 changed files with 16 additions and 4 deletions

View File

@ -50,13 +50,18 @@ Usage: dsnet <cmd>
Available commands:
init : Create %s containing default configuration + new keys without loading. Edit to taste.
init : Create %[1]s containing default configuration + new keys without loading. Edit to taste.
add : Add a new peer + sync
up : Create the interface, run pre/post up, sync
report : Generate a JSON status report to the location configured in %s.
report : Generate a JSON status report to the location configured in %[1]s.
remove : Remove a peer by hostname provided as argument + sync
down : Destroy the interface, run pre/post down
sync : Update wireguard configuration from %s after validating
sync : Update wireguard configuration from %[1]s after validating
`, dsnet.CONFIG_FILE, dsnet.CONFIG_FILE, dsnet.CONFIG_FILE)
dsnet version %[2]s
commit %[3]s
built %[4]s
`, dsnet.CONFIG_FILE, dsnet.VERSION, dsnet.GIT_COMMIT, dsnet.BUILD_DATE)
}

View File

@ -24,3 +24,10 @@ const (
// when is a peer considered gone forever? (could remove)
EXPIRY = 28 * time.Hour * 24
)
var (
// populated with LDFLAGS, see do-release.sh
VERSION = "unknown"
GIT_COMMIT = "unknown"
BUILD_DATE = "unknown"
)