Authentication¶
Trunk8 supports both multi-user authentication and administrator single-password mode.
Multi-User Authentication¶
User Accounts¶
Trunk8 uses individual user accounts with:
- Username and password for each user
- Isolated data storage in
users/{username}/
directories - Admin privileges for user management
- User switching for admin users
Login Process¶
- Navigate to your Trunk8 instance
- You'll be redirected to
/auth/login
- Enter your username and password
- Check "Remember me" to stay logged in for 30 days
User Types¶
Regular Users¶
- Can manage their own links and files
- Access to personal dashboard and settings
- Data stored in
users/{username}/
Admin Users¶
- Can manage their own content
- User Management - Create, view, and delete users
- User Switching - View system from any user's perspective
- Global Access - Can view and edit all users' links
User Management (Admin Only)¶
Admin users can:
- Create new users at
/auth/register
- View all users at
/users
- Switch user context to help with support
- Delete users (except admin user)
Administrator Single-Password Mode¶
For administrator access, you can use single-password authentication:
- Leave the username field blank
- Enter the admin password
- System automatically creates admin user if needed
Setting Admin Password¶
Configure via environment variable:
Or in .env
file:
Default password is admin
if not configured. Always change this in production!
Session Management¶
Session Duration¶
Sessions last: - 30 minutes without "Remember me" - 30 days with "Remember me" checked (configurable)
Configure in config/config.toml
:
User Switching (Admin Only)¶
Admin users can switch to view the system from any user's perspective:
- Navigate to
/users
- Click "Switch to User" for any user
- View their dashboard and links
- Click "Switch Back" to return to admin view
Logging Out¶
Click "Logout" in the navigation to end your session immediately.
Security Best Practices¶
For Multi-User Systems¶
-
Strong Passwords for All Users
- Minimum 12 characters
- Mix of letters, numbers, symbols
- Unique passwords for each user
-
Admin Account Security
- Use secure admin password
- Limit admin privileges
- Regular password rotation
-
User Account Management
- Remove unused accounts
- Regular access audits
- Monitor user activity
General Security¶
-
Environment Security
- Use HTTPS in production
- Restrict admin access by IP
- Enable rate limiting
-
Data Protection
- Each user's data is isolated
- Files stored with secure names
- Regular backups of user data
Troubleshooting¶
Can't Log In¶
Check:
- Correct username and password (case-sensitive)
- Account hasn't been deleted by admin
- System is in correct authentication mode
Forgot Password¶
For Regular Users:
- Contact admin user
- Admin can reset password via user management
For Admin User:
- Access server directly
- Set new password via
TRUNK8_ADMIN_PASSWORD
- Restart application
User Not Found¶
If username doesn't exist:
- Check spelling (case-sensitive)
- Contact admin to create account
- Use admin mode if admin password is known
Session Issues¶
If session expires:
- You'll be redirected to login
- Enter credentials again
- Previous work is preserved
Public vs Admin Access¶
Public Access (No Auth Required)¶
- Accessing short links (
/shortcode
) - Downloading files
- Viewing markdown content
Admin Access (Auth Required)¶
- Creating new links (
/add
) - Editing links (
/edit_link/code
) - Deleting links
- Viewing all links (
/links
) - Changing settings (
/settings
)
Next Steps¶
- Learn about User Management
- Explore Multi-User Features
- Configure Settings