add dns checks for vhosts
This commit is contained in:
parent
999993855a
commit
5835cef7ca
|
@ -37,6 +37,24 @@ class Vhosts extends \Panel\Vhost {
|
||||||
$cert_array['alternative'] = $alternative;
|
$cert_array['alternative'] = $alternative;
|
||||||
$f3->set('cert_array', $cert_array);
|
$f3->set('cert_array', $cert_array);
|
||||||
}
|
}
|
||||||
|
} else {
|
||||||
|
/* no cert, get dns info */
|
||||||
|
$dnsinfo = array();
|
||||||
|
$dnsinfo['server_addr'] = $_SERVER['SERVER_ADDR'];
|
||||||
|
# A record
|
||||||
|
$dnsinfo['a']['color'] = "red";
|
||||||
|
if ($certdomain_dns = dns_get_record("$vhost", DNS_A)) {
|
||||||
|
if ($certdomain_dns[0]['ip'] == $dnsinfo['server_addr']) {
|
||||||
|
$dnsinfo['a']['status'] = "Verified";
|
||||||
|
$dnsinfo['a']['color'] = "black";
|
||||||
|
$dnsinfo['verified_count']++;
|
||||||
|
} else {
|
||||||
|
$dnsinfo['a']['status'] = "Update";
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
$dnsinfo['a']['status'] = "Create";
|
||||||
|
}
|
||||||
|
$f3->set('dnsinfo', $dnsinfo);
|
||||||
}
|
}
|
||||||
/* get user info */
|
/* get user info */
|
||||||
$username = $vhost_array[0]['username'];
|
$username = $vhost_array[0]['username'];
|
||||||
|
@ -66,12 +84,12 @@ class Vhosts extends \Panel\Vhost {
|
||||||
|
|
||||||
if ($f3->exists('PARAMS.vhost')) {
|
if ($f3->exists('PARAMS.vhost')) {
|
||||||
|
|
||||||
$vhost_array = $f3->get('vhost_array');
|
// $vhost_array = $f3->get('vhost_array');
|
||||||
|
|
||||||
/* convert data for frontend display */
|
/* convert data for frontend display */
|
||||||
// nothing to convert
|
// nothing to convert
|
||||||
|
|
||||||
$f3->set('vhost_array', $vhost_array);
|
// $f3->set('vhost_array', $vhost_array);
|
||||||
|
|
||||||
$vhost = $f3->get('PARAMS.vhost');
|
$vhost = $f3->get('PARAMS.vhost');
|
||||||
$f3->set('page_header', "Details for $vhost");
|
$f3->set('page_header', "Details for $vhost");
|
||||||
|
|
|
@ -34,32 +34,61 @@
|
||||||
</tr>
|
</tr>
|
||||||
</table>
|
</table>
|
||||||
|
|
||||||
<br><br>
|
|
||||||
|
|
||||||
<check if="isset(@cert_array)">
|
<check if="isset(@cert_array)">
|
||||||
<true>
|
<true>
|
||||||
<table>
|
<br><br>
|
||||||
<tr>
|
<table>
|
||||||
<th style="white-space: nowrap;">Certificate</th>
|
<tr>
|
||||||
<th style="white-space: nowrap;">Expiration</th>
|
<th style="white-space: nowrap;">Certificate</th>
|
||||||
<th style="white-space: nowrap;">Secured Hostnames</th>
|
<th style="white-space: nowrap;">Expiration</th>
|
||||||
<th>Action</th>
|
<th style="white-space: nowrap;">Secured Hostnames</th>
|
||||||
</tr>
|
<th>Action</th>
|
||||||
<tr>
|
</tr>
|
||||||
<td style="white-space: nowrap;">{{ @cert_array.common }}</td>
|
<tr>
|
||||||
<td style="white-space: nowrap;">{{ @cert_array.end }}</td>
|
<td style="white-space: nowrap;">{{ @cert_array.common }}</td>
|
||||||
<td style="white-space: nowrap; text-align: right;">{{ @cert_array.alternative | raw }}</td>
|
<td style="white-space: nowrap;">{{ @cert_array.end }}</td>
|
||||||
<td style="white-space: nowrap;"><a href="{{@BASE}}/Certs/{{@vhost_array.virtualhost}}/Delete?r={{@PATH}}">Delete</a></td>
|
<td style="white-space: nowrap; text-align: right;">{{ @cert_array.alternative | raw }}</td>
|
||||||
</tr>
|
<td style="white-space: nowrap;"><a href="{{@BASE}}/Certs/{{@vhost_array.virtualhost}}/Delete?r={{@PATH}}">Delete</a></td>
|
||||||
</table>
|
</tr>
|
||||||
</true>
|
</table>
|
||||||
<false>
|
<br><br>
|
||||||
<a href="{{@BASE}}/Certs/{{@vhost_array.virtualhost}}/Add?r={{@PATH}}">Add Security Certificate</a>
|
</true>
|
||||||
</false>
|
<false>
|
||||||
|
<hr>
|
||||||
|
<check if="{{ @dnsinfo.a.status=='Verified' }}">
|
||||||
|
<true>
|
||||||
|
You need a Security Certificate. <a href="{{@BASE}}/Certs/{{@vhost_array.virtualhost}}/Add?r={{@PATH}}">Click Here</a> to add one now.
|
||||||
|
</true>
|
||||||
|
<false>
|
||||||
|
<span style="color:red">You need a Security Certificate for {{ @vhost_array.virtualhost }}.</span>
|
||||||
|
<br>
|
||||||
|
Before you can add one you must make the DNS change listed below. Once that's completed come back here and this message will change to an option to create a Security Certificate.
|
||||||
|
<br>
|
||||||
|
<small>Note that after you add DNS records it can take some time for the changes to propagate and show up here.</small>
|
||||||
|
<br><br>
|
||||||
|
<table>
|
||||||
|
<tr><th style="color:{{ @dnsinfo.a.color }}" colspan="2">{{ @dnsinfo.a.status }} A Record for {{ @vhost_array.virtualhost }}</th></tr>
|
||||||
|
<tr><td style="text-align: right;">Type:</td><td>A</td></tr>
|
||||||
|
<tr><td style="text-align: right;">Host:</td><td>{{ @vhost_array.virtualhost }}</td></tr>
|
||||||
|
<tr><td style="text-align: right;">Value:</td><td>{{ @dnsinfo.server_addr }}</td></tr>
|
||||||
|
<tr><td style="text-align: right;">TTL:</td><td>3600 (or default)</td></tr>
|
||||||
|
<tr><td></td><td><small>This should be the only A record for {{ @vhost_array.virtualhost }}.</small></td></tr>
|
||||||
|
</table>
|
||||||
|
<br><br>
|
||||||
|
<table>
|
||||||
|
<tr><th style="color:{{ @dnsinfo.a.color }}" colspan="2">Verify CNAME Record for www.{{ @vhost_array.virtualhost }}</th></tr>
|
||||||
|
<tr><td style="text-align: right;">Type:</td><td>CNAME</td></tr>
|
||||||
|
<tr><td style="text-align: right;">Host:</td><td>www.{{ @vhost_array.virtualhost }}</td></tr>
|
||||||
|
<tr><td style="text-align: right;">Value:</td><td>{{ @vhost_array.virtualhost }}</td></tr>
|
||||||
|
<tr><td style="text-align: right;">TTL:</td><td>3600 (or default)</td></tr>
|
||||||
|
<tr><td></td><td><small>This should be the only record for www.{{ @vhost_array.virtualhost }}.<br>Note this admin did not check for this record, it may already exist.</small></td></tr>
|
||||||
|
</table>
|
||||||
|
</false>
|
||||||
|
</check>
|
||||||
|
<hr>
|
||||||
|
</false>
|
||||||
</check>
|
</check>
|
||||||
|
|
||||||
<br><br>
|
|
||||||
|
|
||||||
<table>
|
<table>
|
||||||
<tr><th colspan="2">Remote Access</th></tr>
|
<tr><th colspan="2">Remote Access</th></tr>
|
||||||
<tr><td style="text-align: right;">Protocol:</td><td>SFTP (SSH File Transfer Protocol)</td></tr>
|
<tr><td style="text-align: right;">Protocol:</td><td>SFTP (SSH File Transfer Protocol)</td></tr>
|
||||||
|
|
Loading…
Reference in New Issue
Block a user