Skip to content

Commit

Permalink
Merge branch 'release/4.1.0'
Browse files Browse the repository at this point in the history
  • Loading branch information
roy-bongers committed Feb 3, 2024
2 parents 5db8c15 + 405102a commit b8dbdd4
Show file tree
Hide file tree
Showing 14 changed files with 52 additions and 51 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/code-style.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ jobs:
name: Code Syle

steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v4
- name: PHP-CS-Fixer
uses: docker://oskarstark/php-cs-fixer-ga
with:
Expand Down
22 changes: 11 additions & 11 deletions .github/workflows/docker.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,32 +10,32 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v2
uses: actions/checkout@v4

- name: Docker meta
id: docker_meta
uses: crazy-max/ghaction-docker-meta@v1
uses: docker/metadata-action@v5
with:
images: rbongers/certbot-dns-transip
tag-semver: |
{{version}}
{{major}}.{{minor}}
{{major}}
tags: |
type=semver,pattern={{version}}
type=semver,pattern={{major}}.{{minor}}
type=semver,pattern={{major}}
- name: Set up QEMU
uses: docker/setup-qemu-action@v1
uses: docker/setup-qemu-action@v3

- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v1
- name: Set up Docker Build
uses: docker/setup-buildx-action@v3

- name: Login to DockerHub
uses: docker/login-action@v1
uses: docker/login-action@v3
with:
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_PASSWORD }}

- name: Build and push
uses: docker/build-push-action@v2
uses: docker/build-push-action@v5
with:
context: .
file: ./Dockerfile
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/phpunit.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,10 @@ jobs:
strategy:
fail-fast: false
matrix:
php-versions: ['8.0', '8.1', '8.2']
php-versions: ['8.1', '8.2', '8.3']

steps:
- uses: actions/checkout@v1
- uses: actions/checkout@v4

- name: Setup PHP ${{ matrix.php-versions }}
uses: shivammathur/setup-php@v2
Expand All @@ -30,7 +30,7 @@ jobs:
run: |
echo "::set-output name=dir::$(composer config cache-files-dir)"
- uses: actions/cache@v1
- uses: actions/cache@v4
with:
path: ${{ steps.composer-cache.outputs.dir }}
key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.lock') }}
Expand Down
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ letsencrypt

# PHPUnit
.phpunit.result.cache
.phpunit.cache
.php_cs
.php-cs-fixer.dist.php
.php_cs.cache
Expand Down
17 changes: 9 additions & 8 deletions .php-cs-fixer.dist.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,13 +15,14 @@
return (new Config())
->setRules(
[
'@Symfony' => true,
'array_syntax' => ['syntax' => 'short'],
'no_unused_imports' => true,
'trailing_comma_in_multiline' => ['elements' => ['arrays']],
'increment_style' => ['style' => 'post'],
'concat_space' => ['spacing' => 'one'],
'single_line_throw' => false,
'global_namespace_import' => ['import_classes' => true],
'@Symfony' => true,
'array_syntax' => ['syntax' => 'short'],
'no_unused_imports' => true,
'trailing_comma_in_multiline' => ['elements' => ['arrays']],
'increment_style' => ['style' => 'post'],
'concat_space' => ['spacing' => 'one'],
'single_line_throw' => false,
'global_namespace_import' => ['import_classes' => true],
'operator_linebreak' => ['position' => 'end', 'only_booleans' => true],
]
)->setFinder($finder);
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,9 @@ All notable changes to this project will be documented in this file.
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

## [4.1.0] - 2024-02-03
- Add PHP 8.3 support, drop PHP 8.0 support

## [4.0.1] - 2023-01-12
- Fixes incorrectly merged branch

Expand Down Expand Up @@ -134,6 +137,7 @@ make it easier to add support for additional providers.
- Don't query already up-to-date nameservers.
- In the cleanup hook only remove the TXT record with the challenge string received from Certbot. Used to remove all `_acme-challenge` TXT records.

[4.1.0]: https://github.com/roy-bongers/certbot-transip-dns-01-validator/compare/v4.0.1...v4.1.0
[4.0.1]: https://github.com/roy-bongers/certbot-transip-dns-01-validator/compare/v4.0.0...v4.0.1
[4.0.0]: https://github.com/roy-bongers/certbot-transip-dns-01-validator/compare/v3.0.2...v4.0.0
[3.0.2]: https://github.com/roy-bongers/certbot-transip-dns-01-validator/compare/v3.0.1...v3.0.2
Expand Down
1 change: 1 addition & 0 deletions auth-hook
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
#!/usr/bin/env php
<?php

declare(strict_types=1);

define('APP_ROOT', __DIR__);
Expand Down
1 change: 1 addition & 0 deletions cleanup-hook
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
#!/usr/bin/env php
<?php

declare(strict_types=1);

define('APP_ROOT', __DIR__);
Expand Down
13 changes: 8 additions & 5 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -22,15 +22,15 @@
},
"require": {
"php": "^8.0",
"monolog/monolog": "^2.0",
"monolog/monolog": "^3.5",
"purplepixie/phpdns": "dev-master",
"php-di/php-di": "^6.0",
"php-di/php-di": "^7.0",
"transip/transip-api-php": "^6.3"
},
"require-dev": {
"phpunit/phpunit": "^9.0",
"phpunit/phpunit": "^10.5",
"mockery/mockery": "^1.3.0",
"symfony/phpunit-bridge": "^6.0",
"symfony/phpunit-bridge": "^7.0",
"friendsofphp/php-cs-fixer": "^3.0"
},
"autoload": {
Expand All @@ -56,7 +56,10 @@
},
"config": {
"platform": {
"php": "8.0"
"php": "8.1"
},
"allow-plugins": {
"php-http/discovery": true
}
}
}
18 changes: 6 additions & 12 deletions phpunit.xml
Original file line number Diff line number Diff line change
@@ -1,14 +1,8 @@
<?xml version="1.0" encoding="UTF-8"?>
<phpunit
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="https://schema.phpunit.de/8.0/phpunit.xsd"
bootstrap="vendor/autoload.php">
<listeners>
<listener class="\Symfony\Bridge\PhpUnit\SymfonyTestsListener"/>
</listeners>
<testsuites>
<testsuite name="certbot">
<directory>./tests</directory>
</testsuite>
</testsuites>
<phpunit xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="https://schema.phpunit.de/10.5/phpunit.xsd" bootstrap="vendor/autoload.php" cacheDirectory=".phpunit.cache">
<testsuites>
<testsuite name="certbot">
<directory>./tests</directory>
</testsuite>
</testsuites>
</phpunit>
1 change: 0 additions & 1 deletion src/app.php
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@

// build dependency injection container
$builder = new ContainerBuilder();
$builder->useAnnotations(false);
$builder->addDefinitions(array_map('DI\get', $providers));
$builder->addDefinitions(
[
Expand Down
5 changes: 2 additions & 3 deletions tests/CertbotDns01/Certbot/AuthHookTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@

namespace RoyBongers\Tests\CertbotDns01\Certbot;

use Hamcrest\Matchers;
use Mockery;
use PHPUnit\Framework\TestCase;
use Psr\Log\NullLogger;
Expand Down Expand Up @@ -34,7 +33,7 @@ public function testAuthHookWithPrimaryDomain(): void
'AfricanOrEuropeanSwallow'
);
$this->provider->shouldReceive('createChallengeDnsRecord')
->with(Matchers::equalTo($expectedChallengeRecord))
->with(Mockery::on(fn (ChallengeRecord $challengeRecord) => $challengeRecord == $expectedChallengeRecord))
->once();

$this->provider->shouldReceive('getNameservers')
Expand Down Expand Up @@ -62,7 +61,7 @@ public function testAuthHookWithSubDomain(): void
);

$this->provider->shouldReceive('createChallengeDnsRecord')
->with(Matchers::equalTo($expectedChallengeRecord))
->with(Mockery::on(fn ($challengeRecord) => $expectedChallengeRecord == $challengeRecord))
->once();

$this->provider->shouldReceive('getNameservers')
Expand Down
5 changes: 2 additions & 3 deletions tests/CertbotDns01/Certbot/CleanupHookTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@

namespace RoyBongers\Tests\CertbotDns01\Certbot;

use Hamcrest\Matchers;
use Mockery;
use PHPUnit\Framework\TestCase;
use Psr\Log\NullLogger;
Expand All @@ -29,7 +28,7 @@ public function testCleanupHookWithPrimaryDomain(): void
);

$this->provider->shouldReceive('cleanChallengeDnsRecord')
->with(Matchers::equalTo($expectedChallengeRecord))
->with(Mockery::on(fn (ChallengeRecord $challengeRecord) => $challengeRecord == $expectedChallengeRecord))
->once();

$this->expectNotToPerformAssertions();
Expand All @@ -49,7 +48,7 @@ public function testCleanupHookWithSubDomain(): void
);

$this->provider->shouldReceive('cleanChallengeDnsRecord')
->with(Matchers::equalTo($expectedChallengeRecord))
->with(Mockery::on(fn (ChallengeRecord $challengeRecord) => $challengeRecord == $expectedChallengeRecord))
->once();

$this->expectNotToPerformAssertions();
Expand Down
7 changes: 3 additions & 4 deletions tests/CertbotDns01/Providers/TransIpTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@

namespace RoyBongers\Tests\CertbotDns01\Providers;

use Hamcrest\Matchers;
use Mockery;
use Mockery\Adapter\Phpunit\MockeryPHPUnitIntegration;
use PHPUnit\Framework\TestCase;
Expand Down Expand Up @@ -36,7 +35,7 @@ public function testItCreatesChallengeDnsRecord(): void
);

$this->dnsService->shouldReceive('addDnsEntryToDomain')
->with('domain.com', Matchers::equalTo($expectedDnsEntry))
->with('domain.com', Mockery::on(fn (DnsEntry $dnsEntry) => $dnsEntry == $expectedDnsEntry))
->once();

$this->transIp->createChallengeDnsRecord(
Expand Down Expand Up @@ -69,7 +68,7 @@ public function testItCleansChallengeDnsRecord(): void

// assert the challenge record is being removed.
$this->dnsService->shouldReceive('removeDnsEntry')
->with('domain.com', Matchers::identicalTo($challengeDnsEntry))
->with('domain.com', Mockery::on(fn (DnsEntry $dnsEntry) => $dnsEntry === $challengeDnsEntry))
->once();

$this->transIp->cleanChallengeDnsRecord(
Expand All @@ -96,7 +95,7 @@ function (string $domain) {
$this->assertEquals($domainNames, $this->transIp->getDomainNames());
}

private function generateDnsRecords(DnsEntry $additionalDnsEntry = null): array
private function generateDnsRecords(?DnsEntry $additionalDnsEntry = null): array
{
$dnsEntries = [
[
Expand Down

0 comments on commit b8dbdd4

Please sign in to comment.