Commit Graph
460 Commits
Author SHA1 Message Date
Divarion-D 3aa7ca23ce fix: update package list and improve privilege revocation logic 2026-04-18 17:33:21 +03:00
Divarion-D e1a88509fa fix: normalize database host and improve migration command output 2026-04-18 16:48:08 +03:00
Divarion-D e737025ff8 test: add targeted PHPUnit setup and docs, fix GitHubReleases cache switching
- add PHPUnit bootstrap and config under tests/
- add focused unit tests for GitHubReleases, InputValidator and FfmpegPaths
- fix GitHubReleases cache file handling when switching update channel
- document PHPUnit PHAR usage and debug run commands in RU/EN docs
- document SFTP sync for tests/ and contributor test workflow
- remove broad smoke coverage approach in favor of per-file tests
2026-04-17 22:55:54 +03:00
Divarion-D bb9059c58b docs: update architecture and migration docs, minor config/auth fixes
- Update ARCHITECTURE.md with current codebase state
- Update MIGRATION.md with migration progress
- Minor fixes in AppConfig.php and AuthService.php
2026-04-16 22:35:07 +03:00
Divarion-D 7484245623 fix(api): fix undefined array key warnings in AdminApiController
- Add null coalescing for api_key, action, start, limit parameters
- Remove duplicate RequestManager::getAll() call
2026-04-16 22:35:07 +03:00
Divarion-D a00974b5c5 refactor(controllers): add data-preparation logic to admin controllers
- Move data queries, permission checks, and variable setup from views
  into individual admin controllers (Controller → Service → Repository)
- Each controller now prepares $rViewData before rendering the view
- Controllers handle redirects, permission enforcement, and data loading
2026-04-16 22:35:07 +03:00
Divarion-D 84c7e943c3 refactor(views): remove $__viewMode guards from admin views
- Remove legacy \<?php if (!isset(\$__viewMode)): ?\> blocks from ~100 admin views
- Move data preparation logic to controllers/routes
- Update admin routes and AdminTableController
- Views now contain only HTML/template markup
2026-04-16 22:33:10 +03:00
Divarion-D f2e569df87 fix(api): restructure REST API dispatch in front controller
- Move REST API dispatch block before login redirect to prevent
  API access codes from being redirected to /login
- Add SessionController for admin session management
- Renumber index.php dispatch sections (3=REST API, 4=redirect)
2026-04-16 22:33:10 +03:00
Divarion-D c50d8e417f fix(certbot): support Certbot 2.x renewal detection string
- Change search string from 'cert not yet due for renewal' to
  'not yet due for renewal' for compatibility with both Certbot 1.x
  and Certbot 2.x (which says 'Certificate not yet due for renewal')
- Extract implode() to $rOutBlob variable
2026-04-16 22:33:10 +03:00
Divarion-D 3f81b577a7 fix(service): fix syntax error in reload function
Double bracket in reload() caused a syntax error preventing service reload.
2026-04-14 18:14:02 +03:00
Divarion-D 1bd4180b4b feat: add syntax check target to Makefile and update changelog for version 2.1.1 2026-04-13 22:06:39 +03:00
Divarion-D 9e22edbf14 Bump version to 2.1.1 2026-04-13 22:02:08 +03:00
Divarion-D 52024641fb feat: MD5 hash verification for downloads
- install: compute_md5()+download_release_hash() for XC_VM.zip
- BalancerCommand: MD5 verification for LB binary downloads via SSH
2026-04-13 21:52:20 +03:00
Divarion-D 131266dab4 fix: render() and view safety
- BaseAdminController: extract(data, EXTR_SKIP)
- ServerListController: compact('rServers')
- servers.php: watchdog defaults for bytes_sent, bytes_received
2026-04-13 21:51:08 +03:00
Divarion-D 48b3fbf0ca fix: Redis null-safety guards
- ConnectionTracker: null checks for RedisManager::instance()
- UsersCronJob: safe array access for getConnections()
- table.php: null coalesce for rFailsPS + Redis fallback
2026-04-13 21:51:08 +03:00
Divarion-D c34da2c92f fix: permission issues when running as root
- autoload.php: chown cache dir+file to xc_vm when root
- ProcessManager: chown lock dirs to xc_vm when root
- StartupCommand: chmod +x console.php if not executable
- CacheCronJob: is_dir/is_writable guards + LOCK_EX
2026-04-13 21:51:07 +03:00
Divarion-D 723d2c3abf feat: update language labels for consistency across multiple language files 2026-04-13 01:43:40 +03:00
Divarion-D ac3064436e feat: add target to generate deleted_files.txt for update process 2026-04-13 01:04:54 +03:00
Divarion-D b33b876766 feat: enhance update command with logging and error handling 2026-04-13 00:21:55 +03:00
Divarion-D 2c6935c929 feat: add changelog.json for version 2.1.0 and update release preparation checklist 2026-04-12 17:47:56 +03:00
Divarion-D d9bbd6c35b build: unify install and update into a single archive
Replace separate install/update build targets with a single archive that
serves both purposes. The update script (src/update) now extracts to a
temp directory, removes excluded dirs (binaries, config, user data), and
copies remaining files over the live installation.

Changes:
- Remove main_update, lb_update, lb_update_copy_files,
  main_update_copy_files Makefile targets and UPDATE_EXCLUDE_DIRS var
- Move exclude dirs list into src/update (Python) where filtering
  actually happens at runtime
- Rewrite doUpdate() to use tempdir extraction with try/finally cleanup
- Make delete_files_list/lb_delete_files_list gracefully skip when
  LAST_TAG is empty (warn instead of error)
- Simplify CI workflows: one make command per variant instead of
  conditional install + update steps
- Add ARCHITECTURE.md §5.5 documenting update flow
- Update en/ru docs: update-system.md, updates_checklist.md
- Update makefile-build.instructions.md with new targets
2026-04-12 17:38:35 +03:00
Divarion-D 61011455ad Bump version to 2.1.0 2026-04-12 16:44:39 +03:00
Divarion-D 7ca349ca37 fix(i18n): update language retrieval in database and settings views 2026-04-12 16:41:07 +03:00
Divarion-D a35fa31a73 fix(i18n): use English values as fallback for missing translation keys
- Translator::get() now returns English value (not raw key name)
  when a key is missing in the current language
- addMissingKeyToAllLanguages() writes English value as placeholder
  for non-English language files instead of key name
- Synced 800 missing keys from en.ini to all 6 language files
  (bg, de, es, fr, pt, ru) with English values as editable placeholders
2026-04-12 16:18:29 +03:00
Divarion-D 2b9192c365 i18n(views): replace hardcoded English with translation calls
Replaced ~1977 hardcoded English strings across 105 admin view files
with \$language::get() translation calls.

Categories processed:
- Page titles (57), Labels (394), Table headers (542)
- Buttons (161), Tooltips/placeholders (433)
- JS alerts (3), Options/spans/misc (387)

Handles both HTML and echo-string contexts correctly.
2026-04-12 16:08:46 +03:00
Divarion-D cbe3b136c8 i18n(langs): add 800+ translation keys to en.ini
Extracted hardcoded English strings from admin panel views:
- Page titles: 33 new keys
- Labels: 203 new keys
- Table headers: 113 new keys
- Buttons: 47 new keys
- Tooltips/placeholders: 301 new keys
- JS alerts: 3 new keys
- Options/spans/misc: 103 new keys

Total: ~800 new translation keys (was 762, now 1528)
2026-04-12 16:08:46 +03:00
Divarion-D 576271cfdf style(admin): widen boxed-layout-ext from 1040px to 1440px
Increase .boxed-layout-ext .container-fluid max-width to use more
screen real estate on modern displays.
2026-04-12 15:22:07 +03:00
Divarion-D 1b73fa69d6 fix(cron): null-safe guards for LB server environment
- ServersCronJob: guard against null watchdog_data from json_decode,
  use ?? [] for cpu_average_array access
- UsersCronJob: safe json_decode for php_pids — check is_array()
  before array_map to prevent TypeError on null
- CacheCronJob: suppress mkdir errors with @, check is_dir() before
  chown/chgrp to handle permission-denied on LB servers
2026-04-12 15:22:07 +03:00
Divarion-D 980968d3d9 fix(admin): use null coalescing for Redis connection counts
- Replace ?: with ?? for $rConnectionCount lookups (9 locations) —
  ?: treats 0 as falsy, ?? correctly handles missing keys
- Guard mGet() against empty $rKeys array — mGet([]) returns false,
  causing foreach to fail on bool
2026-04-12 15:22:06 +03:00
Divarion-D d89710791b fix(admin): null-safe guards for admin views and MovieService
- settings.php: htmlspecialchars() array guard for api_ips, is_array()
  guards for already-decoded allow_countries and allowed_stb_types
- api.php: null-safe parserelease title access, @var Database phpdoc
  annotations for closures with use (&$db)
- movie.php: !empty() for RequestManager import key access
- MovieController.php: default variable declarations before compact(),
  safe key access for direct_source and stream_status, proper movie
  fetch with redirect on invalid id
- MovieService.php: null coalescing for movie_symlink, direct_proxy,
  bouquet_create_list, category_create_list, bouquets, category_id
2026-04-12 15:22:06 +03:00
Divarion-D f85b12e770 fix(tmdb): restructure include paths to match actual directory layout
- Fix TmdbClient constructor require path for config.php
- Update all include_once paths to use __DIR__ relative paths
- Move files from nested config/config/ and roles/roles/ to correct locations
- Remove duplicate files from old incorrect paths
2026-04-12 12:24:42 +03:00
Divarion-D 427625295b fix(tracker): safe proxy_id cast and simplify condition
- Cast proxy_id to int with null coalesce in closeConnection() call
- Simplify negated empty-block condition to positive if-statement
2026-04-12 12:24:42 +03:00
Divarion-D a3e0ebdc6f refactor(streaming): remove globals from function parameters
Move $rSettings, $rServers, $redis from explicit parameters to global
access inside functions. This eliminates inconsistent mixed patterns
where some globals were passed as args and others accessed via global.

Changed signatures:
- StreamAuth::checkAccess() - removed $rServers, $rSettings params
- OffAirHandler::getOffAirVideo() - removed $rSettings param
- OffAirHandler::showVideoServer() - removed $rSettings, $rServers params
- ConnectionLimiter::closeConnections() - removed $redis, $rSettings, $rServers
- ConnectionLimiter::closeConnection() - removed $redis, $rSettings, $rServers
- ProxySelector::availableProxy() - removed $rServers, $rSettings params

All callers updated accordingly.
2026-04-12 12:24:41 +03:00
Divarion-D 38a8aebd56 fix(streaming): preserve IP-based URLs when domain is inactive
When a domain is configured but not resolving (DNS not set up, cert not active),
stream redirect URLs use the domain causing playback to fail. Now:
- StreamRedirector::getStreamingURL() falls back to server_ip when client
  connects via IP address (HOST is an IP)
- DomainResolver::resolve() preserves IP when use_mdomain_in_lists=1 but
  client accessed via IP address
2026-04-12 12:24:41 +03:00
Divarion-D 84cab831bf feat(modules): enhance module upload UI with drag-and-drop support and AJAX handling 2026-04-11 22:46:06 +03:00
Divarion-D ed66efdf5d feat(modules): add module system with admin UI 2026-04-11 22:06:04 +03:00
Divarion-D 50dc167a34 refactor(redis): add type hints, PHPDoc, null-safety and health-check ping 2026-04-11 22:06:04 +03:00
Divarion-D f8f465209c fix(streaming): add null coalescing guards for undefined array keys 2026-04-11 22:06:04 +03:00
Divarion-D a95f729173 fix: check isset api_key before ctype_xdigit in UserService 2026-04-10 20:31:22 +03:00
Divarion-D f404afc4a0 fix: check headers_sent() before setcookie in Translator 2026-04-10 20:31:22 +03:00
Divarion-D ddaf76e0ef remove obsolete redis-server_6.2.2 binary 2026-04-10 20:31:22 +03:00
Divarion-D 4f24913054 add static redis.conf template to src/bin/redis 2026-04-10 20:22:18 +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 e304612605 feat: add new core/domain architecture classes and migrated libraries
New core classes:
- PageAuthorization, QueryHelper, ApiClient, AdminHelpers
- Logger, Translator, XmlStringStreamer, DropboxClient
- GithubReleases, MobileDetect

New domain classes:
- M3UParser, M3UEntry, TicketRepository, TMDbService

Migrated libraries:
- TMDb SDK → modules/tmdb/lib/
- Python scripts → bin/python/
- permissions.php → config/
- Table controllers → public/Controllers/
- AsyncFileOperations, TimeshiftClient → streaming/

New docs:
- translations.md (en/ru)
2026-04-09 21:23:16 +03:00
Divarion-D a5f1472bf1 Add common JavaScript utilities for admin pages
- Introduced a new common.js file containing essential functions for admin page operations.
- Implemented utilities for modal handling, error/success notifications, domain/IP validation, session management, and SPA navigation.
- Added functions for managing tooltips, search functionality, and URL parameter manipulation.
- Enhanced user experience with toast notifications and modal interactions.
2026-04-07 22:18:23 +03:00
Divarion-D 59bfb6f942 Add EventDispatcher integration to bootstrap and module loader
- Updated the XC_Bootstrap class to include the EventDispatcher class in the service container.
- Modified the ModuleLoader class to utilize the EventDispatcher for subscribing to events, enhancing the event handling mechanism.
2026-04-07 21:48:20 +03:00
Divarion-D 496f9883ff refactor(GitHubReleases): replace getNextVersion with getLatestVersion for direct updates 2026-04-07 21:23:00 +03:00
Divarion-D 8af3fa7331 fix(view): improve dark mode handling in server view cards 2026-04-07 21:05:53 +03:00
Divarion-D a64d59b15c fix(docs): update console paths in documentation and scripts 2026-04-07 20:49:44 +03:00
Divarion-D ac0c3753e7 fix(docs): update release checklist to include disabling development mode 2026-04-07 20:26:06 +03:00