Skip to content

Commit d00c766

Browse files
authored
Merge pull request #17 from blackkaven/update_conf
config/types/update.go Added support for more fields in update section
2 parents 6e83034 + 694b486 commit d00c766

File tree

2 files changed

+26
-2
lines changed

2 files changed

+26
-2
lines changed

config/types/update.go

Lines changed: 22 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,12 +33,20 @@ var (
3333
)
3434

3535
type Update struct {
36-
Group UpdateGroup `yaml:"group"`
37-
Server UpdateServer `yaml:"server"`
36+
Group UpdateGroup `yaml:"group"`
37+
Server UpdateServer `yaml:"server"`
38+
PCRPolicyServer UpdatePCRPolicyServer `yaml:"pcr_policy_server"`
39+
DownloadUser UpdateDownloadUser `yaml:"download_user"`
40+
DownloadPassword UpdateDownloadPassword `yaml:"download_password"`
41+
MachineAlias UpdateMachineAlias `yaml:"machine_alias"`
3842
}
3943

4044
type UpdateGroup string
4145
type UpdateServer string
46+
type UpdatePCRPolicyServer string
47+
type UpdateDownloadUser string
48+
type UpdateDownloadPassword string
49+
type UpdateMachineAlias string
4250

4351
func (u Update) Validate() report.Report {
4452
switch strings.ToLower(string(u.Group)) {
@@ -70,6 +78,18 @@ func init() {
7078
if in.Update.Server != "" {
7179
contents += fmt.Sprintf("\nSERVER=%s", in.Update.Server)
7280
}
81+
if in.Update.PCRPolicyServer != "" {
82+
contents += fmt.Sprintf("\nPCR_POLICY_SERVER=%s", in.Update.PCRPolicyServer)
83+
}
84+
if in.Update.DownloadUser != "" {
85+
contents += fmt.Sprintf("\nDOWNLOAD_USER=%s", in.Update.DownloadUser)
86+
}
87+
if in.Update.DownloadPassword != "" {
88+
contents += fmt.Sprintf("\nDOWNLOAD_PASSWORD=%s", in.Update.DownloadPassword)
89+
}
90+
if in.Update.MachineAlias != "" {
91+
contents += fmt.Sprintf("\nMACHINE_ALIAS=%s", in.Update.MachineAlias)
92+
}
7393
}
7494
if in.Locksmith != nil {
7595
lines := in.Locksmith.configLines()

doc/configuration.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -160,6 +160,10 @@ _Note: all fields are optional unless otherwise marked_
160160
* **update**
161161
* **group** (string): the update group to follow. Most users will want one of: stable, beta, alpha.
162162
* **server** (string): the server to fetch updates from.
163+
* **pcr_policy_server** (string): the server to receive posted TPM PCR policy from.
164+
* **download_user** (string): the authentication user to fetch the update.
165+
* **download_password** (string): the authentication password to fetch the update
166+
* **machine_alias** (string): human readable machine alias to be displayed in the update server UI.
163167
* **locksmith**
164168
* **reboot_strategy** (string): the reboot strategy for locksmithd to follow. Must be one of: reboot, etcd-lock, off.
165169
* **window_start** (string, required if window-length isn't empty): the start of the window that locksmithd can reboot the machine during

0 commit comments

Comments
 (0)