From 18a64de0de6c31eaa9fa0f1a2409661195494b15 Mon Sep 17 00:00:00 2001 From: Andrew Woodlee Date: Tue, 11 Mar 2025 15:36:43 -0500 Subject: [PATCH] UserCommands: change field name --- .changes/unreleased/Added-20250311-152028.yaml | 3 +++ .changes/unreleased/Added-20250311-153026.yaml | 3 +++ docs/content/config/commands/user-commands.md | 2 ++ pkg/backy/types.go | 2 +- pkg/backy/utils.go | 2 +- 5 files changed, 10 insertions(+), 2 deletions(-) create mode 100644 .changes/unreleased/Added-20250311-152028.yaml create mode 100644 .changes/unreleased/Added-20250311-153026.yaml diff --git a/.changes/unreleased/Added-20250311-152028.yaml b/.changes/unreleased/Added-20250311-152028.yaml new file mode 100644 index 0000000..288acff --- /dev/null +++ b/.changes/unreleased/Added-20250311-152028.yaml @@ -0,0 +1,3 @@ +kind: Added +body: 'UserCommands: add ssh public keys when running locally' +time: 2025-03-11T15:20:28.487596157-05:00 diff --git a/.changes/unreleased/Added-20250311-153026.yaml b/.changes/unreleased/Added-20250311-153026.yaml new file mode 100644 index 0000000..70de418 --- /dev/null +++ b/.changes/unreleased/Added-20250311-153026.yaml @@ -0,0 +1,3 @@ +kind: Added +body: 'UserCommands: add field CreateUserHome' +time: 2025-03-11T15:30:26.824884876-05:00 diff --git a/docs/content/config/commands/user-commands.md b/docs/content/config/commands/user-commands.md index 65ec1be..cfa28d4 100644 --- a/docs/content/config/commands/user-commands.md +++ b/docs/content/config/commands/user-commands.md @@ -12,6 +12,8 @@ This is dedicated to `user` commands. The command `type` field must be `user`. U | `userOperation` | The type of operation to perform. | `string` | yes | no | | `userID` | The user ID to use. | `string` | no | no | | `userGroups` | The groups the user should be added to. | `[]string` | no | no | +| `systemUser` | Create a system user. | `bool` | no | no | +| `userCreateHome`| Create the home directory. | `bool` | no | no | | `userSshPubKeys`| The keys to add to the user's authorized keys. | `[]string` | no | yes | | `userShell` | The shell for the user. | `string` | no | no | | `userHome` | The user's home directory. | `string` | no | no | diff --git a/pkg/backy/types.go b/pkg/backy/types.go index 2c32d06..8afca8e 100644 --- a/pkg/backy/types.go +++ b/pkg/backy/types.go @@ -117,7 +117,7 @@ type ( UserCreateHome bool `yaml:"userCreateHome,omitempty"` - SystemUser bool `yaml:"systemUser,omitempty"` + UserIsSystem bool `yaml:"userIsSystem,omitempty"` UserPassword string `yaml:"userPassword,omitempty"` diff --git a/pkg/backy/utils.go b/pkg/backy/utils.go index 975d4f0..213df74 100644 --- a/pkg/backy/utils.go +++ b/pkg/backy/utils.go @@ -293,7 +293,7 @@ func getCommandTypeAndSetCommandInfo(command *Command) *Command { command.Username, command.UserHome, command.UserShell, - command.SystemUser, + command.UserIsSystem, command.UserCreateHome, command.UserGroups, command.Args)