Skip to content

Commit

Permalink
[CLOUD-131037] cleanup old flavour code, add more docs (Cloud-Foundat…
Browse files Browse the repository at this point in the history
…ions#16)

Co-authored-by: Dušan Klinec <[email protected]>
  • Loading branch information
Dusan Klinec and ph4r05 authored May 27, 2024
1 parent 34358d9 commit eee1a3e
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 5 deletions.
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ endif
BINARY=keymaster

# These are the values we want to pass for Version and BuildTime
VERSION?=1.15.11
VERSION?=1.15.12
DEFAULT_HOST?=
VERSION_FLAVOUR?=
EXTRA_LDFLAGS?=
Expand Down
18 changes: 17 additions & 1 deletion PureStorage.md
Original file line number Diff line number Diff line change
Expand Up @@ -49,15 +49,31 @@ Keymaster is built with the following environment variable so the Keymaster serv
This enables to run Keymaster without configuration file.

```
DEFAULT_HOST="keymaster.sec.cloud-support.purestorage.com" make install-client
VERSION_FLAVOUR=pure DEFAULT_HOST="keymaster.sec.cloud-support.purestorage.com" make install-client
```

- `VERSION_FLAVOUR` is appended to the version to distinguish upstream builds from pure builds\
- `DEFAULT_HOST` is the default Keymaster server address

# GHA Setup
GHA is used to build keymaster client for all used architectures:
- Linux, runs on pure1build runners, default
- Windows, runs on a self-hosted runner
- OSX, runs on a shared self-hosted runner

## Testing

Yubikey support needs to be tested on all architectures.
- OSX: typically easy as developers use it
- Linux
- Install VMWare Fusion via Self Service, Run Ubuntu ISO, connect Yubikey USB to the VM, run `keymaster -checkDevices` and potentially try to login with Yubikey enabled.
- If OSX is running on ARM, also Ubuntu image has to be ARM.
- No installation is needed, live boot works fine
- Windows
- Use VMWare Fusion, pick download from Microsoft, quickly install it (if done otherwise, network drivers are not available, installation won't progress)
- run `keymaster -checkDevices`
- ARM build for Keymaster is not yet working, however, ARM Windows can run x86 binaries

---------------

## OSX GHA Runner
Expand Down
4 changes: 1 addition & 3 deletions cmd/keymaster/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -41,14 +41,12 @@ const (
const userAgentAppName = "keymaster"
const defaultVersionNumber = "No version provided"
const defaultConfigHost = ""
const defaultFlavour = "cf"

var (
// Must be a global variable in the data segment so that the build
// process can inject the version number on the fly when building the
// binary. Use only from the Usage() function.
Version = defaultVersionNumber
versionFlavour = defaultFlavour
defaultHost = defaultConfigHost
userAgentString = userAgentAppName
)
Expand Down Expand Up @@ -465,7 +463,7 @@ func computeUserAgent() {
uaVersion = "0.0"
}

userAgentString = fmt.Sprintf("%s/%s-%s (%s %s)", userAgentAppName, uaVersion, versionFlavour, runtime.GOOS, runtime.GOARCH)
userAgentString = fmt.Sprintf("%s/%s (%s %s)", userAgentAppName, uaVersion, runtime.GOOS, runtime.GOARCH)
}

func getHttpClient(rootCAs *x509.CertPool, logger log.DebugLogger) (*http.Client, error) {
Expand Down

0 comments on commit eee1a3e

Please sign in to comment.