]>
Commit | Line | Data |
---|---|---|
1 | #!/usr/bin/perl | |
2 | ||
3 | use strict; | |
4 | use warnings; | |
5 | ||
6 | use lib '../'; | |
7 | ||
8 | use PVE::Tools qw(dir_glob_foreach); | |
9 | use PVE::ACME::DNSChallenge; | |
10 | ||
11 | my $dnsapi_path = '../acme.sh/dnsapi'; | |
12 | ||
13 | die "cannot find dnsapi path '$dnsapi_path'!\n" if ! -d $dnsapi_path; | |
14 | ||
15 | my $acmesh_plugins = []; | |
16 | dir_glob_foreach($dnsapi_path, qr/dns_(\S+)\.sh/, sub { | |
17 | my ($file, $provider) = @_; | |
18 | push @$acmesh_plugins, $provider; | |
19 | }); | |
20 | ||
21 | my $ok = 1; | |
22 | my $defined_plugins = PVE::ACME::DNSChallenge::get_supported_plugins(); | |
23 | ||
24 | # first check for missing ones, delete from hash so we can easily see if a plug got removed/renamed | |
25 | my $printed_missing = 0; | |
26 | for my $provider (sort @$acmesh_plugins) { | |
27 | my $schema = delete $defined_plugins->{$provider}; | |
28 | if (!defined($schema)) { | |
29 | print STDERR "missing (also adapt makefile!):\n" if !$printed_missing; | |
30 | print STDERR " '$provider' => {},\n"; | |
31 | $printed_missing = 1; | |
32 | $ok = 0; | |
33 | } | |
34 | } | |
35 | ||
36 | my $printed_extra = 0; | |
37 | for my $provider (sort keys %$defined_plugins) { | |
38 | print STDERR "extra:\n" if !$printed_extra; | |
39 | print STDERR " $provider\n"; | |
40 | $printed_extra = 1; | |
41 | $ok = 0; | |
42 | } | |
43 | ||
44 | die "schema not in sync with available plugins!\n" if !$ok; | |
45 | ||
46 | print STDERR "OK: DNS challenge schema in sync with available plugins.\n"; | |
47 | exit(0); |