Keyboard shortcuts

Press or to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

Prompt User to Create Admin Credentials

After installing a service, the user typically needs admin credentials to log in. The standard pattern creates a critical task during init that points to a hidden action. The action generates a password (or reads one already generated) and displays it to the user. The task blocks the user from ignoring the step.

Solution

In setupOnInit (on install), generate a password and store it in a file model. Call sdk.action.createOwnTask() with severity 'critical' pointing to a hidden action. The action reads the stored password and returns it in a group result with username (unmasked, copyable) and password (masked, copyable). Use visibility: 'hidden' so the action only appears via the task.

Reference: Initialization · Tasks · Actions

Examples

See startos/init/ and startos/actions/ in: actual-budget, gitea, helipad, lightning-terminal, lnbits, nextcloud, openclaw, vaultwarden