mirror of
https://github.com/harivansh-afk/betterNAS.git
synced 2026-04-15 05:02:07 +00:00
31 lines
646 B
PHP
31 lines
646 B
PHP
<?php
|
|
|
|
declare(strict_types=1);
|
|
|
|
namespace OCA\BetterNasControlplane\Service;
|
|
|
|
use OCA\BetterNasControlplane\AppInfo\Application;
|
|
use OCP\IAppConfig;
|
|
|
|
class ControlPlaneConfig {
|
|
public function __construct(
|
|
private readonly IAppConfig $appConfig,
|
|
) {
|
|
}
|
|
|
|
public function getBaseUrl(): string {
|
|
$environmentUrl = getenv('BETTERNAS_CONTROL_PLANE_URL');
|
|
if (is_string($environmentUrl) && $environmentUrl !== '') {
|
|
return rtrim($environmentUrl, '/');
|
|
}
|
|
|
|
$configuredUrl = $this->appConfig->getValueString(
|
|
Application::APP_ID,
|
|
'control_plane_url',
|
|
'http://control-plane:3000',
|
|
);
|
|
|
|
return rtrim($configuredUrl, '/');
|
|
}
|
|
}
|
|
|