feat: Add complete Docker deployment with web-based setup wizard
Major additions: - Web-based setup wizard (setup.php, setup_wizard.php, setup-wizard.js) - Production Docker configuration (docker-compose.prod.yml, .env.production) - Database initialization SQL files (deploy/init_settings.sql) - Template builder system with drag-and-drop UI - Advanced features (OAuth, CDN, enhanced analytics, monetization) - Comprehensive documentation (deployment guides, quick start, feature docs) - Design system with accessibility and responsive layout - Deployment automation scripts (deploy.ps1, generate-secrets.ps1) Setup wizard allows customization of: - Platform name and branding - Domain configuration - Membership tiers and pricing - Admin credentials - Feature toggles Database includes 270+ tables for complete video streaming platform with advanced features for analytics, moderation, template building, and monetization. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
@@ -71,15 +71,19 @@ class VDatabase
|
||||
{
|
||||
// Add your actual table names here
|
||||
$allowedTables = [
|
||||
'db_settings', 'db_conversion', 'db_videofiles', 'db_livefiles',
|
||||
'db_settings', 'db_conversion', 'db_videofiles', 'db_livefiles',
|
||||
'db_accountuser', 'db_trackactivity', 'db_imagefiles', 'db_audiofiles',
|
||||
'db_documentfiles', 'db_blogfiles', 'db_comments', 'db_responses',
|
||||
'db_playlists', 'db_subscriptions', 'db_categories', 'db_channels',
|
||||
'db_users', 'db_sessions', 'db_ip_tracking', 'db_banlist',
|
||||
'db_fingerprints', 'db_fingerprint_bans', 'db_email_log',
|
||||
'db_users', 'db_sessions', 'db_ip_tracking', 'db_banlist',
|
||||
'db_fingerprints', 'db_fingerprint_bans', 'db_email_log',
|
||||
'db_notifications', 'db_user_preferences', 'db_password_resets',
|
||||
'db_logs', 'db_shortfiles', 'db_memberships', 'db_tokens',
|
||||
'db_affiliates', 'db_advertising', 'db_servers', 'db_streaming'
|
||||
'db_affiliates', 'db_advertising', 'db_servers', 'db_streaming',
|
||||
// Template Builder tables
|
||||
'db_templatebuilder_templates', 'db_templatebuilder_components',
|
||||
'db_templatebuilder_assignments', 'db_templatebuilder_versions',
|
||||
'db_templatebuilder_user_prefs', 'db_notifications_count'
|
||||
];
|
||||
return in_array($table, $allowedTables);
|
||||
}
|
||||
@@ -453,4 +457,66 @@ class VDatabase
|
||||
|
||||
return $rows;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sanitize input for database queries
|
||||
* @param mixed $input Input to sanitize
|
||||
* @return string Sanitized input
|
||||
*/
|
||||
public static function sanitizeInput($input)
|
||||
{
|
||||
global $db;
|
||||
|
||||
if (is_null($input)) {
|
||||
return '';
|
||||
}
|
||||
|
||||
if (is_array($input)) {
|
||||
return array_map([__CLASS__, 'sanitizeInput'], $input);
|
||||
}
|
||||
|
||||
// Remove any potential SQL injection characters
|
||||
$input = strip_tags($input);
|
||||
$input = htmlspecialchars($input, ENT_QUOTES, 'UTF-8');
|
||||
|
||||
// Use ADOdb's qstr method if available
|
||||
if (isset($db) && method_exists($db, 'qstr')) {
|
||||
return substr($db->qstr($input), 1, -1); // Remove surrounding quotes
|
||||
}
|
||||
|
||||
// Fallback: basic escaping
|
||||
return addslashes($input);
|
||||
}
|
||||
|
||||
/**
|
||||
* Build INSERT/UPDATE SET clause from associative array
|
||||
* @param array $data Associative array of field => value pairs
|
||||
* @return string SET clause for SQL query
|
||||
*/
|
||||
public static function build_insert_update($data)
|
||||
{
|
||||
if (!is_array($data) || empty($data)) {
|
||||
return '';
|
||||
}
|
||||
|
||||
$parts = [];
|
||||
foreach ($data as $field => $value) {
|
||||
// Validate field name
|
||||
if (!preg_match('/^[a-zA-Z_][a-zA-Z0-9_]*$/', $field)) {
|
||||
continue; // Skip invalid field names
|
||||
}
|
||||
|
||||
// Handle different value types
|
||||
if (is_null($value)) {
|
||||
$parts[] = "`{$field}` = NULL";
|
||||
} elseif (is_int($value) || is_float($value)) {
|
||||
$parts[] = "`{$field}` = " . $value;
|
||||
} else {
|
||||
$sanitized = self::sanitizeInput($value);
|
||||
$parts[] = "`{$field}` = '{$sanitized}'";
|
||||
}
|
||||
}
|
||||
|
||||
return implode(', ', $parts);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user