Invite Codes
Invite codes allow you to control who can register for your Zipline instance. This is useful for private instances or limiting access to trusted users.Configuration
Enable invites in your database configuration:- invitesEnabled: Enable the invite system
- invitesLength: Length of generated invite codes (default: 6 characters)
- featuresUserRegistration: Allow registration without invite codes
If
featuresUserRegistration is false, users must have an invite code to register.Invite Code Structure
Invite codes are stored in the database:- code: The unique invite code (e.g., “abc123”)
- uses: How many times this code has been used
- maxUses: Maximum number of uses (null = unlimited)
- expiresAt: When the invite expires (null = never)
- inviterId: The user who created this invite
Creating Invites
Administrators can create invite codes through the admin panel or API:Using Invite Codes
When registering, users provide the invite code:src/server/routes/api/auth/register.ts:52:
Invite Links
Users can share invite links:User Quotas
Quotas limit how much storage or how many files/URLs each user can create. This helps manage server resources and prevents abuse.Quota Types
Zipline supports three types of file quotas:By Bytes
Limit total storage size (e.g., 1GB, 10GB)
By Files
Limit number of files (e.g., 100 files)
No Limit
No quota restrictions
Database Schema
Setting Quotas
Administrators can set quotas for users:Quota Enforcement
Quotas are checked before file uploads atsrc/lib/api/upload.ts:32:
URL Quotas
URL quotas are checked when shortening URLs:Byte Size Formats
Quota sizes support human-readable formats:"100mb"= 100 megabytes"1gb"= 1 gigabyte"500kb"= 500 kilobytes"1tb"= 1 terabyte
bytes library.
Admin Management
Viewing User Quotas
Administrators can view quota usage:Managing Invites
List all invites:Use Cases
Private Instance with Invites
Tiered Storage Plans
Free tier:Temporary Access
Create time-limited invites for temporary users:Best Practices
- Set reasonable defaults: Start with conservative quotas and adjust based on usage
- Monitor usage: Regularly review user quota consumption
- Communicate limits: Make quota limits clear to users
- Plan for growth: Design quotas that can scale with your infrastructure
- Use expiring invites: Set expiration dates on invite codes for security
- Limit invite uses: Prevent invite code sharing by setting maxUses
Troubleshooting
”Invalid invite code” Error
- Check the code hasn’t expired (
expiresAt) - Verify the code hasn’t reached max uses
- Ensure invites are enabled (
invitesEnabled: true) - Confirm the code exists in the database
Quota Exceeded Errors
- Check current usage with
GET /api/users/:userId - Verify quota settings are correct
- Ensure quota values are properly formatted (“1gb” not “1GB”)
- Delete old files to free up quota
User Can’t Register
- If
featuresUserRegistrationisfalse, they need an invite code - Check that the invite code is valid and not expired
- Verify invites are enabled in configuration
- Ensure username isn’t already taken