Skip to content

Commit 170e094

Browse files
[FEATURE] WebServices: Add new status objective to report current SOAP/RPC server configuration (#11220) (#11367) (#11368)
Co-authored-by: Michael Jansen <mjansen@databay.de>
1 parent c4824ae commit 170e094

2 files changed

Lines changed: 116 additions & 1 deletion

File tree

Lines changed: 102 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,102 @@
1+
<?php
2+
3+
/**
4+
* This file is part of ILIAS, a powerful learning management system
5+
* published by ILIAS open source e-Learning e.V.
6+
*
7+
* ILIAS is licensed with the GPL-3.0,
8+
* see https://www.gnu.org/licenses/gpl-3.0.en.html
9+
* You should have received a copy of said license along with the
10+
* source code, too.
11+
*
12+
* If this is not the case or you just want to try ILIAS, you'll find
13+
* us at:
14+
* https://www.ilias.de
15+
* https://github.com/ILIAS-eLearning
16+
*
17+
*********************************************************************/
18+
19+
declare(strict_types=1);
20+
21+
namespace ILIAS\WebServices\Setup;
22+
23+
use ILIAS\Setup;
24+
25+
class WebServicesMetricsCollectedObjective extends Setup\Metrics\CollectedObjective
26+
{
27+
protected function getTentativePreconditions(Setup\Environment $environment): array
28+
{
29+
return [
30+
new \ilSettingsFactoryExistsObjective()
31+
];
32+
}
33+
34+
protected function collectFrom(Setup\Environment $environment, Setup\Metrics\Storage $storage): void
35+
{
36+
$factory = $environment->getResource(Setup\Environment::RESOURCE_SETTINGS_FACTORY);
37+
$settings = $factory->settingsFor('common');
38+
39+
$is_soap_enabled = (bool) $settings->get('soap_user_administration', '0');
40+
$storage->storeConfigBool(
41+
'soap_user_administration',
42+
$is_soap_enabled,
43+
'SOAP user administration enabled.'
44+
);
45+
46+
if ($is_soap_enabled) {
47+
$storage->storeConfigText(
48+
'soap_wsdl_path',
49+
$settings->get('soap_wsdl_path', ''),
50+
'Path to SOAP WSDL file.'
51+
);
52+
53+
$storage->storeConfigText(
54+
'soap_connect_timeout',
55+
$settings->get('soap_connect_timeout', ''),
56+
'SOAP connection timeout in seconds.'
57+
);
58+
59+
$storage->storeConfigText(
60+
'soap_response_timeout',
61+
$settings->get('soap_response_timeout', ''),
62+
'SOAP response timeout in seconds.'
63+
);
64+
65+
$storage->storeConfigText(
66+
'soap_internal_wsdl_path',
67+
$settings->get('soap_internal_wsdl_path', ''),
68+
'Path to internal SOAP WSDL file.'
69+
);
70+
71+
$storage->storeConfigBool(
72+
'soap_internal_wsdl_verify_peer',
73+
(bool) $settings->get('soap_internal_wsdl_verify_peer', '1'),
74+
'Verify SSL peer for internal WSDL.'
75+
);
76+
77+
$storage->storeConfigBool(
78+
'soap_internal_wsdl_verify_peer_name',
79+
(bool) $settings->get('soap_internal_wsdl_verify_peer_name', '1'),
80+
'Verify SSL peer name for internal WSDL.'
81+
);
82+
83+
$storage->storeConfigBool(
84+
'soap_internal_wsdl_allow_self_signed',
85+
(bool) $settings->get('soap_internal_wsdl_allow_self_signed', '0'),
86+
'Allow self-signed certificates for internal WSDL.'
87+
);
88+
}
89+
90+
$storage->storeConfigText(
91+
'rpc_server_host',
92+
$settings->get('rpc_server_host', ''),
93+
'RPC server host address.'
94+
);
95+
96+
$storage->storeConfigText(
97+
'rpc_server_port',
98+
$settings->get('rpc_server_port', ''),
99+
'RPC server port.'
100+
);
101+
}
102+
}

components/ILIAS/WebServices/classes/Setup/class.ilWebServicesSetupAgent.php

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@
2121
use ILIAS\Setup;
2222
use ILIAS\Refinery;
2323
use ILIAS\UI;
24+
use ILIAS\WebServices\Setup\WebServicesMetricsCollectedObjective;
2425

2526
class ilWebServicesSetupAgent implements Setup\Agent
2627
{
@@ -113,7 +114,19 @@ public function getBuildObjective(): Setup\Objective
113114
*/
114115
public function getStatusObjective(Setup\Metrics\Storage $storage): Setup\Objective
115116
{
116-
return new Setup\Objective\NullObjective();
117+
return new Setup\ObjectiveCollection(
118+
'Component WebServices',
119+
true,
120+
new WebServicesMetricsCollectedObjective($storage),
121+
new ilDatabaseUpdateStepsMetricsCollectedObjective(
122+
$storage,
123+
new ilECSUpdateSteps8()
124+
),
125+
new ilDatabaseUpdateStepsMetricsCollectedObjective(
126+
$storage,
127+
new ilSoapWsdlPathUpdateStep()
128+
)
129+
);
117130
}
118131

119132
/**

0 commit comments

Comments
 (0)