User Management Commands¶
Commands for creating, modifying, and managing Faraday user accounts.
create-superuser¶
Create an admin (superuser) account for the Faraday application.
faraday-manage create-superuser [OPTIONS]
Options¶
| Option | Type | Required | Description |
|---|---|---|---|
--username |
String | Yes (prompted) | Username for the new admin user. Must be unique. |
--email |
String | Yes (prompted) | Email address for the user. Must be a valid email and unique. |
--password |
String | Yes (prompted) | Password for the user. Prompted with confirmation and hidden input. |
Behavior¶
- Validates that the username and email are unique in the database
- Validates email format (must match
user@domain.tldpattern) - Creates a user with the
adminrole andlocaluser type - Hashes the password using Flask-Security's
hash_password
Community Edition Limitation¶
The Community Edition allows only one active user. If an active user already exists, this command will fail with:
Can't create more users. The community edition only allows one user.
Please contact support for further information.
Examples¶
# Interactive mode (recommended)
faraday-manage create-superuser
# Username: admin
# Email: admin@example.com
# Password: ********
# Password (again): ********
# Non-interactive mode
faraday-manage create-superuser --username admin --email admin@example.com --password "SecurePass123"
Output¶
User admin created successfully!
Common Errors¶
| Error | Cause | Solution |
|---|---|---|
User already exists |
Username is taken | Choose a different username |
Invalid email |
Email format is invalid | Use a valid email address |
| Community edition limit | One active user already exists | Use Commercial edition for multiple users |
Could not connect to PostgreSQL |
Database not running | Start PostgreSQL and verify server.ini |
Missing migrations |
Database schema outdated | Run faraday-manage migrate first |
change-password¶
Change the password of an existing Faraday user.
faraday-manage change-password [OPTIONS]
Options¶
| Option | Type | Required | Description |
|---|---|---|---|
--username |
String | Yes (prompted) | The username whose password to change |
--password |
String | Yes (prompted) | The new password. Prompted with confirmation and hidden input. |
Examples¶
# Interactive mode
faraday-manage change-password
# Username: faraday
# Password: ********
# Password (again): ********
# Non-interactive mode
faraday-manage change-password --username faraday --password "NewSecurePass456"
Common Errors¶
| Error | Cause | Solution |
|---|---|---|
Missing migrations |
Database schema outdated | Run faraday-manage migrate |
rename-user¶
Change the username of an existing Faraday user.
faraday-manage rename-user [OPTIONS]
Options¶
| Option | Type | Required | Description |
|---|---|---|---|
--current_username |
String | Yes (prompted) | The current username to rename |
--new_username |
String | Yes (prompted) | The new username |
Note: Option names use underscores (--current_username), not hyphens.
Examples¶
# Interactive mode
faraday-manage rename-user
# Current_username: oldname
# New_username: newname
# Non-interactive mode
faraday-manage rename-user --current_username oldname --new_username newname
Validation¶
- The current and new usernames must be different; otherwise the command exits with:
ERROR: Usernames must be different.