Commit Graph
47 Commits
Author SHA1 Message Date
Divarion_D b14ba6ff96 docs(tools): document the full CLI in stream_queue_check.py header
The header's Usage block only listed --duration/--json/--ua; expand it to the
complete run command, every argparse option (--stall-timeout, --tolerance,
--live, --prebuffer, --buffer-target, --no-color) with defaults, and a couple
more examples. Matches `--help` 1:1. No code change.
2026-08-09 20:04:06 +03:00
Divarion_D 7f3812e165 chore(build): move phpstan / php-cs-fixer config out of the repo root
Relocate the dev-tooling config into build/ so the project root only holds
source and first-class project files:
- phpstan.dist.neon        -> build/phpstan.dist.neon
- phpstan-baseline.neon    -> build/phpstan-baseline.neon
- .php-cs-fixer.dist.php    -> build/.php-cs-fixer.dist.php
- .php-cs-fixer.cache       -> build/ (regenerated there; gitignored)

Because neon/CS-Fixer resolve relative paths against the config file's own
directory, the internal references are re-anchored one level up (src/ ->
../src/, tools/ -> ../tools/, Finder in(__DIR__.'/../src'); the baseline's
path: entries likewise). The Makefile now points PHPStan at the config with
-c build/phpstan.dist.neon (it previously relied on root auto-discovery),
generates the baseline into build/, and passes --config=build/... to CS-Fixer;
the CS-Fixer cache is pinned to build/ via setCacheFile and re-gitignored.

No behaviour change. Verified: make phpstan (No errors), make cs (0 fixable),
make gates. CI runs through these make targets, so it is covered.
2026-08-09 19:37:11 +03:00
Divarion_D 8147c2c0f6 docs(tools): add tools/README index documenting every utility
Documents each tool in tools/ and its purpose, grouped by role: CI gates,
PHPStan support, the PHPUnit runner, manual panel test/QA utilities
(test_player_api.sh, stream_queue_check.py, test-stream-generator,
dts-audio-test, test-install), and repo maintenance
(update_top_contributors.py). Makes the previously-unreferenced manual test
utilities discoverable.
2026-08-07 21:08:15 +03:00
Divarion_D 11a72afdd2 docs(tools): fix stale autoload.php ref and drop real IP from example
- tools/test-install/README.md listed /home/xc_vm/autoload.php among the
  post-install sanity files, but src/autoload.php was removed at the Composer
  migration; the shipped autoloader is vendor/autoload.php.
- tools/stream_queue_check.py had a real server IP (45.90.13.217) in a usage
  example; replaced with a "host" placeholder.
2026-08-07 21:03:57 +03:00
Divarion_D cc212c051b fix(ci): correct check_procedural_use skip path to Infrastructure/Tmdb/lib
The skip list keyed on /Modules/tmdb/lib/, which matches nothing: there is no
src/Modules/tmdb* dir, and the vendored non-namespaced TMDB library lives at
src/Infrastructure/Tmdb/lib/. So the intended skip was dead and that library
was being scanned. Point the skip at the real path. Gate still passes
(411 migrated classes, no violations).
2026-08-07 21:03:57 +03:00
Divarion_D cb056cdcf5 fix(phpstan): wire constants-stub regen into make, refresh drifted stub
gen-constants-stub.php had no Makefile/CI target, so tools/phpstan/
constants.stub.php (a bootstrapFile in phpstan.dist.neon) silently drifted:
regenerating it added DB_ACCESS_PWD and GIT_REPO_PROXY (real runtime define()s
in src/Core/Config/AppConfig.php that PHPStan could not see). Added `make
phpstan-stub` so the stub is regenerable/discoverable, and refreshed it
(129 -> 131 constants).
2026-08-07 21:03:42 +03:00
Divarion_D 24736873f6 chore(phpstan): correct stale "no Composer/PSR-4" bootstrap comments
phpstan-bootstrap.php and phpstan.dist.neon claimed the project "has no
Composer and no PSR-4 namespaces" and referenced the removed src/autoload.php
— both false since the Composer PSR-4 migration (and self-contradicted by the
neon's own excludePaths note about src/vendor/autoload.php). Comment-only:
they now state the bootstrap defines constants and deliberately wires no
project autoloader (PHPStan discovers symbols via paths + scanDirectories).
No behavior change.
2026-08-07 20:51:02 +03:00
Divarion_D 2466ddfc3e chore(tools): remove orphaned gen-module-hashes.php
The script was never wired up (no `make module-hashes` target, no CI/Makefile
caller). Module hash_id generation now lives in the standalone Module_Template
kit; for existing modules, generate inline with
`php -r 'echo bin2hex(random_bytes(16));'`.

Updated the module-dev docs (en + ru) that referenced the removed script /
non-existent `make module-hashes` target to use the one-liner.
2026-08-07 20:49:36 +03:00
Divarion_D 6d6aa6652e feat(tools): add stream_queue_check.py queue-integrity monitor
Standalone Python (stdlib-only) tool that verifies a stream delivers
segments correctly and its delivery queue does not break:

- HLS: EXT-X-MEDIA-SEQUENCE contiguity, no dropped/rewound segments, no
  EXT-X-DISCONTINUITY, every newly appearing segment downloadable.
- MPEG-TS: per-PID continuity_counter, sync-byte loss, TEI, delivery stalls,
  with a --tolerance for rare source glitches relayed by -c copy.
- --live: colored TUI dashboard modelling a virtual player — received
  timeline from PCR (TS) / EXTINF (HLS), playhead, and buffered cache
  seconds graphed over time.

Documented in docs/{en,ru}/development/streaming-subsystem.md.
2026-08-06 21:22:33 +03:00
Divarion-D 29c014102b feat(dts-audio-test): add scripts for testing DTS/AC3 audio and generating problematic streams 2026-07-10 13:14:04 +03:00
Divarion-D 6de8ab7d9f feat(modules): add permanent hash_id generator script
tools/gen-module-hashes.php ensures every module.json carries a stable,
immutable hash_id (random 32-hex, generated once). Idempotent: modules that
already have a hash_id are untouched; new ones get it inserted after "name",
preserving file formatting. Run directly (php tools/gen-module-hashes.php).
2026-07-03 20:10:33 +03:00
Divarion-D 159ae3e9c8 feat(stream_server): add QuietThreadingHTTPServer to handle client disconnects gracefully 2026-06-28 14:26:02 +03:00
Divarion-D bd0c492867 feat(tests): add test stream generator for MP4 to HTTP-served streams 2026-06-28 12:04:39 +03:00
Divarion-D f88be578e9 chore(tools): remove unused test_redis.php
Standalone Redis diagnostic script with no references anywhere in the repo
  (run only ad-hoc on a server). No longer needed; removed.
2026-06-26 19:05:20 +03:00
Divarion-D bdad6e5406 chore(tools): remove unused install_xdebug.sh
Standalone xdebug installer helper that nothing references (not wired into
  Makefile, CI, docs or any script) and is no longer needed. No other changes —
  it had zero references in the repo.
2026-06-26 19:02:26 +03:00
Divarion-D 07d536ed10 chore(tools): remove php_syntax_check.sh — covered by PHPStan/CS/PHPUnit
`php -l` syntax checking is redundant with the real linters/validators (PHPStan
  parses the code, PHP-CS-Fixer and the PHPUnit bootstrap also fail on parse
  errors). Remove the script and every reference to it:

  - Makefile: drop the `syntax_check` target and its .PHONY entry.
  - CI (ci.yml): drop the dedicated `lint` (PHP Syntax Check) job.
  - Release workflows (build-release, build_pre-release): drop the "Check syntax"
    step from the Quality Gate (PHPUnit remains).
  - CONTRIBUTING.md: replace the syntax-check pre-commit guidance with the real
    checks (make dev-tools / phpstan / cs / gates / phpunit).
  - updates_checklist (en/ru): replace `make syntax_check` with the quality-check
    suite and drop the stale "Security scan" snippet that referenced the removed
    script and a non-existent tools/run_scan.sh (Semgrep runs automatically in CI).
2026-06-26 18:59:38 +03:00
Divarion-D aa7befa375 build: gitignore dev packages under vendor + harden the prod-only gate
Belt-and-suspenders so dev packages can never land in git:

- .gitignore: whitelist the committed production set under src/vendor/ and ignore
  everything else (src/vendor/* + !autoload.php/!chrisyue/!composer/!gemorroj,
  then re-ignore composer/{pcre,semver,xdebug-handler,autoload_files.php}). A
  local `composer install` (for PHPStan/PHP-CS-Fixer) now writes dev packages
  into ignored paths, so `git add` can never stage them. gitignore never
  untracks, so the committed prod files stay tracked and updatable; a NEW prod
  dep just needs a `!` whitelist line.
- check-vendor-prod-only.sh: add a second check on the committed
  vendor/composer/installed.json — it must list no dev package. This covers the
  one thing .gitignore cannot: installed.json is a tracked file that
  `composer install` rewrites with dev entries. Both checks read the git INDEX,
  so a local dev install does not trip the gate, but a committed dev artifact does.

Verified: clean tree passes; a dev `composer install` in the working tree leaves
the gate green (index-based); a fabricated dev installed.json is detected; no dev
dir is stageable after `composer install`.
2026-06-25 21:59:46 +03:00
Divarion-D baf6c8e231 build: ship a production-only vendor; install dev tools via Composer
Switch from "commit vendor with dev deps + strip at release" to the standard
application model: the committed src/vendor/ is PRODUCTION-ONLY, and dev tooling
(PHPStan, PHP-CS-Fixer + ~37 transitive deps) is installed on demand with
"composer install".

- Regenerate the committed src/vendor/ via "composer install --no-dev"
  (34 MB -> ~0.5 MB; only the Composer autoloader + gemorroj/m3u-parser +
  chrisyue/php-m3u8 remain). This also stops PHPStan\PharAutoloader registering
  in production.
- Commit src/composer.lock (un-ignored) — this is an application, so the lock is
  committed to make "composer install" reproducible across dev/CI.
- Revert the release-time strip step (Makefile hooks + tools/build/
  strip-dev-vendor.sh) — no longer needed; the archive ships the prod vendor as-is.
- CI: the phpstan and code-style jobs now run "composer install --working-dir=src"
  (with tools: composer) to obtain the dev tools before running.
- New gate tools/ci/check-vendor-prod-only.sh (+ make check-vendor-prod-only,
  wired into "make gates"): asserts no require-dev package from composer.lock is
  committed under src/vendor/ — guards against accidentally committing a
  dev-bloated vendor. Inspects git-tracked files, so it is correct even in a CI
  job that already ran "composer install".
- Fix verify-lb-archive.sh: LB legitimately ships most of Cli/Commands and
  Cli/CronJobs (edge commands + certbot/cache/cleanup crons), so flag only the
  genuinely privileged dirs + the specific install/root files, not the whole dirs.
- .gitignore / composer.json notes updated.

Verified before pruning: PHPStan no errors, PHPUnit 303, cs + gates green. After
pruning: PHPUnit 303 (prod-only vendor), all three gates green. Local dev tools
restored afterwards with "composer install" (not committed).
2026-06-25 21:51:13 +03:00
Divarion-D 0165b595d5 build: strip Composer dev dependencies from release archives
The committed src/vendor/ carries require-dev packages (PHPStan, PHP-CS-Fixer +
their transitive symfony/react/psr deps, ~33 MB) so they are available for local
dev and CI. They must not ship to production — besides the weight, PHPStan's
files-autoload registers PHPStan\PharAutoloader at runtime on every request.

Add tools/build/strip-dev-vendor.sh and hook it into both `make main` and
`make lb` right after the file-copy step (before archiving). It runs against the
staged TEMP_DIR, not the repo:
- removes every dev package dir listed in vendor/composer/installed.json
  (dev-package-names) and their bin shims;
- regenerates the autoloader with `composer dump-autoload --no-dev` (drops the
  dev files-autoload, incl. the PharAutoloader);
- prunes the emptied vendor namespace dirs.
LB does not stage composer.json (not in LB_ROOT_FILES); the script copies it in
so dump-autoload can run (harmless metadata in the LB archive).

Result: shipped vendor/ goes 34 MB -> ~0.8 MB, contains only the Composer
autoloader + the two prod packages (gemorroj/m3u-parser, chrisyue/php-m3u8);
M3uParser/Chrisyue still autoload and no PharAutoloader is registered. The
committed src/vendor/ is left untouched (dev tooling stays for local use).
2026-06-25 21:34:32 +03:00
Divarion-D e9bc5de0e4 test/ci(psr4): add the missing migration regression gates
Adds the automated gates the PSR-4 plan specified but that were verified only
manually per phase:

PHPUnit (run by the existing test job):
- AutoloadOrderTest      — Composer autoloader registered; the retired
                           XC_Autoloader scanner is NOT in the SPL stack; init()
                           is a no-op; no igbinary class-map cache is written.
- BootstrapPathsTest     — no live require/include points at a lowercase renamed
                           dir (the Фаза-1 grep-gate, as a runtime guard).
- ConsoleDiscoveryTest   — console.php FQCN discovery resolves every Cli command
                           file and the concrete command surface stays stable.

Shell gates (new 'PSR-4 Regression Gates' CI job + 'make gates'):
- tools/ci/check_procedural_use.php — procedural/view files must import every
  migrated class they use, with the `use` ABOVE the usage (PHP imports are
  positional). Runs with short_open_tag=1 so short-tag templates are analysed.
- tools/ci/verify-lb-archive.sh — reproduces the Makefile LB file selection from
  the real LB_* vars and asserts no privileged tree (Admin/Reseller/Player
  controllers, Domain/User|Device, Cli/CronJobs|Commands) ships to an LB node
  (security blocker 1).

Makefile: cs/cs-fix now force short_open_tag=1; new print-%, check-procedural-use,
verify-lb-archive and aggregate `gates` targets.
2026-06-25 20:57:53 +03:00
Divarion-D 66ecbc8cbc fix(phpstan): fix real bugs (return contracts, arg/byref, stub types) 599→585
- constants stub: use mt_rand()-based exprs so PHPStan infers GENERAL types,
  not literal 0/'' — fixes false division-by-zero (PACKET_SIZE) and
  foreach-over-false (str_split with len 0). Load stub via bootstrapFiles so
  result-cache invalidates on change.
- return contracts: explicit returns where a path fell through to null and
  violated the declared type:
  - StreamRepository::getById/getWatchFolder, GroupService::getById,
    getStream() → return false (declared array|false).
  - ServerRepository::getPublicURL → return '' when server missing (array→string).
  - MagService::resetSTB → return query() result (declared bool).
  - StreamUtils::getPlaylistSegments → explicit return null.
  - NetworkUtils::stopDownload → @return null corrected to @return void.
- PlexController: getPlexToken() called with 5 args but accepts 4 — dropped
  the dead 5th argument.
- DropboxClient::getMetaFromHeaders: array_shift() on an array_filter()
  expression (not a variable, by-ref error) — assign to a var first.
- WatchdogCommand: wrap numeric-string subtractions (nginx/proc-stat values)
  in floatval()/intval().
2026-06-23 20:02:46 +03:00
Divarion-D b9e911e7e8 fix(phpstan): resolve false positives and real bugs (988 → 622)
Systemic fixes (cascade across modules):
- Type `$db` params as \DatabaseHandler in 38 files (was `object`), so
  PHPStan resolves get_row()/query() and stops inferring closed array
  shapes — clears offsetAccess.notFound clusters.
- Database/DatabaseHandler: correct get_row()/clean_row() PHPDoc to
  array<string,mixed>, and query() $buffered param to mixed (it is the
  first positional bind value via func_get_args, not a bool flag).
- constants stub generator: explicit type overrides (HOST/PAGE_NAME →
  string, PHP_ERRORS → bool) to avoid null/mixed false positives.
- phpstan.dist.neon: scanFiles autoload.php/bootstrap.php; ignore
  unactionable FPs (dynamic require paths, proprietary XC_VM ioncube
  class, MaxMind vendor lib, ext-inotify stub gap).

Real bugs fixed:
- streaming/ConnectionLimiter: appended the whole accumulated UUID array
  instead of a single uuid, breaking per-stream temp-file cleanup.
- streaming/TimeshiftClient: dead `|| $x == 3` branch (always redundant).
- streaming/AsyncFileOperations: redundant is_array after === false.
- core/Storage/DropboxClient: @param callback → callable|null.

streaming module is clean (0 errors); infrastructure 39 → 27.
2026-06-23 19:46:33 +03:00
Divarion-D 69669d8e1c feat(phpstan): add PHPStan static analysis setup and constants stub generation 2026-06-23 19:28:45 +03:00
Divarion-D 4a0501324c feat(modules): evolve module system to extensible platform architecture
TASK-000: Remove legacy core patching system
- Delete src/core/Module/CoreCodePatcher.php
- Delete src/core/Module/CoreCodePatchableModuleInterface.php

TASK-001: Split ModuleInterface into specialized provider interfaces
- Add ServiceProviderInterface (boot, getEventSubscribers)
- Add RouteProviderInterface (registerRoutes)
- Add CommandProviderInterface (registerCommands)
- Add NavbarProviderInterface (registerNavbar)
- Add StreamMiddlewareProviderInterface
- ModuleLoader::bootAll() detects supported providers via instanceof

TASK-002: Refactor EventDispatcher
- Add ListenerProvider with priority support
- Add AbstractEvent base class
- Add StoppableEventInterface support
- Preserve legacy subscribe/publish API compatibility

TASK-003: Extend ServiceContainer
- Add ServiceContainer::decorate()
- Support priority-based decorator chains
- Add protected service registry:
  - db
  - settings
  - config
  - auth

TASK-004: Add core event catalog
- ModuleLoadedEvent
- ModuleBootedEvent
- PackageInstalledEvent
- UserAuthenticatedEvent
- UserLoggedOutEvent
- StreamStartingEvent
- StreamStartedEvent
- StreamStoppedEvent
- SettingsChangedEvent

TASK-005: Formalize subsystem boundaries
- Add BoundaryInterface
- Add MinistraBootstrap implementation
- Define exported service contracts

TASK-006: Add stream middleware pipeline
- Add StreamContext
- Add StreamMiddlewareInterface
- Add StreamPipeline
- Support middleware priority ordering

TASK-007: Add module hot reload
- Dispatch PackageInstalledEvent after installation
- Add ModuleManager::hotReload()
- Load and boot newly installed modules without service restart

TASK-008: Standardize container contracts
- Add container interfaces:
  - ContainerInterface
  - ContainerExceptionInterface
  - NotFoundExceptionInterface
- Add NotFoundException implementation
- ServiceContainer::get() throws NotFoundException

TASK-009: Refactor navbar registration
- CoreNavbarProvider implements NavbarProviderInterface
- Add registerNavbar() instance method
- ModuleLoader uses provider-based registration

TASK-010: Add module priority support
- Add priority field to module.json
- Default value: 0
- Higher priority modules load earlier
- Resolve load order by:
  1. Priority DESC
  2. Module name ASC

TASK-011: Add optional dependencies
- Add optional_dependencies field to module.json
- Missing optional dependencies do not block module loading
- Process optional dependencies after required dependencies

Tests
- Add ServiceContainer tests
- Add EventDispatcher tests
- Add StreamPipeline tests
- Add ModuleLoader priority tests

Documentation
- Rewrite module architecture documentation
- Update examples and extension development guides
- Document lifecycle, events, services, middleware, and dependencies
2026-06-14 14:25:19 +03:00
Divarion-D 4d0e256b0c fix: improve URL construction in ImageResizeService and refactor syntax check script 2026-04-28 19:56:39 +03:00
Divarion-D 235547168a feat: enhance installation process with dynamic port configuration and database updates 2026-04-21 21:48:10 +03:00
Divarion-D 17c7a16f78 refactor: streamline Docker installation process and update documentation 2026-04-18 18:09:12 +03:00
Divarion-D a81ada07bd chore(test-install): update test container to Ubuntu 24.04
- Base image: ubuntu:22.04 → ubuntu:24.04
- Remove python3-pip (not needed)
- Update README
2026-04-14 18:14:02 +03:00
Divarion-D d22b47bb65 feat(contributors): update the contributors table with new data and improve the update script 2026-04-11 22:08:14 +03:00
Divarion-D fb2bd8129c feat(tools): add Redis diagnostics tool 2026-04-11 22:06:04 +03:00
Divarion-D 6cc892f9a7 refactor: eliminate proxy functions, migrate to direct class method calls
312 files changed, 2866 insertions(+), 24110 deletions(-)

Proxy function replacements (130+ functions):
- goHome() -> AdminHelpers::goHome()
- checkPermissions() -> PageAuthorization::checkPermissions()
- getBouquet/getCategory/etc -> Service::getById()
- deleteStream/deleteLine/etc -> Repository/Service::delete()
- APIRequest/systemapirequest -> ApiClient::request/systemRequest()
- prepareArray/preparecolumn -> QueryHelper methods
- confirmIDs/parserelease/etc -> AdminHelpers methods
- getSettings/clearSettingsCache -> SettingsManager methods
- destroySession -> SessionManager::clearContext()
- getMag/getEnigma/deleteMAG/etc -> MagService/EnigmaService
- getSeriesTrailer/getMovieTMDB/etc -> TMDbService methods

Removed legacy files:
- src/includes/admin.php (main proxy hub)
- src/includes/libs/ (35+ files moved to core/modules)
- src/includes/python/ (moved to bin/python)
- src/includes/api/ (moved to Controllers)
- src/includes/ts.php, reseller_api.php
- src/infrastructure/legacy/admin_proxies.php
- tools/run_scan.sh, update_redis_conf.sh

Additional fixes:
- SQL query placeholder migration (BouquetService, CategoryService)
- PHP 8.x null-safe access (live.php, server_view.php, stream.php)
- TmdbCron: extracted variable for repeated similar_text calls
2026-04-09 21:24:48 +03:00
Divarion-D 07789f7a33 Rename test_installer to install 2026-04-07 19:55:28 +03:00
Divarion-D 34cd31483e chore: auto_install.sh — switch from install to test_installer 2026-04-07 19:49:19 +03:00
Divarion-D f1a5909124 chore: misc fixes — m3u improvements, review page update, cleanup add_headers
- m3u.php: minor output improvements
- review.php: admin view updates
- Remove obsolete tools/add_headers.php
- test_release.sh: extend sync logic
2026-04-06 18:44:05 +03:00
Divarion-D 453e233352 fix(cron): fix post-install errors in cron jobs and watchdog
- Encryption::generateUniqueCode(): null-coalesce $pass to prevent
  md5(null) deprecation when live_streaming_pass is not yet set
- CacheCronJob: mkdir() with 0755 perms, recursive flag, and
  chown to xc_vm user — fixes Permission denied on tmp/cache/*
- WatchdogCommand: null-safe decode of watchdog_data — fixes
  array offset on null when server has no watchdog history
- ConnectionTracker: guard file_put_contents with is_dir() check
  to prevent writes when CACHE_TMP_PATH does not exist yet
- Dockerfile: install cron package and enable cron.service for
  systemd-based test container
2026-04-06 16:19:09 +03:00
Divarion-D 738973c5db docs(php): add standardized file headers across codebase
- Add @author, @copyright, @link, @version, @license to 399 PHP files
- MERGE mode: inject metadata into 243 existing docblocks (preserving docs)
- INSERT mode: create new docblocks for 156 files without headers
- Skip 3 files that already had correct headers
- Exclude third-party libs (TMDb, mobiledetect, Dropbox, etc.)
- Exclude bin/, ministra/, content/, tmp/, resources/, module views
- Update tools/add_headers.php to v2 with MERGE strategy
2026-04-05 22:38:36 +03:00
Divarion-D 8c552fc1ba feat(tools): add Redis config update script for existing installations 2026-04-05 22:09:22 +03:00
Divarion-D ae67de906e chore: remove build_ffmpeg.sh (moved to XC_VM_Binaries)
Script relocated to https://github.com/Vateron-Media/XC_VM_Binaries
2026-03-18 20:33:25 +03:00
Divarion-D a113fb3ec9 refactor: remove legacy proxy files, migrate all callers to console.php
- Delete src/status, src/tools, src/crons/epg.php (logic already in CLI commands)
- Update BalancerCommand: fix remote file_exists to SSH test -f, fix stripos check
- Update StartupCommand, UpdateCommand: use PHP_BIN + console.php
- Update dashboard.php: replace hardcoded sudo php with PHP_BIN
- Update install/test_installer: sentinel console.php, exec paths
- Update Makefile: remove status/tools from LB_ROOT_FILES and set_permissions
- Update docs: migration_guide, update-system (EN/RU)
- Update test-install: README.md, auto_install.sh
2026-03-18 20:32:51 +03:00
Divarion-D 11b62357f8 feat(tools): add FFmpeg auto-builder script for Docker-based builds
Full-featured build script for FFmpeg 4.0/4.3/4.4/5.1/7.1/8.0/8.1:
- Static libs + dynamic glibc (no segfault on Ubuntu 22.04+)
- NVIDIA NVENC/CUVID/NVDEC with --force-gpu for Docker
- AV1 (aom + dav1d + svtav1 + rav1e), DRM/VAAPI, Vulkan/libplacebo
- Conditional optional features via pkg-config detection
- APT and DNF/YUM dependency installation with alternative package names
- Verbose/quiet mode, BUILD_INFO metadata, build summary
- 8 target distros: debian 11/12/13, ubuntu 18/20/22/24, rocky 9
2026-03-17 20:46:31 +03:00
Divarion-D 17b6842562 chore: add Docker test container for release verification
- Dockerfile: Ubuntu 22.04 + systemd for testing installer end-to-end
- docker-compose.yml: build config for image
- test_release.sh: orchestration script (build/run/install/clean/logs)
- auto_install.sh: feeds answers to interactive installer prompts
- README.md: usage documentation

Container runs privileged with --cgroupns=host for systemd support.
Mounts dist/XC_VM.zip read-only, runs full install + post-verification.
2026-03-15 16:07:55 +03:00
Divarion-D 518993bb66 ci: extract PHP syntax check into reusable script
- Add tools/php_syntax_check.sh (supports full scan + single-file mode)
- CI workflow now calls the shared script
- All 6 agents updated to reference the script
- CONTRIBUTING.md: add Pre-Commit Checks section
- Exclude src/bin/* (third-party stubs) from lint
2026-03-15 13:49:18 +03:00
Divarion-D 77ee92bc79 Phase 11: Unify API layer — route all API endpoints through Front Controller
Steps 11.1–11.6: migrated all standalone API entry points to controller classes
dispatched via the Front Controller, then deleted the legacy PHP files.

Controllers created:
- PlayerApiController (player_api.php, 12 actions + numeric aliases)
- Enigma2ApiController (enigma2.php + xplugin.php)
- PlaylistApiController (playlist.php)
- EpgApiController (epg.php)
- InternalApiController (api.php, ~40 server-to-server actions)

Nginx changes (MAIN + LB configs):
- Add location block for streaming API endpoints → FC with XC_SCOPE=api
- Add location block for internal API (/api.php) → FC with XC_API=internal
- Change 6 rewrite rules from break→last for deleted file URLs
- Remove allow/deny from /api.php location — auth handled by PHP
  (password + IP whitelist + brute-force guard)

Front Controller (public/index.php):
- Add section 3a: REST API dispatch (XC_SCOPE=includes/api/*)
- Add section 3b: Streaming API dispatch (XC_SCOPE=api, XC_API=*)
- Move autoloader require to top (section 1b) for all code paths
- Controller map: endpoint name → controller class → init → dispatch

Bootstrap changes:
- www/init.php, www/stream/init.php: replace FC_API_NAME constant with
  direct $rFilename variable (set by FC before require, checked via isset)

Bug fixes:
- PlayerApiController: fix 3 PHP 8 warnings ($rBouquets undefined,
  missing 'rating'/'subtitle' array keys in get_vod_info)
- Fix server-to-server API calls blocked by nginx deny all (api_url_ip
  uses external server IP, not 127.0.0.1)

Deleted files (8):
- www/player_api.php, www/enigma2.php, www/xplugin.php
- www/epg.php, www/playlist.php, www/api.php
- includes/api/admin/index.php, includes/api/reseller/index.php

New files:
- tools/test_player_api.sh — comprehensive Player API test suite (13 sections)
2026-03-12 21:26:20 +03:00
Divarion-D dd1dcefd15 Refactor global variable usage and clean up code
- Updated multiple files to use global variables for `$db` and `$rSettings` instead of calling `SettingsManager::getAll()` repeatedly.
- Removed unnecessary variable assignments and improved code readability.
- Deleted unused scripts for cleaning and scanning PHP file headers.
- Removed a file containing PHP syntax errors.
- Adjusted various repository and service classes to streamline database interactions.
2026-03-08 16:19:30 +03:00
Divarion-D 3d8abedafd Stage 8 has been completed 2026-03-07 21:53:45 +03:00
Divarion-D a4c33e0f3e Added xdebug installer 2026-01-19 18:18:29 +03:00
Divarion-D 279a10b4c5 Update Top Contributors 2025-12-03 21:50:32 +03:00