Skip to content

Generation-One/rowt-server

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

21 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

Rowt Server - Docker & Traefik Ready

A production-ready, containerized deployment of Rowt - the self-hosted deep linking solution.

πŸ“– For complete Rowt documentation and features, see the Original Rowt README

πŸš€ Quick Start

This fork provides a complete Docker-based deployment solution with Traefik integration for secure, production-ready hosting.

πŸ†• What's New in v1.2.0

  • 🎯 Custom Shortcodes: Create memorable custom shortcodes for your links! Specify your own 1-12 character shortcodes using letters, numbers, hyphens, and underscores. Perfect for branded links like yourdomain.com/promo2024 or yourdomain.com/signup. Auto-generation still works when no custom shortcode is provided.

✨ Key Features

  • 🎯 Custom Shortcodes: Create memorable custom shortcodes (1-12 chars) or use auto-generated 12-character UIDs. Perfect for branded links and easy sharing! Learn more β†’
  • πŸ”— Parameterized Links: Create dynamic links with URL parameters - one template for thousands of variations! Perfect for multi-merchant platforms, user-specific redirects, and campaign tracking. Learn more β†’
  • πŸ“± Deep Link Management: iOS/Android app scheme handling with web fallbacks
  • πŸ“Š Analytics Tracking: Built-in interaction logging with device/country detection
  • πŸ” JWT Authentication: Secure API access with refresh tokens and blacklisting
  • ⚑ Rate Limiting: Built-in abuse prevention (30 req/min default)
  • 🧹 Auto Cleanup: Scheduled data retention and token management
  • 🐳 Production Ready: Docker deployment with Traefik integration

Prerequisites

  • Docker & Docker Compose
  • Existing Traefik reverse proxy (with Let's Encrypt)
  • Domain name (e.g., rowt.yourdomain.com)

1. Clone and Configure

git clone <this-repo>
cd rowt
cp .env.example .env

2. Configure Environment

Edit .env with your settings:

# Domain Configuration
DOMAIN=rowt.yourdomain.com
TRAEFIK_NETWORK=traefik

# Database (PostgreSQL recommended)
ROWT_DATABASE_URL=postgresql://rowt_user:rowt_password@postgres:5432/rowt_db

# Security (IMPORTANT: Change these!)
ROWT_JWT_SECRET=your-secure-32-character-secret-here
[email protected]
ROWT_ADMIN_PASSWORD=your-secure-password

# Single-tenant mode (recommended)
ROWT_TENANT_MODE=single-tenant

3. Deploy

Option A: With Traefik (Recommended for Production)

# Using the deployment script
./deploy.sh --with-traefik

# Or manually
docker-compose up -d

Option B: Standalone (Without Traefik)

# Using the deployment script (port 3000)
./deploy.sh --standalone

# Using the deployment script (custom port)
./deploy.sh --standalone --port 8080

# Or manually
ROWT_PORT=3000 docker-compose -f docker-compose.yml -f docker-compose.standalone.yml up -d

Windows Users

REM With Traefik
deploy.bat --with-traefik

REM Standalone
deploy.bat --standalone --port 3000

Access your application:

  • With Traefik: https://rowt.yourdomain.com (or your configured domain) - No ports exposed
  • Standalone: http://localhost:3000 (or your configured port) - Only app port exposed

Security Note: Production deployments with Traefik expose no external ports for better security. Database and internal services are only accessible within the Docker network.

πŸ”§ Configuration

Traefik Integration

This deployment assumes you have Traefik already running. The configuration includes:

  • Automatic HTTPS via Let's Encrypt
  • HTTP to HTTPS redirect
  • Security headers
  • External Traefik network connection

Environment Variables

Variable Description Example
DOMAIN Your domain name rowt.yourdomain.com
TRAEFIK_NETWORK Traefik network name traefik
ROWT_TENANT_MODE Single or multi-tenant single-tenant
ROWT_JWT_SECRET JWT signing secret 32-char-random-string
ROWT_ADMIN_EMAIL Admin email [email protected]
ROWT_ADMIN_PASSWORD Admin password secure-password

Database Options

PostgreSQL (Recommended for Production):

ROWT_DATABASE_URL=postgresql://user:pass@postgres:5432/rowt_db
ROWT_DB_TYPE=postgres
ROWT_DB_SSL=false

SQLite (Development/Small Scale):

ROWT_DATABASE_URL=sqlite:database.sqlite
ROWT_DB_TYPE=sqlite

πŸ“ Project Structure

rowt/
β”œβ”€β”€ docker-compose.yml          # Main deployment configuration
β”œβ”€β”€ docker-compose.override.yml # Development overrides
β”œβ”€β”€ Dockerfile                  # Multi-stage production build
β”œβ”€β”€ .env.example               # Environment template
β”œβ”€β”€ init-db.sql               # Database initialization
β”œβ”€β”€ start.sh / start.bat      # Deployment scripts
β”œβ”€β”€ DEPLOYMENT.md             # Detailed deployment guide
β”œβ”€β”€ ORIGINAL_README.md        # Original Rowt documentation
└── src/                      # Rowt server source code

πŸ› οΈ Management

Using the Helper Scripts

Linux/macOS:

./start.sh setup    # Initial setup
./start.sh start    # Start services
./start.sh logs     # View logs
./start.sh backup   # Backup database
./start.sh stop     # Stop services

Windows:

start.bat setup    # Initial setup
start.bat start    # Start services
start.bat logs     # View logs
start.bat backup   # Backup database
start.bat stop     # Stop services

Manual Docker Commands

# Start services
docker-compose up -d

# View logs
docker-compose logs -f rowt-server

# Stop services
docker-compose down

# Rebuild and restart
docker-compose down
docker-compose up -d --build

# Database backup
docker-compose exec postgres pg_dump -U rowt_user rowt_db > backup.sql

πŸ”’ Security Features

  • Non-root container execution
  • Multi-stage Docker build for minimal attack surface
  • Automatic HTTPS via Traefik + Let's Encrypt
  • Security headers configured
  • HTTP to HTTPS redirect enforced
  • Rate limiting built-in
  • JWT-based authentication

πŸ“Š Monitoring & Health Checks

  • Health endpoint: https://yourdomain.com/health
  • Docker health checks configured
  • Traefik dashboard integration
  • Structured logging available

πŸ”„ Updates

# Pull latest changes
git pull origin main

# Rebuild and restart
./deploy.sh --build

# Or manually
docker-compose down
docker-compose build --no-cache
docker-compose up -d

# Verify update
curl https://yourdomain.com/health

πŸ”§ Troubleshooting

Deployment Error: ".env.example not found"

If you encounter this error during deployment:

failed to compute cache key: "/.env.example": not found

Solution: Make sure .env.example exists and is not excluded by .dockerignore:

# Check if file exists
ls -la .env.example

# If missing, recreate it
git checkout .env.example

# Rebuild
docker-compose build --no-cache

Port Already in Use

If you get port conflicts during deployment:

For PostgreSQL port 5432 conflict:

# This is fixed in production - no database ports are exposed
# If using development mode, stop conflicting services:
sudo systemctl stop postgresql  # Linux
brew services stop postgresql   # Mac

For application port conflicts in standalone mode:

# Use a different port
./deploy.sh --standalone --port 8080

# Or find what's using the port
netstat -tulpn | grep :3000  # Linux/Mac
netstat -an | findstr :3000  # Windows

Recommended: Use Traefik mode for production (no port conflicts):

./deploy.sh --with-traefik

πŸ“š Documentation

πŸ†š What's Different from Original

This fork adds:

  • βœ… Parameterized Links Create dynamic links with URL parameters
  • βœ… Production-ready Dockerfile with multi-stage build
  • βœ… Traefik integration with automatic HTTPS
  • βœ… Docker Compose setup with PostgreSQL
  • βœ… Security hardening and best practices
  • βœ… Health checks and monitoring
  • βœ… Deployment scripts for easy management
  • βœ… Comprehensive documentation

🀝 Contributing

This is a deployment-focused fork. For Rowt core features and issues:

πŸ“„ License

Same as original Rowt project. See ORIGINAL_README.md for details.


πŸ”— Original Rowt Project | πŸ“– Rowt Documentation | πŸš€ Deployment Guide

About

A modified production-ready, containerized deployment of Rowt - the self-hosted deep linking solution.

Topics

Resources

Stars

Watchers

Forks

Packages

No packages published