From 9a558dfab8f57dcde49d162dacfdb200aa4bb060 Mon Sep 17 00:00:00 2001 From: mstfyldz Date: Sun, 22 Feb 2026 17:38:18 +0300 Subject: [PATCH] Refactor: Make domain references dynamic across config and API --- api_secured.php | 2 +- config.php | 14 +++++++++----- 2 files changed, 10 insertions(+), 6 deletions(-) diff --git a/api_secured.php b/api_secured.php index 1fd0f44..93dc7d1 100644 --- a/api_secured.php +++ b/api_secured.php @@ -323,7 +323,7 @@ if (!isset($_GET['action'])) { 'GET /api.php?action=get_token&api_key=YOUR_KEY' => 'Get access token', 'GET /api.php?action=get_config&token=YOUR_TOKEN' => 'Get portal config', ], - 'documentation' => 'https://docs.yourdomain.com' + 'documentation' => 'https://' . ($_SERVER['HTTP_HOST'] ?? 'localhost') . '/docs' ], JSON_PRETTY_PRINT); } ?> diff --git a/config.php b/config.php index 9b1b048..607daf2 100644 --- a/config.php +++ b/config.php @@ -5,6 +5,10 @@ * Sadece bu dosyayı düzenleyerek tüm ayarları değiştirebilirsin */ +$protocol = isset($_SERVER['HTTPS']) && $_SERVER['HTTPS'] === 'on' ? "https" : "http"; +$host = $_SERVER['HTTP_HOST'] ?? 'localhost'; +$baseUrl = $protocol . '://' . $host; + return [ // ========================================== // PANEL AYARLARI @@ -28,12 +32,12 @@ return [ // Güncelleme 'force_update' => false, 'latest_version' => '7.0', - 'update_url' => 'https://yourdomain.com/downloads/myiptv.apk', + 'update_url' => $baseUrl . '/downloads/myiptv.apk', 'update_message' => 'Yeni versiyon mevcut! Lütfen güncelleyin.', // Splash Screen 'splash_duration' => 3, // saniye - 'splash_logo' => 'https://yourdomain.com/assets/logo.png', + 'splash_logo' => $baseUrl . '/assets/logo.png', ], // ========================================== @@ -90,7 +94,7 @@ return [ 'title' => 'Bakımda', 'message' => 'Sistem şu an bakımda. Lütfen daha sonra tekrar deneyin.', 'estimated_time' => '2 saat', - 'support_url' => 'https://yourdomain.com/support', + 'support_url' => $baseUrl . '/support', ], // ========================================== @@ -126,8 +130,8 @@ return [ 'twitter' => '', 'instagram' => '', 'telegram' => '', - 'website' => 'https://yourdomain.com', - 'support_email' => 'support@yourdomain.com', + 'website' => $baseUrl, + 'support_email' => 'support@' . $host, 'support_phone' => '+90 XXX XXX XX XX', ],