Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: acmephp/acmephp
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: master
Choose a base ref
...
head repository: sipsynergy/acmephp
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: master
Choose a head ref
Can’t automatically merge. Don’t worry, you can still create the pull request.
  • 16 commits
  • 6 files changed
  • 4 contributors

Commits on Oct 1, 2021

  1. Copy the full SHA
    c683fc2 View commit details
  2. Copy the full SHA
    b31c573 View commit details
  3. Copy the full SHA
    7068237 View commit details

Commits on Oct 14, 2021

  1. Modified route 53 solver to delete challenge authorisation record dur…

    …ing cleanup rather than updating to an empty record.
    sips-richard committed Oct 14, 2021
    Copy the full SHA
    28aef51 View commit details

Commits on Mar 15, 2022

  1. Updated dependencies.

    sips-richard committed Mar 15, 2022
    Copy the full SHA
    028ea9c View commit details
  2. Copy the full SHA
    e472645 View commit details

Commits on May 25, 2022

  1. CR-1607 Update guzzle

    sips-billy committed May 25, 2022
    Copy the full SHA
    4d11695 View commit details
  2. Merge pull request #1 from sipsynergy/feature/CR-1607-BC-Update-guzzl…

    …e-dependency
    
    CR-1607 Update guzzle
    sips-dan-s authored May 25, 2022

    Verified

    This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
    Copy the full SHA
    d67b6bb View commit details

Commits on May 31, 2022

  1. CR-1792 Update guzzle

    sips-billy committed May 31, 2022
    Copy the full SHA
    9aa0d84 View commit details
  2. Merge pull request #2 from sipsynergy/feature/CR-1792-BC-Update-guzzl…

    …e-cve
    
    CR-1792 Update guzzle
    sips-richard authored May 31, 2022

    Verified

    This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
    Copy the full SHA
    39f819b View commit details

Commits on Jun 10, 2022

  1. Copy the full SHA
    3b12c90 View commit details
  2. Merge pull request #3 from sipsynergy/feature/CR-1842-Update-guzzle-t…

    …o-resolve-cve
    
    CR-1842 Update guzzle dependency
    sips-dan-s authored Jun 10, 2022

    Verified

    This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
    Copy the full SHA
    87e43a1 View commit details

Commits on Jun 22, 2022

  1. CR-1890 Update guzzle

    sips-billy committed Jun 22, 2022
    Copy the full SHA
    913e2f1 View commit details

Commits on Jun 24, 2022

  1. Verified

    This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
    Copy the full SHA
    d61a5b0 View commit details

Commits on May 1, 2024

  1. CR-5447 security patching

    sips-dan-s committed May 1, 2024
    Copy the full SHA
    f8b5140 View commit details

Commits on Jan 7, 2025

  1. Copy the full SHA
    863b994 View commit details
Showing with 4,509 additions and 45 deletions.
  1. +1 −1 .gitignore
  2. +8 −12 composer.json
  3. +4,473 −0 composer.lock
  4. +1 −1 src/Cli/Monolog/ConsoleFormatter.php
  5. +7 −6 src/Cli/Monolog/ConsoleHandler.php
  6. +19 −25 src/Core/Challenge/Dns/Route53Solver.php
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
/build/
/box.json
composer.lock
vendor/
.php_cs.cache
doc/.couscous
.subsplit
.phpunit.result.cache
/.idea/
20 changes: 8 additions & 12 deletions composer.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"name": "acmephp/acmephp",
"name": "callroute/acmephp",
"description": "Let's Encrypt client written in PHP",
"type": "project",
"license": "MIT",
@@ -34,7 +34,7 @@
}
],
"require": {
"php": ">=7.2.5",
"php": "^8.1",
"ext-filter": "*",
"ext-hash": "*",
"ext-json": "*",
@@ -44,20 +44,19 @@
"alibabacloud/cdn": "^1.7",
"alibabacloud/wafopenapi": "^1.7",
"aws/aws-sdk-php": "^3.38",
"guzzlehttp/guzzle": "^7.2",
"guzzlehttp/psr7": "^1.0",
"guzzlehttp/guzzle": "^7.4",
"guzzlehttp/psr7": "^2.2",
"lcobucci/jwt": "^3.3|^4.0",
"league/flysystem": "^1.0.19",
"league/flysystem-memory": "^1.0",
"league/flysystem-sftp": "^1.0.7",
"monolog/monolog": "^1.19",
"padraic/phar-updater": "^1.0",
"monolog/monolog": "^2.4",
"psr/container": "^1.0",
"psr/http-message": "^1.0",
"psr/log": "^1.0",
"psr/log": "^3.0",
"swiftmailer/swiftmailer": "^5.4|^6.0",
"symfony/config": "^5.0",
"symfony/console": "^5.0",
"symfony/console": "^6.0",
"symfony/dependency-injection": "^5.0",
"symfony/filesystem": "^5.0",
"symfony/serializer": "^5.0",
@@ -85,9 +84,6 @@
}
},
"config": {
"sort-packages": true,
"platform": {
"php": "7.2.34"
}
"sort-packages": true
}
}
4,473 changes: 4,473 additions & 0 deletions composer.lock

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion src/Cli/Monolog/ConsoleFormatter.php
Original file line number Diff line number Diff line change
@@ -38,7 +38,7 @@ public function __construct($format = null, $dateFormat = null, $allowInlineLine
/**
* {@inheritdoc}
*/
public function format(array $record)
public function format(array $record): string
{
if ($record['level'] >= Logger::ERROR) {
$record['start_tag'] = '<error>';
13 changes: 7 additions & 6 deletions src/Cli/Monolog/ConsoleHandler.php
Original file line number Diff line number Diff line change
@@ -11,6 +11,7 @@

namespace AcmePhp\Cli\Monolog;

use Monolog\Formatter\FormatterInterface;
use Monolog\Handler\AbstractProcessingHandler;
use Monolog\Logger;
use Symfony\Component\Console\Output\OutputInterface;
@@ -65,15 +66,15 @@ public function __construct(OutputInterface $output = null, bool $bubble = true,
/**
* {@inheritdoc}
*/
public function isHandling(array $record)
public function isHandling(array $record): bool
{
return $this->updateLevel() && parent::isHandling($record);
}

/**
* {@inheritdoc}
*/
public function handle(array $record)
public function handle(array $record): bool
{
// we have to update the logging level each time because the verbosity of the
// console output might have changed in the meantime (it is not immutable)
@@ -93,7 +94,7 @@ public function setOutput(OutputInterface $output)
/**
* Disables the output.
*/
public function close()
public function close(): void
{
$this->output = null;

@@ -103,15 +104,15 @@ public function close()
/**
* {@inheritdoc}
*/
protected function write(array $record)
protected function write(array $record): void
{
$this->output->write((string) $record['formatted']);
}

/**
* {@inheritdoc}
*/
protected function getDefaultFormatter()
protected function getDefaultFormatter(): FormatterInterface
{
$formatter = new ConsoleFormatter();
$formatter->allowInlineLineBreaks();
@@ -124,7 +125,7 @@ protected function getDefaultFormatter()
*
* @return bool Whether the handler is enabled and verbosity is not set to quiet
*/
private function updateLevel()
private function updateLevel(): bool
{
if (null === $this->output) {
return false;
44 changes: 19 additions & 25 deletions src/Core/Challenge/Dns/Route53Solver.php
Original file line number Diff line number Diff line change
@@ -92,7 +92,7 @@ public function solveAll(array $authorizationChallenges)
$recordIndex[$recordValue] = time();
}

$changesPerZone[$zone['Id']][] = $this->getSaveRecordQuery($recordName, $recordIndex);
$changesPerZone[$zone['Id']][] = $this->getChangeData('UPSERT', $recordName, $recordIndex);
}
}

@@ -138,43 +138,37 @@ public function cleanupAll(array $authorizationChallenges)
foreach ($authorizationChallengesPerRecordName as $recordName => $authorizationChallengesForRecordName) {
$challengeValues = array_unique(array_map([$this->extractor, 'getRecordValue'], $authorizationChallengesForRecordName));
$recordIndex = $this->getPreviousRecordIndex($zone['Id'], $recordName);

foreach ($challengeValues as $recordValue) {
unset($recordIndex[$recordValue]);
}
$changesPerZone[$zone['Id']][] = $this->getSaveRecordQuery($recordName, $recordIndex);
$changesPerZone[$zone['Id']][] = $this->getChangeData('DELETE', $recordName, $recordIndex);
}
}

foreach ($changesPerZone as $zoneId => $changes) {
$this->logger->info('Updating route 53 DNS', ['zone' => $zoneId]);
$this->client->changeResourceRecordSets(
[
'ChangeBatch' => [
'Changes' => $changes,
],
'HostedZoneId' => $zoneId,
]
);
$this->logger->info('Deleting route 53 DNS', ['zone' => $zoneId]);
$this->client->changeResourceRecordSets([
'ChangeBatch' => [
'Changes' => $changes,
],
'HostedZoneId' => $zoneId,
]);
}
}

private function getPreviousRecordIndex($zoneId, $recordName)
{
$previousRecordSets = $this->client->listResourceRecordSets([
'HostedZoneId' => $zoneId,
'HostedZoneId' => $zoneId,
'StartRecordName' => $recordName,
'StartRecordType' => 'TXT',
]);
$recordSets = array_filter(
$previousRecordSets['ResourceRecordSets'],
function ($recordSet) use ($recordName) {
static function ($recordSet) use ($recordName) {
return $recordSet['Name'] === $recordName && 'TXT' === $recordSet['Type'];
}
);
$recordIndex = [];
foreach ($recordSets as $previousRecordSet) {
$previousTxt = array_map(function ($resourceRecord) {
$previousTxt = array_map(static function ($resourceRecord) {
return stripslashes(trim($resourceRecord['Value'], '"'));
}, $previousRecordSet['ResourceRecords']);
// Search the special Index
@@ -196,7 +190,7 @@ function ($recordSet) use ($recordName) {
return $recordIndex;
}

private function getSaveRecordQuery($recordName, array $recordIndex)
private function getChangeData(string $action, string $recordName, array $recordIndex): array
{
//remove old indexes
$limitTime = time() - 86400;
@@ -210,10 +204,10 @@ private function getSaveRecordQuery($recordName, array $recordIndex)
$recordValues[] = json_encode($recordIndex);

return [
'Action' => 'UPSERT',
'Action' => $action,
'ResourceRecordSet' => [
'Name' => $recordName,
'ResourceRecords' => array_map(function ($recordValue) {
'ResourceRecords' => array_map(static function ($recordValue) {
return [
'Value' => sprintf('"%s"', addslashes($recordValue)),
];
@@ -229,7 +223,7 @@ private function getSaveRecordQuery($recordName, array $recordIndex)
*
* @return AuthorizationChallenge[][]
*/
private function groupAuthorizationChallengesPerDomain(array $authorizationChallenges)
private function groupAuthorizationChallengesPerDomain(array $authorizationChallenges): array
{
$groups = [];
foreach ($authorizationChallenges as $authorizationChallenge) {
@@ -244,7 +238,7 @@ private function groupAuthorizationChallengesPerDomain(array $authorizationChall
*
* @return AuthorizationChallenge[][]
*/
private function groupAuthorizationChallengesPerRecordName(array $authorizationChallenges)
private function groupAuthorizationChallengesPerRecordName(array $authorizationChallenges): array
{
$groups = [];
foreach ($authorizationChallenges as $authorizationChallenge) {
@@ -258,7 +252,7 @@ private function getZone($domain)
{
$domainParts = explode('.', $domain);
$domains = array_reverse(array_map(
function ($index) use ($domainParts) {
static function ($index) use ($domainParts) {
return implode('.', \array_slice($domainParts, \count($domainParts) - $index));
},
range(0, \count($domainParts))
@@ -274,7 +268,7 @@ function ($index) use ($domainParts) {
throw new ChallengeFailedException(sprintf('Unable to find a zone for the domain "%s"', $domain));
}

private function getZones()
private function getZones(): array
{
if (null !== $this->cacheZones) {
return $this->cacheZones;