Skip to content

Configuration

Stowaway is configured through environment variables. This guide covers all available options.

VariableDescriptionExample
DATABASE_URLSQLite database file pathfile:./dev.db
AUTH_SECRETSecret key for session encryptionopenssl rand -base64 32
VariableDefaultDescription
AUTH_URLhttp://localhost:3000Application URL (for OAuth callbacks)
UPLOAD_DIR./uploadsDirectory for image uploads
MAX_FILE_SIZE5242880Maximum upload size in bytes (5MB)

.env
DATABASE_URL="file:./dev.db"
AUTH_SECRET="development-secret-change-in-production"
AUTH_URL="http://localhost:3000"
UPLOAD_DIR="./uploads"
MAX_FILE_SIZE=5242880
.env
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=10485760

When running with Docker Compose, environment variables can be set in docker-compose.yml:

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=5242880

Or create a .env file that Docker Compose will automatically load:

.env
AUTH_SECRET=your-production-secret-here
AUTH_URL=https://inventory.yourdomain.com

Danger: Production Security Always use a strong, unique AUTH_SECRET in production. Never use the default value.

=== “OpenSSL”

Terminal window
openssl rand -base64 32

=== “Node.js”

Terminal window
node -e "console.log(require('crypto').randomBytes(32).toString('base64'))"

=== “Python”

Terminal window
python -c "import secrets; print(secrets.token_urlsafe(32))"

Stowaway accepts the following image formats:

  • JPEG (.jpg, .jpeg)
  • PNG (.png)
  • GIF (.gif)
  • WebP (.webp)

To allow larger files, increase MAX_FILE_SIZE:

# 10MB limit
MAX_FILE_SIZE=10485760
# 20MB limit
MAX_FILE_SIZE=20971520

By default, SQLite stores data in ./dev.db in the project root.

# Absolute path
DATABASE_URL="file:/var/data/stowaway/inventory.db"
# Relative path
DATABASE_URL="file:./data/inventory.db"

Simply copy the database file to create a backup:

Terminal window
cp dev.db backups/stowaway-$(date +%Y%m%d).db

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.