Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4,581 changes: 1,089 additions & 3,492 deletions composer.lock

Large diffs are not rendered by default.

8 changes: 4 additions & 4 deletions lib/BackgroundJob/ExAppInitStatusCheckJob.php
Original file line number Diff line number Diff line change
Expand Up @@ -21,10 +21,10 @@ class ExAppInitStatusCheckJob extends TimedJob {
private const everyMinuteInterval = 60;

public function __construct(
ITimeFactory $time,
private readonly ExAppMapper $mapper,
ITimeFactory $time,
private readonly ExAppMapper $mapper,
private readonly AppAPIService $service,
private readonly IAppConfig $appConfig,
private readonly IAppConfig $appConfig,
) {
parent::__construct($time);

Expand All @@ -46,7 +46,7 @@ protected function run($argument): void {
if ($exApp->getAppid() === Application::TEST_DEPLOY_APPID) {
$initTimeoutSeconds = 30; // Check for smaller timeout(half of minute) for test deploy app
} else {
$initTimeoutSeconds = (int) ($initTimeoutMinutesSetting * 60);
$initTimeoutSeconds = (int)($initTimeoutMinutesSetting * 60);
}
if ((time() >= ($status['init_start_time'] + $initTimeoutSeconds)) && (empty($status['error']))) {
$this->service->setAppInitProgress(
Expand Down
2 changes: 1 addition & 1 deletion lib/Capabilities.php
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
class Capabilities implements ICapability {

public function __construct(
private readonly IConfig $config,
private readonly IConfig $config,
private readonly IAppManager $appManager,
) {
}
Expand Down
2 changes: 1 addition & 1 deletion lib/Command/Daemon/ListDaemons.php
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ class ListDaemons extends Command {

public function __construct(
private readonly DaemonConfigService $daemonConfigService,
private readonly IAppConfig $appConfig
private readonly IAppConfig $appConfig,
) {
parent::__construct();
}
Expand Down
2 changes: 1 addition & 1 deletion lib/Command/Daemon/UnregisterDaemon.php
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ class UnregisterDaemon extends Command {

public function __construct(
private readonly DaemonConfigService $daemonConfigService,
private readonly ExAppService $exAppService,
private readonly ExAppService $exAppService,
) {
parent::__construct();
}
Expand Down
4 changes: 2 additions & 2 deletions lib/Command/ExApp/Disable.php
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,8 @@

class Disable extends Command {
public function __construct(
private readonly AppAPIService $service,
private readonly ExAppService $exAppService,
private readonly AppAPIService $service,
private readonly ExAppService $exAppService,
) {
parent::__construct();
}
Expand Down
4 changes: 2 additions & 2 deletions lib/Command/ExApp/Enable.php
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,8 @@
class Enable extends Command {

public function __construct(
private readonly AppAPIService $service,
private readonly ExAppService $exAppService,
private readonly AppAPIService $service,
private readonly ExAppService $exAppService,
) {
parent::__construct();
}
Expand Down
4 changes: 3 additions & 1 deletion lib/Command/ExApp/ListExApps.php
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,9 @@
use Symfony\Component\Console\Output\OutputInterface;

class ListExApps extends Command {
public function __construct(private readonly ExAppMapper $mapper) {
public function __construct(
private readonly ExAppMapper $mapper,
) {
parent::__construct();
}

Expand Down
20 changes: 10 additions & 10 deletions lib/Command/ExApp/Register.php
Original file line number Diff line number Diff line change
Expand Up @@ -29,15 +29,15 @@
class Register extends Command {

public function __construct(
private readonly AppAPIService $service,
private readonly DaemonConfigService $daemonConfigService,
private readonly DockerActions $dockerActions,
private readonly ManualActions $manualActions,
private readonly IAppConfig $appConfig,
private readonly ExAppService $exAppService,
private readonly ISecureRandom $random,
private readonly LoggerInterface $logger,
private readonly ExAppArchiveFetcher $exAppArchiveFetcher,
private readonly AppAPIService $service,
private readonly DaemonConfigService $daemonConfigService,
private readonly DockerActions $dockerActions,
private readonly ManualActions $manualActions,
private readonly IAppConfig $appConfig,
private readonly ExAppService $exAppService,
private readonly ISecureRandom $random,
private readonly LoggerInterface $logger,
private readonly ExAppArchiveFetcher $exAppArchiveFetcher,
) {
parent::__construct();
}
Expand Down Expand Up @@ -207,7 +207,7 @@ protected function execute(InputInterface $input, OutputInterface $output): int
$daemonConfig->getProtocol(),
$daemonConfig->getHost(),
$daemonConfig->getDeployConfig(),
(int) $appInfo['port'],
(int)$appInfo['port'],
$auth,
);
}
Expand Down
6 changes: 3 additions & 3 deletions lib/Command/ExApp/Unregister.php
Original file line number Diff line number Diff line change
Expand Up @@ -23,10 +23,10 @@
class Unregister extends Command {

public function __construct(
private readonly AppAPIService $service,
private readonly AppAPIService $service,
private readonly DaemonConfigService $daemonConfigService,
private readonly DockerActions $dockerActions,
private readonly ExAppService $exAppService,
private readonly DockerActions $dockerActions,
private readonly ExAppService $exAppService,
) {
parent::__construct();
}
Expand Down
22 changes: 11 additions & 11 deletions lib/Command/ExApp/Update.php
Original file line number Diff line number Diff line change
Expand Up @@ -28,14 +28,14 @@
class Update extends Command {

public function __construct(
private readonly AppAPIService $service,
private readonly ExAppService $exAppService,
private readonly DaemonConfigService $daemonConfigService,
private readonly DockerActions $dockerActions,
private readonly ManualActions $manualActions,
private readonly LoggerInterface $logger,
private readonly ExAppArchiveFetcher $exAppArchiveFetcher,
private readonly ExAppFetcher $exAppFetcher,
private readonly AppAPIService $service,
private readonly ExAppService $exAppService,
private readonly DaemonConfigService $daemonConfigService,
private readonly DockerActions $dockerActions,
private readonly ManualActions $manualActions,
private readonly LoggerInterface $logger,
private readonly ExAppArchiveFetcher $exAppArchiveFetcher,
private readonly ExAppFetcher $exAppFetcher,
private readonly ExAppDeployOptionsService $exAppDeployOptionsService,
) {
parent::__construct();
Expand All @@ -60,10 +60,10 @@ protected function configure(): void {
protected function execute(InputInterface $input, OutputInterface $output): int {
$appId = $input->getArgument('appid');
if (empty($appId) && !$input->getOption('all')) {
$output->writeln("<error>Please specify an app to update or \"--all\" to update all updatable apps</error>");
$output->writeln('<error>Please specify an app to update or "--all" to update all updatable apps</error>');
return 1;
} elseif (!empty($appId) && $input->getOption('all')) {
$output->writeln("<error>The \"--all\" flag is mutually exclusive with specifying app</error>");
$output->writeln('<error>The "--all" flag is mutually exclusive with specifying app</error>');
return 1;
} elseif ($input->getOption('all')) {
$apps = $this->exAppFetcher->get();
Expand Down Expand Up @@ -243,7 +243,7 @@ private function updateExApp(InputInterface $input, OutputInterface $output, str
$daemonConfig->getProtocol(),
$daemonConfig->getHost(),
$daemonConfig->getDeployConfig(),
(int) $appInfo['port'],
(int)$appInfo['port'],
$auth,
);
}
Expand Down
5 changes: 3 additions & 2 deletions lib/Command/ExAppConfig/DeleteConfig.php
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,9 @@
class DeleteConfig extends Command {

public function __construct(
private readonly ExAppService $service,
private readonly ExAppConfigService $exAppConfigService) {
private readonly ExAppService $service,
private readonly ExAppConfigService $exAppConfigService,
) {
parent::__construct();
}

Expand Down
5 changes: 3 additions & 2 deletions lib/Command/ExAppConfig/GetConfig.php
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,9 @@
class GetConfig extends Command {

public function __construct(
private readonly ExAppService $service,
private readonly ExAppConfigService $exAppConfigService) {
private readonly ExAppService $service,
private readonly ExAppConfigService $exAppConfigService,
) {
parent::__construct();
}

Expand Down
4 changes: 2 additions & 2 deletions lib/Command/ExAppConfig/ListConfig.php
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,8 @@ class ListConfig extends Command {
private const SENSITIVE_VALUE = '***REMOVED SENSITIVE VALUE***';

public function __construct(
private readonly ExAppService $service,
private readonly ExAppConfigService $appConfigService
private readonly ExAppService $service,
private readonly ExAppConfigService $appConfigService,
) {
parent::__construct();
}
Expand Down
6 changes: 3 additions & 3 deletions lib/Command/ExAppConfig/SetConfig.php
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,8 @@
class SetConfig extends Command {

public function __construct(
private readonly ExAppService $service,
private readonly ExAppConfigService $exAppConfigService
private readonly ExAppService $service,
private readonly ExAppConfigService $exAppConfigService,
) {
parent::__construct();
}
Expand Down Expand Up @@ -50,7 +50,7 @@ protected function execute(InputInterface $input, OutputInterface $output): int
$configKey = $input->getArgument('configkey');
$value = $input->getOption('value');
$isSensitive = $input->getOption('sensitive');
$sensitive = (int) filter_var($isSensitive, FILTER_VALIDATE_BOOLEAN);
$sensitive = (int)filter_var($isSensitive, FILTER_VALIDATE_BOOLEAN);
$updateOnly = $input->getOption('update-only');

$exAppConfig = $this->exAppConfigService->getAppConfig($appId, $configKey);
Expand Down
2 changes: 1 addition & 1 deletion lib/Controller/AppConfigController.php
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ class AppConfigController extends OCSController {
protected $request;

public function __construct(
IRequest $request,
IRequest $request,
private readonly ExAppConfigService $exAppConfigService,
) {
parent::__construct(Application::APP_ID, $request);
Expand Down
4 changes: 2 additions & 2 deletions lib/Controller/ConfigController.php
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,8 @@
class ConfigController extends Controller {

public function __construct(
string $appName,
IRequest $request,
string $appName,
IRequest $request,
private readonly IAppConfig $appConfig,
) {
parent::__construct($appName, $request);
Expand Down
18 changes: 9 additions & 9 deletions lib/Controller/DaemonConfigController.php
Original file line number Diff line number Diff line change
Expand Up @@ -32,14 +32,14 @@
class DaemonConfigController extends ApiController {

public function __construct(
IRequest $request,
private readonly IAppConfig $appConfig,
IRequest $request,
private readonly IAppConfig $appConfig,
private readonly DaemonConfigService $daemonConfigService,
private readonly DockerActions $dockerActions,
private readonly AppAPIService $service,
private readonly ExAppService $exAppService,
private readonly IL10N $l10n,
private readonly ICrypto $crypto,
private readonly DockerActions $dockerActions,
private readonly AppAPIService $service,
private readonly ExAppService $exAppService,
private readonly IL10N $l10n,
private readonly ICrypto $crypto,
) {
parent::__construct(Application::APP_ID, $request);
}
Expand Down Expand Up @@ -72,7 +72,7 @@ public function updateDaemonConfig(string $name, array $daemonConfigParams): Res

// Restore the original password if "dummySecret123" is provided
if ($haproxyPassword === 'dummySecret123') {
$daemonConfigParams['deploy_config']['haproxy_password'] = $daemonConfig->getDeployConfig()['haproxy_password'] ?? "";
$daemonConfigParams['deploy_config']['haproxy_password'] = $daemonConfig->getDeployConfig()['haproxy_password'] ?? '';
} elseif (!empty($haproxyPassword)) {
// New password provided, encrypt it
$daemonConfigParams['deploy_config']['haproxy_password'] = $this->crypto->encrypt($haproxyPassword);
Expand Down Expand Up @@ -141,7 +141,7 @@ public function checkDaemonConnection(array $daemonParams): Response {
$daemonConfig = $this->daemonConfigService->getDaemonConfigByName($daemonParams['name']);
if ($daemonConfig !== null) {
// such Daemon config already present in the DB
$haproxyPasswordDB = $daemonConfig->getDeployConfig()['haproxy_password'] ?? "";
$haproxyPasswordDB = $daemonConfig->getDeployConfig()['haproxy_password'] ?? '';
if ($haproxyPasswordDB) {
// get password from the DB instead of the “masked” one
$daemonParams['deploy_config']['haproxy_password'] = $haproxyPasswordDB;
Expand Down
24 changes: 12 additions & 12 deletions lib/Controller/ExAppProxyController.php
Original file line number Diff line number Diff line change
Expand Up @@ -35,15 +35,15 @@
class ExAppProxyController extends Controller {

public function __construct(
IRequest $request,
private readonly AppAPIService $service,
private readonly ExAppService $exAppService,
private readonly IMimeTypeDetector $mimeTypeHelper,
IRequest $request,
private readonly AppAPIService $service,
private readonly ExAppService $exAppService,
private readonly IMimeTypeDetector $mimeTypeHelper,
private readonly ContentSecurityPolicyNonceManager $nonceManager,
private readonly ?string $userId,
private readonly IGroupManager $groupManager,
private readonly LoggerInterface $logger,
private readonly IThrottler $throttler,
private readonly ?string $userId,
private readonly IGroupManager $groupManager,
private readonly LoggerInterface $logger,
private readonly IThrottler $throttler,
) {
parent::__construct(Application::APP_ID, $request);
}
Expand Down Expand Up @@ -233,7 +233,7 @@ public function ExAppDelete(string $appId, string $other): Response {
}

private function prepareProxy(
string $appId, string $other, array &$route, array &$bruteforceProtection, int &$delay
string $appId, string $other, array &$route, array &$bruteforceProtection, int &$delay,
): ?ExApp {
$delay = 0;
$exApp = $this->exAppService->getExApp($appId);
Expand Down Expand Up @@ -312,9 +312,9 @@ private function buildMultipartFormData(array $bodyParams, array $files): array

private function passesExAppProxyRoutesChecks(ExApp $exApp, string $exAppRoute): array {
foreach ($exApp->getRoutes() as $route) {
if (preg_match('/' . $route['url'] . '/i', $exAppRoute) === 1 &&
str_contains(strtolower($route['verb']), strtolower($this->request->getMethod())) &&
$this->passesExAppProxyRouteAccessLevelCheck($route['access_level'])
if (preg_match('/' . $route['url'] . '/i', $exAppRoute) === 1
&& str_contains(strtolower($route['verb']), strtolower($this->request->getMethod()))
&& $this->passesExAppProxyRouteAccessLevelCheck($route['access_level'])
) {
return $route;
}
Expand Down
18 changes: 9 additions & 9 deletions lib/Controller/HarpController.php
Original file line number Diff line number Diff line change
Expand Up @@ -29,15 +29,15 @@ class HarpController extends Controller {
protected $request;

public function __construct(
IRequest $request,
private readonly ExAppService $exAppService,
private readonly LoggerInterface $logger,
private readonly IThrottler $throttler,
private readonly IUserManager $userManager,
private readonly IGroupManager $groupManager,
private readonly ICrypto $crypto,
private readonly ?string $userId,
private readonly HarpService $harpService,
IRequest $request,
private readonly ExAppService $exAppService,
private readonly LoggerInterface $logger,
private readonly IThrottler $throttler,
private readonly IUserManager $userManager,
private readonly IGroupManager $groupManager,
private readonly ICrypto $crypto,
private readonly ?string $userId,
private readonly HarpService $harpService,
) {
parent::__construct(Application::APP_ID, $request);

Expand Down
8 changes: 4 additions & 4 deletions lib/Controller/OCSApiController.php
Original file line number Diff line number Diff line change
Expand Up @@ -31,12 +31,12 @@ class OCSApiController extends OCSController {
protected $request;

public function __construct(
IRequest $request,
IRequest $request,
private readonly LoggerInterface $logger,
private readonly AppAPIService $service,
private readonly AppAPIService $service,
private IConfig $config,
private readonly ExAppService $exAppService,
private readonly IURLGenerator $urlGenerator,
private readonly ExAppService $exAppService,
private readonly IURLGenerator $urlGenerator,
) {
parent::__construct(Application::APP_ID, $request);

Expand Down
4 changes: 2 additions & 2 deletions lib/Controller/OCSExAppController.php
Original file line number Diff line number Diff line change
Expand Up @@ -25,9 +25,9 @@ class OCSExAppController extends OCSController {
protected $request;

public function __construct(
IRequest $request,
IRequest $request,
private readonly AppAPIService $service,
private readonly ExAppService $exAppService,
private readonly ExAppService $exAppService,
private readonly IURLGenerator $urlGenerator,
) {
parent::__construct(Application::APP_ID, $request);
Expand Down
2 changes: 1 addition & 1 deletion lib/Controller/OCSSettingsController.php
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ class OCSSettingsController extends OCSController {
protected $request;

public function __construct(
IRequest $request,
IRequest $request,
private readonly SettingsService $settingsService,
) {
parent::__construct(Application::APP_ID, $request);
Expand Down
Loading