...
 
Commits (17)
......@@ -5,8 +5,10 @@
!/private/typo3conf/LocalConfiguration.php
!/private/typo3conf/AdditionalConfiguration.ddev.php
!/private/typo3conf/RealurlConfiguration.php
/public/
/public
!/public/security.txt
/public/services/api-keys.php
!/public/.well-known/security.txt
!/public/humans.txt
!/public/robots.txt
!/public/services
......
This diff is collapsed.
......@@ -46,7 +46,9 @@ class Contributions implements \Psr\Http\Server\MiddlewareInterface
$gitlabClient = new \GuzzleHttp\Client(['base_uri' => 'https://gitlab.typo3.org/api/v4/']);
$this->countContributions($gitlabClient, $contributions, $beginDate, $endDate, $apiToken, 'issues');
$this->countContributions($gitlabClient, $contributions, $beginDate, $endDate, $apiToken, 'issues', true);
$this->countContributions($gitlabClient, $contributions, $beginDate, $endDate, $apiToken, 'merge_requests');
$this->countContributions($gitlabClient, $contributions, $beginDate, $endDate, $apiToken, 'merge_requests', true);
$contributions['result'] = 'success';
if ($contributions['contributors']) {
......@@ -64,23 +66,33 @@ class Contributions implements \Psr\Http\Server\MiddlewareInterface
return $response;
}
private function countContributions(\GuzzleHttp\Client $gitlabClient, array &$contributions, string $beginDate, string $endDate, string $apiToken, string $type): void
private function countContributions(\GuzzleHttp\Client $gitlabClient, array &$contributions, string $beginDate, string $endDate, string $apiToken, string $type, bool $updated = false): void
{
$uri = $type . '/?scope=all&created_after=' . $beginDate . '&created_before=' . $endDate;
if ($updated) {
$uri = $type . '/?scope=all&updated_after=' . $beginDate . '&updated_before=' . $endDate;
} else {
$uri = $type . '/?scope=all&created_after=' . $beginDate . '&created_before=' . $endDate;
}
$request = new \GuzzleHttp\Psr7\Request('GET', $uri, ['Private-Token', $apiToken]);
$response = $gitlabClient->send($request);
$data = json_decode($response->getBody(), true);
$contributions['statistics'][$type] = count($data);
$contributions['statistics'][$type] += count($data);
$contributionType = $updated ? 'updated' : 'created';
foreach ($data as $item) {
if ($updated && $item['created_at'] === $item['updated_at']) {
continue;
}
if (!isset($contributions['contributors'][$item['author']['id']])) {
$contributions['contributors'][$item['author']['id']] = [
'contributions' => [
$type => 0
$contributionType => [
$type => 0
]
],
'user' => $item['author']
];
}
$contributions['contributors'][$item['author']['id']]['contributions'][$type]++;
$contributions['contributors'][$item['author']['id']]['contributions'][$contributionType][$type]++;
}
}
......
<?xml version="1.0" encoding="utf-8"?>
<rss version="2.0"
xmlns:content="http://purl.org/rss/1.0/modules/content/"
xmlns:atom="http://www.w3.org/2005/Atom">
xmlns:atom="http://www.w3.org/2005/Atom"
xmlns:f="http://typo3.org/ns/TYPO3/CMS/Fluid/ViewHelpers"
xmlns:n="http://typo3.org/ns/GeorgRinger/News/ViewHelpers">
<channel>
<title>{settings.list.rss.channel.title}</title>
<link>{settings.list.rss.channel.link}</link>
......
<?xml version="1.0" encoding="utf-8"?>
<rss version="2.0"
xmlns:content="http://purl.org/rss/1.0/modules/content/"
xmlns:atom="http://www.w3.org/2005/Atom">
xmlns:atom="http://www.w3.org/2005/Atom"
xmlns:f="http://typo3.org/ns/TYPO3/CMS/Fluid/ViewHelpers"
xmlns:n="http://typo3.org/ns/GeorgRinger/News/ViewHelpers">
<channel>
<title>{settings.list.rss.channel.title}</title>
<link>{settings.list.rss.channel.link}</link>
......
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA256
# Please report vulnerabilities using the TYPO3 security team address
Contact: mailto:security@typo3.org
# OpenPGP key
Encryption: https://typo3.org/fileadmin/t3o_common_storage/keys/B41CC3EF373E0F5C70187FE93BEFBD27C05FBE60.asc
Encryption: https://keys.openpgp.org/vks/v1/by-fingerprint/B41CC3EF373E0F5C70187FE93BEFBD27C05FBE60
Encryption: openpgp4fpr:B41CC3EF373E0F5C70187FE93BEFBD27C05FBE60
# Preferred language when contacting us
Preferred-Languages: en
# Canonical URL
Canonical: https://typo3.org/.well-known/security.txt
# Security and incident handling policy
Policy: https://typo3.org/community/teams/security/incident-handling
-----BEGIN PGP SIGNATURE-----
iQIzBAEBCAAdFiEEYt7scsok31lZaNU265PT69q8o48FAl5BXU4ACgkQ65PT69q8
o4+fbQ/9E44PwUCycxzWH1yOFn56pxrCmfKdqPOdCugZSVPFxZq0RQtDRGYLJbnX
G39D8//E9jMJ9NEHjrXka+caRjmf7QPv/L9Sw4b+9vk1ldiokW4vT7oFMFeEv8ei
stgE9uQhv+YC3+orekO1eYAG3F1DGZ6K8/Eee/upktI5pOEi0RhTNFQtRS+4tjcd
kaeNG5wl3nhuakGUzf9Dlv9WDneE9CjpiUryRUpcj8fYXEkcxKN3k7B2oRuBEA53
vunMzegWIeRBQfxXzmNgeibChy2Sdz90vwwzXNMUcOW4VWFzNHW/SIpDgIMbEC8E
aMm3IMlGmFYLLZGoXz8KL0E8WpibHOypQB/xUvRkMveJ4heta4nL6P0TQS+mXoQW
moiaqcNdHkzLUYa3n2lyxQgFhWWNPiLG/K4remWmru24hsIPFDzMxrkehDYmJ9Vz
0HkzG8Gv6i6b5bqbbnjhS4hlw+fBdM49fjDsB0AcleXUr58FMI6Ll4liJacHKkLa
JfYF3PHrRo/5uqDQ91I/y1Tt5hoBbDAHLk+6UOzHpzSsqYzyE+dKV5F/cutF5DPm
URECYKT7ipjecjEf8sK3Ey7a1jcZgXqH4OTE/NLWoGPyipupJl4IsMQ+p8LCsgBm
jrj/oz9wlbC4V0F9zKICWfUOz2RWxi9B3bXwTpWRndAX+2pk7Bk=
=ACTV
-----END PGP SIGNATURE-----
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA256
# Please report vulnerabilities using the TYPO3 security team address
Contact: mailto:security@typo3.org
# OpenPGP key
Encryption: https://typo3.org/fileadmin/t3o_common_storage/keys/B41CC3EF373E0F5C70187FE93BEFBD27C05FBE60.asc
Encryption: https://keys.openpgp.org/vks/v1/by-fingerprint/B41CC3EF373E0F5C70187FE93BEFBD27C05FBE60
Encryption: openpgp4fpr:B41CC3EF373E0F5C70187FE93BEFBD27C05FBE60
# Preferred language when contacting us
Preferred-Languages: en
Policy: https://typo3.org/community/teams/security/incident-handling
# Canonical URL
Canonical: https://typo3.org/security.txt
-----BEGIN PGP SIGNATURE-----
iQFHBAEBCAAxFiEEtBzD7zc+D1xwGH/pO++9J8BfvmAFAl48l3cTHHNlY3VyaXR5
QHR5cG8zLm9yZwAKCRA7770nwF++YDiJCADOaMwukxyD7JGZHChu3FElFJyfPFq3
AcgXgSa4f4hZLiZkQwGjfahD36LSgZbudirPMoXn0XXPeF1/o6kIA3CNHzX8Z7rd
QxhN7tEKzOXaQabFLFkxXMPSf8Uj/Gptsu0rf1pyKrG4eh8KhJSV/8uHFD8RGeMx
88faTIM1VXakoaJDHLMQ1fkb8Nb3ooNXxWWAAy2+lxG5QkikRDCjkeUNwr9nnyiF
r8DgKv46LdqQWUedRaOjyAYog30jahlD46RHrfEb4rmVJGk3GOfuZnZAs/qwYWfV
otIzGzet7EWtEJld3OK0MsowLbt6WOl1/99QUPzglc/TSrEuf7JOQqu2
=7/kv
-----END PGP SIGNATURE-----