Configuration
Configuration
Section titled “Configuration”Stowaway is configured through environment variables. This guide covers all available options.
Environment Variables
Section titled “Environment Variables”Required Variables
Section titled “Required Variables”| Variable | Description | Example |
|---|---|---|
DATABASE_URL | SQLite database file path | file:./dev.db |
AUTH_SECRET | Secret key for session encryption | openssl rand -base64 32 |
Optional Variables
Section titled “Optional Variables”| Variable | Default | Description |
|---|---|---|
AUTH_URL | http://localhost:3000 | Application URL (for OAuth callbacks) |
UPLOAD_DIR | ./uploads | Directory for image uploads |
MAX_FILE_SIZE | 5242880 | Maximum upload size in bytes (5MB) |
Example Configuration
Section titled “Example Configuration”Development
Section titled “Development”DATABASE_URL="file:./dev.db"AUTH_SECRET="development-secret-change-in-production"AUTH_URL="http://localhost:3000"UPLOAD_DIR="./uploads"MAX_FILE_SIZE=5242880Production
Section titled “Production”DATABASE_URL="file:/app/data/stowaway.db"AUTH_SECRET="your-very-long-secure-random-string-here"AUTH_URL="https://inventory.yourdomain.com"UPLOAD_DIR="/app/uploads"MAX_FILE_SIZE=10485760Docker Configuration
Section titled “Docker Configuration”When running with Docker Compose, environment variables can be set in docker-compose.yml:
services: stowaway: environment: - DATABASE_URL=file:/app/data/stowaway.db - AUTH_SECRET=${AUTH_SECRET:-change-this-secret} - AUTH_URL=${AUTH_URL:-http://localhost:3000} - UPLOAD_DIR=/app/uploads - MAX_FILE_SIZE=5242880Or create a .env file that Docker Compose will automatically load:
AUTH_SECRET=your-production-secret-hereAUTH_URL=https://inventory.yourdomain.comSecurity Recommendations
Section titled “Security Recommendations”Danger: Production Security Always use a strong, unique
AUTH_SECRETin production. Never use the default value.
Generating a Secure Secret
Section titled “Generating a Secure Secret”=== “OpenSSL”
openssl rand -base64 32=== “Node.js”
node -e "console.log(require('crypto').randomBytes(32).toString('base64'))"=== “Python”
python -c "import secrets; print(secrets.token_urlsafe(32))"File Upload Settings
Section titled “File Upload Settings”Supported File Types
Section titled “Supported File Types”Stowaway accepts the following image formats:
- JPEG (
.jpg,.jpeg) - PNG (
.png) - GIF (
.gif) - WebP (
.webp)
Changing Upload Limits
Section titled “Changing Upload Limits”To allow larger files, increase MAX_FILE_SIZE:
# 10MB limitMAX_FILE_SIZE=10485760
# 20MB limitMAX_FILE_SIZE=20971520Database
Section titled “Database”Default Location
Section titled “Default Location”By default, SQLite stores data in ./dev.db in the project root.
Custom Database Location
Section titled “Custom Database Location”# Absolute pathDATABASE_URL="file:/var/data/stowaway/inventory.db"
# Relative pathDATABASE_URL="file:./data/inventory.db"Backing Up the Database
Section titled “Backing Up the Database”Simply copy the database file to create a backup:
cp dev.db backups/stowaway-$(date +%Y%m%d).dbTheme Settings
Section titled “Theme Settings”Stowaway supports light and dark themes. Users can toggle between themes in the application settings.
The theme preference is stored in the browser and persists across sessions.