archive-ccc8458/video/lib/config.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
<?php
declare(strict_types=1);
// Absolute path to the password file. Place it one level ABOVE public_html
// so it can't be served over the web.
const PASSWORD_FILE = '/home/u122345/domains/yourwebsite.com/video-password.php';
const VIDEO_DIR = __DIR__ . '/../videos';
const VIDEO_URL = '/video/videos';
const SITE_BASE = 'https://yourwebsite.com';
const MAX_UPLOAD_BYTES = 100 * 1024 * 1024; // 100 MB
const ALLOWED_TYPES = [
'video/mp4' => 'mp4',
'video/webm' => 'webm',
'video/quicktime' => 'mov',
'video/x-matroska' => 'mkv',
];
const ALLOWED_THUMB_TYPES = [
'image/jpeg' => 'jpg',
'image/png' => 'png',
'image/webp' => 'webp',
];
const MAX_THUMB_BYTES = 5 * 1024 * 1024; // 5 MB
// Chunked-upload limits. Total file may exceed MAX_UPLOAD_BYTES; per-chunk size
// must fit within Hostinger's post_max_size / upload_max_filesize.
const MAX_CHUNKED_BYTES = 2 * 1024 * 1024 * 1024; // 2 GB reassembled
const MAX_CHUNK_BYTES = 16 * 1024 * 1024; // 16 MB per chunk
const MAX_CHUNKS = 100000; // sanity cap on chunk count
const UPLOAD_TTL_SEC = 24 * 3600; // partial uploads cleaned up after this
const RATE_LIMIT_DIR = __DIR__ . '/../.ratelimit';
const RATE_LIMIT_MAX = 5;
const RATE_LIMIT_WINDOW = 900; // 15 min lockout after MAX failures