servnest/pg-view/ht/add-dns.php

53 lines
2.4 KiB
PHP

<?php declare(strict_types=1); ?>
<p>
<?= _('A Let\'s Encrypt certificate will be obtained for this domain.') ?>
</p>
<p>
<?= sprintf(_('The AAAA, A and CAA records for the domain must resolve to the same values as %s. This can be done by creating a CNAME record pointing to this domain for a non-apex domain, or using a nonstandard "ALIAS", "synchronized" or "flattened CNAME" record for an apex domain. You may alternatively manually copy records values, but it\'ll require a manual update when these values change.'), '<code>' . CONF['ht']['cname'] . '</code>') ?>
</p>
<details>
<summary><?= _('Required values (for manual copy)') ?></summary>
<dl>
<dt><code>AAAA</code></dt>
<dd>
<code><?= CONF['ht']['ipv6_address'] ?></code>
</dd>
<dt><code>A</code></dt>
<dd>
<code><?= CONF['ht']['ipv4_address'] ?></code>
</dd>
<dt><code>CAA</code> (<?= _('useful for testing accounts only') ?>)</dt>
<?= (($_SESSION['type'] ?? '') === 'testing') ? '' : '<s>' ?>
<dd>
<code>0 issue "letsencrypt.org; validationmethods=http-01; accounturi=<?= CONF['ht']['caa_account_uris']['testing'] ?>"</code>
</dd>
<?= (($_SESSION['type'] ?? '') === 'testing') ? '' : '</s>' ?>
<dt><code>CAA</code> (<?= _('useful for approved accounts only') ?>)</dt>
<?= (($_SESSION['type'] ?? '') === 'approved') ? '' : '<s>' ?>
<dd>
<code>0 issue "letsencrypt.org; validationmethods=http-01; accounturi=<?= CONF['ht']['caa_account_uris']['approved'] ?>"</code>
</dd>
<?= (($_SESSION['type'] ?? '') === 'approved') ? '' : '</s>' ?>
</dl>
</details>
<p>
<?= sprintf(_('Also, to prove that you own this domain, its subdomain %1$s must have a TXT record equal to %2$s when the form is being processed.'), '<code>_auth</code>', '<code>' . SERVER_NAME . '_domain-verification=' . getAuthToken() . '</code>') ?>
</p>
<form method="post">
<label for="domain"><?= _('Domain') ?></label><br>
<input required="" placeholder="site.<?= PLACEHOLDER_DOMAIN ?>" id="domain" name="domain" type="text"><br>
<label for="dir"><?= _('Target directory') ?></label><br>
<select required="" name="dir" id="dir">
<option value="" disabled="" selected="">—</option>
<?php
foreach (dirsStatuses('dns') as $dir => $alreadyEnabled)
echo ' <option' . ($alreadyEnabled ? ' disabled=""' : '') . ' value="' . $dir . '">' . $dir . '</option>' . LF;
?>
</select>
<br>
<input type="submit" value="<?= _('Setup access') ?>">
</form>