Переработка под iptvc
This commit is contained in:
@@ -1,4 +1,9 @@
|
||||
<?php
|
||||
/*
|
||||
* Copyright (c) 2025, Антон Аксенов
|
||||
* This file is part of iptv.axenov.dev web interface
|
||||
* MIT License: https://git.axenov.dev/IPTV/web/src/branch/master/LICENSE
|
||||
*/
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
@@ -6,9 +11,9 @@ return [
|
||||
'base_url' => env('APP_URL', 'http://localhost:8080'),
|
||||
'debug' => bool(env('APP_DEBUG', false)),
|
||||
'env' => env('APP_ENV', env('IPTV_ENV', 'prod')),
|
||||
'title' => env('APP_TITLE', 'IPTV Плейлисты'),
|
||||
'user_agent' => env('USER_AGENT'),
|
||||
'page_size' => (int)env('PAGE_SIZE', 10),
|
||||
'title' => 'IPTV Плейлисты',
|
||||
'timezone' => env('APP_TIMEZONE', 'UTC'),
|
||||
'page_size' => int(env('PAGE_SIZE', 10)),
|
||||
'pls_encodings' => [
|
||||
'UTF-8',
|
||||
'CP1251',
|
||||
|
||||
16
config/cache.php
Normal file
16
config/cache.php
Normal file
@@ -0,0 +1,16 @@
|
||||
<?php
|
||||
/*
|
||||
* Copyright (c) 2025, Антон Аксенов
|
||||
* This file is part of iptv.axenov.dev web interface
|
||||
* MIT License: https://git.axenov.dev/IPTV/web/src/branch/master/LICENSE
|
||||
*/
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
return [
|
||||
'host' => env('CACHE_HOST', 'keydb'),
|
||||
'port' => int(env('CACHE_PORT', 6379)),
|
||||
'password' => env('CACHE_PASSWORD'),
|
||||
'db' => int(env('CACHE_DB', 0)),
|
||||
'ttl' => int(env('CACHE_TTL', 600)),
|
||||
];
|
||||
29
config/http.php
Normal file
29
config/http.php
Normal file
@@ -0,0 +1,29 @@
|
||||
<?php
|
||||
/*
|
||||
* Copyright (c) 2025, Антон Аксенов
|
||||
* This file is part of iptv.axenov.dev web interface
|
||||
* MIT License: https://git.axenov.dev/IPTV/web/src/branch/master/LICENSE
|
||||
*/
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
/**
|
||||
* @see https://docs.guzzlephp.org/en/stable/request-options.html
|
||||
*/
|
||||
return [
|
||||
'base_url' => env('APP_URL', 'http://localhost:8080'),
|
||||
'timeout' => 25,
|
||||
'connect_timeout' => 7,
|
||||
'http_errors' => true,
|
||||
'synchronous' => false,
|
||||
'headers' => [
|
||||
'User-Agent' => env('USER_AGENT'),
|
||||
],
|
||||
'allow_redirects' => [
|
||||
'max' => 5,
|
||||
'strict' => false,
|
||||
'referer' => false,
|
||||
'protocols' => ['http', 'https'],
|
||||
'track_redirects' => false
|
||||
]
|
||||
];
|
||||
@@ -1,11 +0,0 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
return [
|
||||
'host' => env('REDIS_HOST', 'keydb'),
|
||||
'port' => (int)env('REDIS_PORT', 6379),
|
||||
'password' => env('REDIS_PASSWORD'),
|
||||
'db' => (int)env('REDIS_DB', 0),
|
||||
'ttl_days' => (int)env('REDIS_TTL_DAYS', 14) * 60 * 60 * 24, // 2 недели
|
||||
];
|
||||
@@ -1,10 +1,21 @@
|
||||
<?php
|
||||
/*
|
||||
* Copyright (c) 2025, Антон Аксенов
|
||||
* This file is part of iptv.axenov.dev web interface
|
||||
* MIT License: https://git.axenov.dev/IPTV/web/src/branch/master/LICENSE
|
||||
*/
|
||||
|
||||
use App\Controllers\ApiController;
|
||||
use App\Controllers\BasicController;
|
||||
use App\Controllers\WebController;
|
||||
|
||||
return [
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
| Web routes
|
||||
|--------------------------------------------------------------------------
|
||||
*/
|
||||
|
||||
[
|
||||
'method' => 'GET',
|
||||
'path' => '/[page/{page:[0-9]+}]',
|
||||
@@ -19,13 +30,7 @@ return [
|
||||
],
|
||||
[
|
||||
'method' => 'GET',
|
||||
'path' => '/logo',
|
||||
'handler' => [WebController::class, 'logo'],
|
||||
'name' => 'logo',
|
||||
],
|
||||
[
|
||||
'method' => 'GET',
|
||||
'path' => '/{code:[0-9a-zA-Z]+}',
|
||||
'path' => '/{code:[0-9a-zA-Z]+}[.m3u[8]]',
|
||||
'handler' => [WebController::class, 'redirect'],
|
||||
'name' => 'redirect',
|
||||
],
|
||||
@@ -35,18 +40,43 @@ return [
|
||||
'handler' => [WebController::class, 'details'],
|
||||
'name' => 'details',
|
||||
],
|
||||
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
| API routes
|
||||
|--------------------------------------------------------------------------
|
||||
*/
|
||||
|
||||
[
|
||||
'method' => 'GET',
|
||||
'path' => '/{code:[0-9a-zA-Z]+}/json',
|
||||
'handler' => [ApiController::class, 'json'],
|
||||
'name' => 'json',
|
||||
],
|
||||
[
|
||||
'method' => 'GET',
|
||||
'path' => '/{code:[0-9a-zA-Z]+}/qrcode',
|
||||
'handler' => [ApiController::class, 'makeQrCode'],
|
||||
'name' => 'api::makeQrCode',
|
||||
],
|
||||
// [
|
||||
// 'method' => 'GET',
|
||||
// 'path' => '/{code:[0-9a-zA-Z]+}/logo/{hash:[0-9a-z]+}',
|
||||
// 'handler' => [ApiController::class, 'logo'],
|
||||
// 'name' => 'api::getChannelLogo',
|
||||
// ],
|
||||
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
| Other routes
|
||||
|--------------------------------------------------------------------------
|
||||
*/
|
||||
|
||||
[
|
||||
'method' => '*',
|
||||
'path' => '/{path:.*}',
|
||||
'handler' => [BasicController::class, 'notFound'],
|
||||
'name' => 'not-found',
|
||||
],
|
||||
// ...
|
||||
];
|
||||
|
||||
|
||||
@@ -1,8 +1,13 @@
|
||||
<?php
|
||||
/*
|
||||
* Copyright (c) 2025, Антон Аксенов
|
||||
* This file is part of iptv.axenov.dev web interface
|
||||
* MIT License: https://git.axenov.dev/IPTV/web/src/branch/master/LICENSE
|
||||
*/
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
return [
|
||||
'cache' => bool(env('TWIG_USE_CACHE', true)) ? cache_path() . '/views' : false,
|
||||
'debug' => bool(env('TWIG_DEBUG', false)),
|
||||
'debug' => bool(env('APP_DEBUG', false)),
|
||||
];
|
||||
|
||||
Reference in New Issue
Block a user