-
-
Notifications
You must be signed in to change notification settings - Fork 4
Installation Guide
Complete installation instructions for Source-License on all supported platforms.
Minimum Requirements:
- Ruby: 3.4.7 or higher
- Database: MySQL 5.7+, PostgreSQL 9.6+, or SQLite 3.8+ (development only)
- Memory: 512MB RAM minimum, 1GB+ recommended
- Storage: 1GB available disk space
- Git: For cloning the repository
Recommended for Production:
- Ruby: Latest stable version (3.4.7+)
- Database: MySQL 8.0+ or PostgreSQL 12+
- Memory: 2GB+ RAM
- Storage: SSD storage with regular backups
- Web Server: Nginx or Apache for SSL termination
Source-License supports the following platforms:
- Windows: Windows 10/11 with PowerShell 7+
- Linux: Ubuntu 18.04+, Debian 9+, CentOS 7+, RHEL 7+
- macOS: macOS 10.14+ (Mojave)
The fastest way to get Source-License running is using the automated installers:
git clone https://github.com/PixelRidgeSoftworks/Source-License.git
cd Source-LicenseWindows (PowerShell):
.\install.ps1Linux/macOS:
chmod +x install.sh
./install.shWindows (PowerShell):
.\deploy.ps1Linux/macOS:
chmod +x deploy.sh
./deploy.sh- Main Website: http://localhost:4567
- Admin Panel: http://localhost:4567/admin
- License Lookup: http://localhost:4567/my-licenses
The installer automatically:
- ✅ Verifies Ruby version compatibility
- 📦 Installs required gems via Bundler
- 🗄️ Sets up and migrates the database
- ⚙️ Creates configuration files from templates
- 🚀 Launches the application server
For customized installations or troubleshooting, follow these manual steps:
Windows:
- Download Ruby from rubyinstaller.org
- Run the installer and select "Add Ruby to PATH"
- Verify installation:
ruby --version
Linux (Ubuntu/Debian):
sudo apt update
sudo apt install ruby ruby-dev build-essentialLinux (CentOS/RHEL):
sudo yum install ruby ruby-devel gcc makemacOS:
# Using Homebrew
brew install ruby
# Using rbenv (recommended)
brew install rbenv
rbenv install 3.4.7
rbenv global 3.4.7MySQL:
# Ubuntu/Debian
sudo apt install mysql-server mysql-client libmysqlclient-dev
# CentOS/RHEL
sudo yum install mysql-server mysql-devel
# macOS
brew install mysqlPostgreSQL:
# Ubuntu/Debian
sudo apt install postgresql postgresql-contrib libpq-dev
# CentOS/RHEL
sudo yum install postgresql postgresql-server postgresql-devel
# macOS
brew install postgresql# Clone repository
git clone https://github.com/PixelRidgeSoftworks/Source-License.git
cd Source-License
# Install gems
bundle install
# Copy environment template
cp .env.example .envEdit the .env file with your specific settings:
# Database Configuration
DATABASE_ADAPTER=mysql # or postgresql, sqlite
DATABASE_HOST=localhost
DATABASE_PORT=3306 # 5432 for PostgreSQL
DATABASE_NAME=source_license
DATABASE_USER=your_username
DATABASE_PASSWORD=your_password
# Security Settings
APP_SECRET=your_long_secure_secret_key_here
JWT_SECRET=your_jwt_secret_here
# Admin Account
ADMIN_EMAIL=admin@yourdomain.com
ADMIN_PASSWORD=your_secure_admin_password# Create database (MySQL example)
mysql -u root -p -e "CREATE DATABASE source_license;"
# Run migrations
ruby -r './lib/database.rb' -e "Database.setup; Database.migrate"
# Create initial admin account
ruby -r './lib/database.rb' -r './lib/models.rb' -e "
Database.setup
Admin.create_secure_admin(ENV['ADMIN_EMAIL'], ENV['ADMIN_PASSWORD'])
"ruby launch.rb-
Install MySQL Server:
# Ubuntu/Debian sudo apt install mysql-server # Start and enable service sudo systemctl start mysql sudo systemctl enable mysql
-
Secure Installation:
sudo mysql_secure_installation
-
Create Database and User:
CREATE DATABASE source_license CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci; CREATE USER 'source_license'@'localhost' IDENTIFIED BY 'secure_password'; GRANT ALL PRIVILEGES ON source_license.* TO 'source_license'@'localhost'; FLUSH PRIVILEGES;
-
Configure .env:
DATABASE_ADAPTER=mysql DATABASE_HOST=localhost DATABASE_PORT=3306 DATABASE_NAME=source_license DATABASE_USER=source_license DATABASE_PASSWORD=secure_password
-
Install PostgreSQL:
# Ubuntu/Debian sudo apt install postgresql postgresql-contrib # Start and enable service sudo systemctl start postgresql sudo systemctl enable postgresql
-
Create Database and User:
sudo -u postgres psql
CREATE DATABASE source_license; CREATE USER source_license WITH PASSWORD 'secure_password'; GRANT ALL PRIVILEGES ON DATABASE source_license TO source_license; \q
-
Configure .env:
DATABASE_ADAPTER=postgresql DATABASE_HOST=localhost DATABASE_PORT=5432 DATABASE_NAME=source_license DATABASE_USER=source_license DATABASE_PASSWORD=secure_password
Warning: SQLite should never be used in production environments due to concurrency limitations.
DATABASE_ADAPTER=sqlite
DATABASE_NAME=source_license.dbThe .env file contains all configuration settings. Key sections:
Application Settings:
APP_ENV=development
APP_SECRET=your_secret_key_here
APP_HOST=localhost
APP_PORT=4567Security Settings:
JWT_SECRET=your_jwt_secret_here
FORCE_SSL=false # true for production
ALLOWED_HOSTS=yourdomain.com,www.yourdomain.comPayment Gateways:
# Stripe
STRIPE_PUBLISHABLE_KEY=pk_test_your_key
STRIPE_SECRET_KEY=sk_test_your_key
STRIPE_WEBHOOK_SECRET=whsec_your_secret
# PayPal
PAYPAL_CLIENT_ID=your_client_id
PAYPAL_CLIENT_SECRET=your_client_secret
PAYPAL_ENVIRONMENT=sandbox # or productionEmail Configuration:
SMTP_HOST=smtp.gmail.com
SMTP_PORT=587
SMTP_USERNAME=your_email@gmail.com
SMTP_PASSWORD=your_app_password
SMTP_TLS=trueSource-License uses these key gems:
# Core framework
gem 'sinatra'
gem 'sinatra-contrib'
# Database
gem 'sequel'
gem 'mysql2' # or 'pg' for PostgreSQL
# Security
gem 'bcrypt'
gem 'jwt'
# Payment processing
gem 'stripe'
# Email
gem 'mail'-
Install Nginx:
sudo apt install nginx
-
Configure Nginx:
server { listen 80; server_name yourdomain.com; location / { proxy_pass http://localhost:4567; proxy_set_header Host $host; proxy_set_header X-Real-IP $remote_addr; proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; proxy_set_header X-Forwarded-Proto $scheme; } }
-
SSL with Let's Encrypt:
sudo apt install certbot python3-certbot-nginx sudo certbot --nginx -d yourdomain.com
-
Configure Puma:
# puma.rb workers 2 threads 1, 6 bind "tcp://127.0.0.1:4567" environment ENV.fetch("APP_ENV") { "production" }
-
Create Dockerfile:
FROM ruby:3.4.7-alpine WORKDIR /app COPY Gemfile Gemfile.lock ./ RUN bundle install --deployment --without development test COPY . . EXPOSE 4567 CMD ["ruby", "launch.rb"]
-
Docker Compose:
version: '3.8' services: app: build: . ports: - "4567:4567" environment: - DATABASE_ADAPTER=mysql - DATABASE_HOST=db depends_on: - db db: image: mysql:8.0 environment: - MYSQL_ROOT_PASSWORD=rootpassword - MYSQL_DATABASE=source_license
After installation, verify everything is working:
Visit http://localhost:4567 and verify:
- ✅ Homepage loads without errors
- ✅ Admin panel accessible at
/admin - ✅ Database connection working
- Go to http://localhost:4567/admin
- Login with credentials from
.envfile - Verify dashboard loads with system statistics
# Test license validation endpoint
curl http://localhost:4567/api/license/test-key/validate
# Should return JSON response (even if license doesn't exist)# Application logs
tail -f logs/application.log
# Error logs
tail -f logs/error.logRuby Version Error:
Source-License requires Ruby 3.4.7 or higher
Solution: Install correct Ruby version using rbenv or RVM
Database Connection Failed:
Sequel::DatabaseConnectionError
Solution:
- Verify database server is running
- Check credentials in
.envfile - Ensure database exists
Port Already in Use:
Address already in use - bind(2)
Solution:
- Kill existing process:
lsof -ti:4567 | xargs kill - Or change port in
.env:APP_PORT=4568
Permission Denied (Linux/macOS):
Permission denied - ./install.sh
Solution: Make scripts executable: chmod +x *.sh
Check installation logs for detailed error information:
-
Windows:
installer-logs\install-YYYY-MM-DD-HHMMSS.log -
Linux/macOS:
installer-logs/install-YYYY-MM-DD-HHMMSS.log
If you encounter issues:
-
Check the logs in the
logs/directory - Review the troubleshooting guide in this wiki
- Search existing issues on GitHub
-
Create a new issue with:
- Operating system and version
- Ruby version
- Complete error message
- Installation log file
To update Source-License to the latest version:
# Pull latest changes
git pull origin main
# Update dependencies
bundle install
# Run any new migrations
ruby -r './lib/database.rb' -e "Database.setup; Database.migrate"
# Restart applicationFor development and testing:
# Clone repository
git clone https://github.com/PixelRidgeSoftworks/Source-License.git
cd Source-License
# Install development dependencies
bundle install
# Use SQLite for development
cp .env.example .env
# Edit .env to use sqlite adapter
# Run tests
ruby run_tests.rb
# Start development server
ruby launch.rbNext Steps: Once installation is complete, continue with the Configuration Guide to set up payment gateways, email, and other integrations.