43 lines
1.0 KiB
PHP
43 lines
1.0 KiB
PHP
|
|
<?php
|
||
|
|
/**
|
||
|
|
* Multi-User Transcription Server - Configuration
|
||
|
|
*
|
||
|
|
* Simple PHP server for merging transcriptions from multiple clients
|
||
|
|
*/
|
||
|
|
|
||
|
|
// Session configuration
|
||
|
|
define('SESSION_LIFETIME', 3600); // 1 hour
|
||
|
|
define('MAX_TRANSCRIPTIONS_PER_ROOM', 100);
|
||
|
|
|
||
|
|
// Storage directory (must be writable by PHP)
|
||
|
|
define('STORAGE_DIR', __DIR__ . '/data');
|
||
|
|
|
||
|
|
// Enable CORS for cross-origin requests (if needed)
|
||
|
|
define('ENABLE_CORS', true);
|
||
|
|
|
||
|
|
// Cleanup old sessions older than this (seconds)
|
||
|
|
define('CLEANUP_THRESHOLD', 7200); // 2 hours
|
||
|
|
|
||
|
|
// Initialize storage directory
|
||
|
|
if (!file_exists(STORAGE_DIR)) {
|
||
|
|
mkdir(STORAGE_DIR, 0755, true);
|
||
|
|
}
|
||
|
|
|
||
|
|
// Security headers
|
||
|
|
header('X-Content-Type-Options: nosniff');
|
||
|
|
header('X-Frame-Options: SAMEORIGIN');
|
||
|
|
|
||
|
|
// CORS headers (if enabled)
|
||
|
|
if (ENABLE_CORS) {
|
||
|
|
header('Access-Control-Allow-Origin: *');
|
||
|
|
header('Access-Control-Allow-Methods: GET, POST, OPTIONS');
|
||
|
|
header('Access-Control-Allow-Headers: Content-Type');
|
||
|
|
}
|
||
|
|
|
||
|
|
// Handle preflight requests
|
||
|
|
if ($_SERVER['REQUEST_METHOD'] === 'OPTIONS') {
|
||
|
|
http_response_code(200);
|
||
|
|
exit();
|
||
|
|
}
|
||
|
|
?>
|