Commit bbce1928 authored by dmorley's avatar dmorley
Browse files

fix txt query

parent ee950644
Pipeline #6511 failed with stages
in 50 seconds
......@@ -2,11 +2,20 @@
The format is based on [Keep a Changelog] and this project adheres to [Semantic Versioning].
## [Unreleased]
### Added
### Changed
### Deprecated
### Removed
### Fixed
### Security
## [2.9.0]
:exclamation: `config.php` changed - requires updates
### Added
- Show number of pods we check in the status page
- Limit menu by pod count to be able to not show softwares with just a few test pods. config.php change.
### Changed
- Small DNS change so you know why you might have a TXT record
### Deprecated
- All apiv1 support
### Removed
......@@ -318,6 +327,7 @@ The format is based on [Keep a Changelog] and this project adheres to [Semantic
[2.2.0-sql-migration]: https://git.feneas.org/diasporg/Poduptime/blob/master/db/migrations/2.1.4-2.2.0.sql
[Unreleased]: https://git.feneas.org/diasporg/Poduptime/compare/master...develop
[2.9.0]: https://git.feneas.org/diasporg/Poduptime/compare/2.8.2...2.9.0
[2.8.2]: https://git.feneas.org/diasporg/Poduptime/compare/2.8.1...2.8.2
[2.8.1]: https://git.feneas.org/diasporg/Poduptime/compare/2.8.0...2.8.1
[2.8.0]: https://git.feneas.org/diasporg/Poduptime/compare/2.7.0...2.8.0
......
......@@ -39,9 +39,14 @@ foreach ($pods as $pod) {
die('domain already exists and is registered to an owner, use the edit function to modify');
}
$digtxt = exec(escapeshellcmd('dig ' . $_domain . ' TXT +short'));
if (strpos($digtxt, $pod['publickey']) === false) {
die('domain already exists, you can claim the domain by adding a DNS TXT record that states<br><b> ' . $_domain . ' IN TXT "' . $pod['publickey'] . '"</b>');
$records = dns_get_record($_domain, DNS_TXT);
$key = array($pod['publickey']);
$filter = array_filter($records, function ($arr) use ($key) {
return in_array($arr['txt'], $key);
});
if (sizeof($filter) == 0) {
die('domain already exists, you can claim the domain by adding a DNS TXT record that states<br><b> ' . $_domain . ' IN TXT "' . $pod['publickey'] . '"</b><br>Refrech this page after updating your DNS records and giving time to propigate.');
}
echo 'domain validated, you can now add details ';
......@@ -102,7 +107,7 @@ if (!$stop) {
if ($output['body'] && stripos($output['body'], 'openRegistrations') !== false) {
echo 'Your pod has ssl and is valid<br>';
$publickey = md5(uniqid($_domain, true));
$publickey = "poduptime-site-verification=" . md5(uniqid($_domain, true));
try {
$p = R::dispense('pods');
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment