Refactor: Make domain references dynamic across config and API

This commit is contained in:
mstfyldz
2026-02-22 17:38:18 +03:00
parent a28bef7c58
commit 9a558dfab8
2 changed files with 10 additions and 6 deletions

View File

@@ -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_token&api_key=YOUR_KEY' => 'Get access token',
'GET /api.php?action=get_config&token=YOUR_TOKEN' => 'Get portal config', '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); ], JSON_PRETTY_PRINT);
} }
?> ?>

View File

@@ -5,6 +5,10 @@
* Sadece bu dosyayı düzenleyerek tüm ayarları değiştirebilirsin * 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 [ return [
// ========================================== // ==========================================
// PANEL AYARLARI // PANEL AYARLARI
@@ -28,12 +32,12 @@ return [
// Güncelleme // Güncelleme
'force_update' => false, 'force_update' => false,
'latest_version' => '7.0', '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.', 'update_message' => 'Yeni versiyon mevcut! Lütfen güncelleyin.',
// Splash Screen // Splash Screen
'splash_duration' => 3, // saniye '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', 'title' => 'Bakımda',
'message' => 'Sistem şu an bakımda. Lütfen daha sonra tekrar deneyin.', 'message' => 'Sistem şu an bakımda. Lütfen daha sonra tekrar deneyin.',
'estimated_time' => '2 saat', 'estimated_time' => '2 saat',
'support_url' => 'https://yourdomain.com/support', 'support_url' => $baseUrl . '/support',
], ],
// ========================================== // ==========================================
@@ -126,8 +130,8 @@ return [
'twitter' => '', 'twitter' => '',
'instagram' => '', 'instagram' => '',
'telegram' => '', 'telegram' => '',
'website' => 'https://yourdomain.com', 'website' => $baseUrl,
'support_email' => 'support@yourdomain.com', 'support_email' => 'support@' . $host,
'support_phone' => '+90 XXX XXX XX XX', 'support_phone' => '+90 XXX XXX XX XX',
], ],