Skip to content

New machine: the username check is looser than the server's, so valid-looking names fail on create #206

Closed

Description

@nixfred

What happens

In web/src/CreateMachine.tsx line 203, usernameOk only applies a pattern for Windows. For Linux images it accepts any non-empty text, and the red hint (line 272, "Letters, numbers, dots, dashes; up to 20 characters") never appears for them because it needs !usernameOk. The server (omarchyd/machines.mjs create, about line 498) requires ^[a-z_][a-z0-9_-]{0,31}$ and not root for Linux, so upper-case letters, dots, spaces or a leading digit are refused. For Windows the client pattern accepts administrator and guest, which the server refuses.

The default is derived from the account name, so it is usually fine, but a typed "John.Smith", "Fred", "2fast" or "root" enables "Create machine" and fails after the click. The hint text also lists dots, which the Linux rule does not allow.

How to reproduce

New machine, Ubuntu Server, username "Fred" (or "john.smith"), any password, "Create machine". Actual: error "Use a lower-case username: letters, numbers, - and _ (not root)". Expected: the field is flagged before submitting.

Suggested fix

Apply the server's patterns in usernameOk (Linux: /^[a-z_][a-z0-9_-]{0,31}$/ and not root; Windows: also not administrator or guest) and show the matching hint.

Environment

Omarchy Server main (0786ba9, 0.9.50), Node 26.

Activity

  1. calledtoconstruct commented on Nov 22, 2026

    @calledtoconstruct
    Collaborator

    Working to resolve this.

    No open pull request references this issue, and no one has commented that they are working on it.

    #163, #653, #472, #797, #204, #205, #207, #654, #806, #798, #264, #258, #238, and #360 share storage, setup, and new machines with this and will land in one pull request.

    🤖 Generated with Grok 4.7

  2. calledtoconstruct commented on Nov 22, 2026

    @calledtoconstruct
    Collaborator

    Thanks @nixfred. The username check matches the server, including root on Linux and Administrator or Guest on Windows. This ships in #879.

    🤖 Generated with Grok 4.7

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions