Managing Users¶
This guide covers user management functionality for administrators in Trunk8's multi-user environment.
Overview¶
Trunk8 supports multi-user functionality where administrators can create, manage, and delete user accounts. Each user has their own isolated data space with separate links and assets.
User Management Interface¶
Accessing User Management¶
- Log in as an administrator
- Navigate to the Users page from the main menu
- View all users and their statistics
User Information Display¶
For each user, you can see:
- Username and display name
- Admin status (Admin/User badge)
- Number of links created
- Account creation date
- Total data usage
Creating Users¶
Registration Process¶
- Click Add User on the Users page
- Fill in the registration form:
- Username: Unique identifier (3+ characters, letters/numbers/hyphens/underscores only)
- Password: User password (4+ characters minimum)
- Display Name: Human-readable name for the user
- Admin Privileges: Check to grant admin access
- Click Register to create the user
User Directory Structure¶
When a user is created, Trunk8 automatically creates:
users/
├── username/
│ ├── assets/ # User's uploaded files
│ └── links.toml # User's link configuration
Deleting Users¶
⚠️ Cascading Deletion Warning¶
When you delete a user, ALL of their data is permanently removed, including: - User account and authentication - All user's links (redirect, file, and markdown links) - All uploaded files and assets - Entire user directory structure
This action cannot be undone!
Deletion Process¶
- Navigate to the Users page
- Find the user you want to delete
- Click Delete User or go to the user's detail page
- Confirm the deletion in the dialog box
- The system will:
- Remove all user links
- Delete all user files and assets
- Remove the user directory
- Remove the user account
- Log cleanup statistics
Deletion Preview¶
Before deleting a user, you can view their data on the user detail page:
- Number of links that will be deleted
- Number of files that will be removed
- Total storage space that will be freed
- List of directories that will be deleted
Deletion Restrictions¶
- The admin user cannot be deleted
- Only administrators can delete users
- Users cannot delete themselves or other users
Error Handling¶
The system handles various error conditions during deletion:
- Permission Errors: If files cannot be deleted due to permissions, the user account is still removed
- Missing Files: If files are already missing, deletion continues normally
- Corrupted Data: If link files are corrupted, cleanup proceeds with warnings
- Partial Failures: Any cleanup issues are logged, but user removal continues
User Switching (Admin Feature)¶
Viewing as Another User¶
Administrators can switch to view the system as any user:
- Go to the Users page or user detail page
- Click View as User
- The interface will switch to show that user's perspective
- You'll see their links, assets, and have their permissions
- Click Switch Back to return to admin view
Benefits of User Switching¶
- Test user experience without separate login
- Troubleshoot user-specific issues
- Verify user permissions and data isolation
- Assist users with their configuration
Best Practices¶
Before Deleting Users¶
- Backup Important Data: Export any links or files that should be preserved
- Notify the User: Ensure the user knows their account will be deleted
- Review Data: Check the user detail page to understand what will be lost
- Document Reasons: Keep records of why the account was deleted
User Account Management¶
- Regular Audits: Periodically review user accounts and usage
- Cleanup Inactive Accounts: Remove accounts that are no longer needed
- Monitor Storage: Keep track of total system storage usage
- Security Reviews: Regularly review admin privileges
Data Recovery¶
- No Built-in Recovery: Deleted user data cannot be recovered through the interface
- Backup Strategy: Implement regular backups of the entire
users/
directory - Export Before Deletion: Manually backup important user data before deletion
Security Considerations¶
Admin Privileges¶
- Only grant admin access to trusted users
- Regularly review who has admin privileges
- Consider using separate admin accounts for different purposes
Data Isolation¶
- Users cannot access other users' data
- Each user has completely separate storage
- File paths are isolated per user
Audit Trail¶
- User creation and deletion are logged
- Cleanup statistics are recorded
- Failed operations are logged with details
API Integration¶
The user management functionality is also available through the system's internal APIs:
UserManager.create_user()
: Create new users programmaticallyUserManager.delete_user()
: Delete users with full cleanupUserManager.get_user_deletion_preview()
: Preview deletion impactUserManager.list_users()
: Get all users in the system
For detailed API documentation, see the API Reference.