đī¸ CreatorContent.net
U
User
!
-
!
-
Manage Subscription
Manage Tokens
Storage
Media Library â
Documentation
User Dashboard
Podcasts
Podcasts
Episodes
Transcriptions
Contributors
Studio
Public Profile
Public Profiles
Blog
Event Lists
Surveys
Contact Forms
Subscribers
Notifications & Shoutouts
Development
React Test
Media Library
Help Center
Admin Dashboard
Logout
Back to Documentation
Configuration
Configuration
File: 19-configuration.md
Documentation Index
Loading documentation...
# Configuration ## Overview This document covers all configuration options for CreatorContent.net, including environment variables, service configurations, and platform settings. ## Environment Variables The application uses Laravel's standard `.env` file for configuration. Copy `.env.example` to `.env` and configure the following: ### Application Configuration ```env APP_NAME="CreatorContent.net" APP_ENV=production APP_KEY= APP_DEBUG=false APP_URL=https://creatorcontent.net APP_TIMEZONE=UTC ``` #### Required Variables - **APP_NAME**: Application name displayed in UI - **APP_ENV**: Environment (`local`, `staging`, `production`) - **APP_KEY**: Generated with `php artisan key:generate` - **APP_DEBUG**: Set to `false` in production - **APP_URL**: Full URL to application (no trailing slash) ### Database Configuration ```env DB_CONNECTION=mysql DB_HOST=127.0.0.1 DB_PORT=3306 DB_DATABASE=creatorcontent DB_USERNAME=your_database_user DB_PASSWORD=your_database_password ``` **Supported Drivers**: `mysql`, `pgsql`, `sqlite` ### Cache & Sessions ```env CACHE_STORE=file SESSION_DRIVER=database SESSION_LIFETIME=120 ``` **Cache Options**: `file`, `redis`, `memcached`, `database` **Session Options**: `file`, `database`, `redis` ### Queue Configuration ```env QUEUE_CONNECTION=database ``` **Options**: `sync`, `database`, `redis`, `sqs` ### Mail Configuration ```env MAIL_MAILER=smtp MAIL_HOST=smtp.mailtrap.io MAIL_PORT=2525 MAIL_USERNAME=null MAIL_PASSWORD=null MAIL_ENCRYPTION=null MAIL_FROM_ADDRESS="noreply@creatorcontent.net" MAIL_FROM_NAME="${APP_NAME}" ``` **Supported Mailers**: `smtp`, `sendmail`, `mailgun`, `ses`, `postmark`, `resend` ### File Storage ```env FILESYSTEM_DISK=local ``` **Options**: `local`, `public`, `s3`, `sftp` For S3: ```env AWS_ACCESS_KEY_ID= AWS_SECRET_ACCESS_KEY= AWS_DEFAULT_REGION=us-east-1 AWS_BUCKET= AWS_USE_PATH_STYLE_ENDPOINT=false ``` ### Stripe Configuration ```env STRIPE_KEY=pk_live_... STRIPE_SECRET=sk_live_... STRIPE_WEBHOOK_SECRET=whsec_... ``` **Important**: - Use test keys (`pk_test_`, `sk_test_`) in development - Use live keys in production - Set webhook secret from Stripe dashboard - Configure webhook endpoint: `https://yourdomain.com/api/webhook/stripe` ### Twilio Configuration ```env TWILIO_SID=AC... TWILIO_AUTH_TOKEN=your_auth_token TWILIO_PHONE_NUMBER=+1234567890 ``` Required for SMS OTP authentication and notifications. ### OpenAI Configuration ```env OPENAI_API_KEY=sk-... OPENAI_ORGANIZATION=org-... OPENAI_API_SERVICE_NAME=creatorcontent OPENAI_DEFAULT_MODEL=gpt-4o ``` Used for transcription generation and AI features. ### Domain Provisioning ```env PROVISION_PLATFORM_DOMAIN=creatorcontent.net PROVISION_EXPECTED_IPS=203.0.113.10,203.0.113.11 PROVISION_RESOLVER=8.8.8.8 ``` For custom domain validation and DNS preflight checks. ## Service Configuration Files ### `config/services.php` Third-party service credentials are stored here: ```php 'twilio' => [ 'sid' => env('TWILIO_SID'), 'token' => env('TWILIO_AUTH_TOKEN'), 'phone_number' => env('TWILIO_PHONE_NUMBER'), ], 'openai' => [ 'api_key' => env('OPENAI_API_KEY'), 'organization' => env('OPENAI_ORGANIZATION'), 'api_service_name' => env('OPENAI_API_SERVICE_NAME'), ], ``` ### `config/openai.php` OpenAI-specific configuration: ```php 'api_key' => env('OPENAI_API_KEY'), 'service_name' => env('OPENAI_API_SERVICE_NAME', 'creatorcontent'), 'default_model' => env('OPENAI_DEFAULT_MODEL', 'gpt-4o'), 'defaults' => [ 'temperature' => 0.7, 'max_tokens' => 4000, 'timeout' => 60, ], ``` ### `config/provision.php` Domain provisioning configuration: ```php 'platform_domain' => env('PROVISION_PLATFORM_DOMAIN', 'creatorcontent.net'), 'expected_ips' => env('PROVISION_EXPECTED_IPS', ''), 'resolver' => env('PROVISION_RESOLVER', '8.8.8.8'), ``` ## Laravel Cashier Configuration Cashier is configured via environment variables: ```env STRIPE_KEY= STRIPE_SECRET= STRIPE_WEBHOOK_SECRET= ``` See `config/cashier.php` for additional Cashier settings. ## Session Configuration Default session driver is `database`. Configure in `config/session.php`: ```php 'driver' => env('SESSION_DRIVER', 'database'), 'lifetime' => env('SESSION_LIFETIME', 120), 'expire_on_close' => false, 'encrypt' => false, 'files' => storage_path('framework/sessions'), ``` ## Database Configuration ### MySQL Default Configuration ```php 'mysql' => [ 'driver' => 'mysql', 'host' => env('DB_HOST', '127.0.0.1'), 'port' => env('DB_PORT', '3306'), 'database' => env('DB_DATABASE', 'laravel'), 'username' => env('DB_USERNAME', 'root'), 'password' => env('DB_PASSWORD', ''), 'charset' => env('DB_CHARSET', 'utf8mb4'), 'collation' => env('DB_COLLATION', 'utf8mb4_unicode_ci'), 'strict' => true, ], ``` ## Cache Configuration Default cache driver is `file`. Redis recommended for production: ```env CACHE_STORE=redis REDIS_HOST=127.0.0.1 REDIS_PASSWORD=null REDIS_PORT=6379 ``` ## Logging Configuration Configured in `config/logging.php`. Default channel is `stack`: ```php 'channels' => [ 'stack' => [ 'driver' => 'stack', 'channels' => ['daily'], 'ignore_exceptions' => false, ], 'daily' => [ 'driver' => 'daily', 'path' => storage_path('logs/laravel.log'), 'level' => env('LOG_LEVEL', 'debug'), 'days' => 14, ], ], ``` ## Production Configuration Checklist ### Essential Settings - [ ] `APP_ENV=production` - [ ] `APP_DEBUG=false` - [ ] `APP_URL` set to production domain - [ ] Strong `APP_KEY` generated - [ ] `DB_*` variables configured - [ ] `STRIPE_KEY` and `STRIPE_SECRET` (live keys) - [ ] `STRIPE_WEBHOOK_SECRET` configured - [ ] `TWILIO_*` credentials configured - [ ] `OPENAI_API_KEY` configured - [ ] `MAIL_*` variables configured - [ ] Storage link created: `php artisan storage:link` ### Security Settings - [ ] `APP_DEBUG=false` - [ ] HTTPS enforced (configure in web server) - [ ] Secure cookies enabled - [ ] Database credentials secured - [ ] API keys stored in `.env` (not in code) - [ ] `.env` file permissions: `600` - [ ] `storage/` and `bootstrap/cache/` writable ### Performance Settings - [ ] `CACHE_STORE=redis` (or appropriate cache) - [ ] `QUEUE_CONNECTION=redis` (or database) - [ ] Optimized autoloader: `composer install --optimize-autoloader --no-dev` - [ ] Config cached: `php artisan config:cache` - [ ] Route cached: `php artisan route:cache` - [ ] View cached: `php artisan view:cache` ### Background Jobs Set up queue workers: ```bash php artisan queue:work --daemon ``` Or use Supervisor for process management. ## Service-Specific Configuration ### Stripe Webhook Setup 1. **Create Webhook in Stripe Dashboard** - URL: `https://yourdomain.com/api/webhook/stripe` - Events: See `docs/stripe-webhook-events.md` 2. **Get Webhook Secret** - Copy secret from Stripe dashboard - Set `STRIPE_WEBHOOK_SECRET` in `.env` 3. **Test Webhook** - Use Stripe CLI or dashboard test mode - Verify events are received and processed ### Twilio Setup 1. **Get Account Credentials** - Account SID from Twilio console - Auth Token from Twilio console 2. **Get Phone Number** - Purchase Twilio phone number - Set `TWILIO_PHONE_NUMBER` in E.164 format 3. **Test SMS** - Send test SMS via admin panel - Verify delivery ### OpenAI Setup 1. **Create API Key** - Generate key from OpenAI dashboard - Set `OPENAI_API_KEY` in `.env` 2. **Set Organization (Optional)** - For team accounts - Set `OPENAI_ORGANIZATION` if needed 3. **Configure Model** - Default: `gpt-4o` - Override with `OPENAI_DEFAULT_MODEL` ## Environment-Specific Configuration ### Local Development ```env APP_ENV=local APP_DEBUG=true DB_HOST=127.0.0.1 CACHE_STORE=file QUEUE_CONNECTION=sync ``` ### Staging ```env APP_ENV=staging APP_DEBUG=false DB_HOST=staging-db-host CACHE_STORE=redis QUEUE_CONNECTION=redis ``` ### Production ```env APP_ENV=production APP_DEBUG=false DB_HOST=production-db-host CACHE_STORE=redis QUEUE_CONNECTION=redis ``` ## Configuration Validation After configuration, validate setup: ```bash # Check configuration php artisan config:show # Test database connection php artisan db:show # Test cache php artisan tinker >>> Cache::put('test', 'value', 60); >>> Cache::get('test'); # Test queues php artisan queue:work --once ``` ## Troubleshooting ### Common Issues 1. **"No application encryption key"** - Run: `php artisan key:generate` 2. **Database connection failed** - Verify `DB_*` variables - Check database server is running - Verify credentials 3. **Stripe webhook not working** - Verify `STRIPE_WEBHOOK_SECRET` matches Stripe dashboard - Check webhook URL is accessible - Review logs: `storage/logs/laravel.log` 4. **Storage link not working** - Run: `php artisan storage:link` - Verify `public/storage` exists 5. **Queue jobs not processing** - Check `QUEUE_CONNECTION` is set - Run queue worker: `php artisan queue:work` ## Related Documentation - **Deployment**: See `docs/20-deployment.md` for deployment-specific configuration - **API Reference**: See `docs/03-api-reference.md` for API configuration - **Stripe**: See `docs/stripe-webhook-events.md` for Stripe configuration
0
đ Page Notes
+ Add New
Add New Note
Type
âšī¸ Info
đ Bug
⨠Feature Request
đĄ Improvement
â Missing Feature
đ¨ Design Changes
Title (optional)
Note Content
đ Add Note