diff --git a/cmd/welcome/main.go b/cmd/welcome/main.go index 24e0baf..4b61ffc 100644 --- a/cmd/welcome/main.go +++ b/cmd/welcome/main.go @@ -244,12 +244,31 @@ func _main() error { s = s.SetString("cool, awesome, going to make your account now...") fmt.Println(s) - // TODO have enough to make account; can now do that + if err = createUser(*data); err != nil { + s = s.SetString(fmt.Sprintf(`augh, I'm sorry. the account creation failed. +Please email root@tilde.town and paste the following error: + +%s + +Your invite code has not been marked as used and you're welcome to try again, though if there is a system issue you might need to wait for word from an admin.`, err.Error())) + fmt.Println(s) + return nil + } + // TODO assuming account creation succeeded, mark invite as used return nil } +func createUser(data newUserData) error { + // TODO adduser + // TODO add to town group + // TODO create keyfile by running helper (helper should also make ~/.ssh) + // TODO generate welcome gift + // TODO any alerts + return errors.New("not implemented") +} + func main() { // TODO friendlier error handling err := _main()