mirror of
https://github.com/Icinga/icingadb-web.git
synced 2026-05-28 04:36:06 -04:00
This was easy because only README.md and doc/01-About.md were redacted manually, everything else via: git ls-files -z |xargs -0 perl -pi -e 's/Icinga GmbH \| GPLv2/Icinga GmbH | GPLv2+/' This is legal because we have only merged PRs with label:cla/signed or made by Icinga staff: https://github.com/Icinga/icingadb-web/pulls?page=1&q=is%3Apr+is%3Aclosed+-label%3Acla%2Fsigned+-author%3Anilmerg This has no risk for us in people distributing their own version under GPLv3 only. After all, we won't take their patches anyway, unless they sign our CLA. This is the cleanest solution for having e.g. these in one address space: * Icinga Web, GPLv2+ * K8s Web, AGPLv3 * Thirdparty, some LGPLv3 and Apache-2.0 Apropos, K8s Web is even v3-licensed on purpose, to have a stronger protection against cloud ops.
89 lines
3 KiB
PHP
89 lines
3 KiB
PHP
<?php
|
|
|
|
/* Icinga DB Web | (c) 2020 Icinga GmbH | GPLv2+ */
|
|
|
|
namespace Icinga\Module\Icingadb\Setup;
|
|
|
|
use Icinga\Application\Icinga;
|
|
use Icinga\Module\Setup\Forms\SummaryPage;
|
|
use Icinga\Module\Setup\Requirement\PhpModuleRequirement;
|
|
use Icinga\Module\Setup\Requirement\WebLibraryRequirement;
|
|
use Icinga\Module\Setup\RequirementSet;
|
|
use Icinga\Module\Setup\Setup;
|
|
use Icinga\Module\Setup\SetupWizard;
|
|
use Icinga\Web\Form;
|
|
use Icinga\Web\Request;
|
|
use Icinga\Web\Wizard;
|
|
|
|
class IcingaDbWizard extends Wizard implements SetupWizard
|
|
{
|
|
protected function init()
|
|
{
|
|
$this->addPage(new WelcomePage());
|
|
$this->addPage(new DbResourcePage());
|
|
$this->addPage(new RedisPage());
|
|
$this->addPage(new ApiTransportPage());
|
|
$this->addPage(new SummaryPage(['name' => 'setup_icingadb_summary']));
|
|
}
|
|
|
|
public function setupPage(Form $page, Request $request)
|
|
{
|
|
if ($page->getName() === 'setup_icingadb_summary') {
|
|
$page->setSummary($this->getSetup()->getSummary());
|
|
$page->setSubjectTitle('Icinga DB Web');
|
|
}
|
|
}
|
|
|
|
public function getSetup()
|
|
{
|
|
$pageData = $this->getPageData();
|
|
$setup = new Setup();
|
|
|
|
$setup->addStep(new DbResourceStep($pageData['setup_icingadb_resource']));
|
|
$setup->addStep(new RedisStep($pageData['setup_icingadb_redis']));
|
|
$setup->addStep(new ApiTransportStep($pageData['setup_icingadb_api_transport']));
|
|
|
|
return $setup;
|
|
}
|
|
|
|
public function getRequirements()
|
|
{
|
|
$set = new RequirementSet();
|
|
|
|
$requiredVersions = Icinga::app()->getModuleManager()->getModule('icingadb')->getRequiredLibraries();
|
|
|
|
$set->add(new WebLibraryRequirement([
|
|
'condition' => ['icinga-php-library', '', $requiredVersions['icinga-php-library']],
|
|
'alias' => 'Icinga PHP library',
|
|
'description' => t('The Icinga PHP library (IPL) is required for Icinga DB Web')
|
|
]));
|
|
|
|
$set->add(new WebLibraryRequirement([
|
|
'condition' => ['icinga-php-thirdparty', '', $requiredVersions['icinga-php-thirdparty']],
|
|
'alias' => 'Icinga PHP Thirdparty',
|
|
'description' => t('The Icinga PHP Thirdparty library is required for Icinga DB Web')
|
|
]));
|
|
|
|
$set->add(new PhpModuleRequirement([
|
|
'condition' => 'libxml',
|
|
'alias' => 'libxml',
|
|
'description' => t('For check plugins that output HTML the libxml extension is required')
|
|
]));
|
|
|
|
$set->add(new PhpModuleRequirement([
|
|
'condition' => 'dom',
|
|
'alias' => 'dom',
|
|
'description' => t('For check plugins that output HTML the dom extension is required')
|
|
]));
|
|
|
|
$set->add(new PhpModuleRequirement([
|
|
'condition' => 'curl',
|
|
'alias' => 'cURL',
|
|
'description' => t(
|
|
'To send external commands over Icinga 2\'s API, the cURL module for PHP is required.'
|
|
)
|
|
]));
|
|
|
|
return $set;
|
|
}
|
|
}
|