First commit
This commit is contained in:
parent
b51de80896
commit
65a9afa752
9 changed files with 2923 additions and 1 deletions
82
README.md
82
README.md
|
@ -1 +1,81 @@
|
|||
# WHMCS-EPP-with-DNSsec-Registry-Registrar-Module-for-.CH-registry
|
||||
WHMCS EPP with DNSsec Registry-Registrar Module for .CH registry
|
||||
========================
|
||||
|
||||
This module require an Accredited Registrar account for .CH domains, it provide full functionality coverage for domains management and based on communication with Registry through Extensible Provisioning Protocol (EPP).
|
||||
|
||||
Requirements
|
||||
------------
|
||||
|
||||
* PHP 7.2 or higher;
|
||||
* WHMCS 7.7.0 or higher;
|
||||
|
||||
Installation
|
||||
------------
|
||||
|
||||
Upload via FTP the 'nicch' directory to <whmcs_root>/modules/registrars/
|
||||
Set write permissions for log file <whmcs_root>/modules/registrars/nicch/log/nicch.log
|
||||
|
||||
Generate .PEM certificate
|
||||
-------------------------
|
||||
|
||||
create .pfx file
|
||||
openssl pkcs12 -export -out certificate.pfx -inkey www.yourdomain.com.key -in yourdomain.com.crt -certfile CA_bundle.crt
|
||||
|
||||
```bash
|
||||
$ openssl pkcs12 -export -out certificate.pfx -inkey /etc/pki/tls/private/www.yourdomain.com.key -in /etc/pki/tls/certs/yourdomain.com.crt -certfile /etc/pki/tls/certs/gd_bundle.crt
|
||||
```
|
||||
|
||||
create PEM file
|
||||
|
||||
include PassPhrase
|
||||
|
||||
```bash
|
||||
$ openssl pkcs12 -in certificate.pfx -out certificate.cer -nodes
|
||||
```
|
||||
|
||||
or
|
||||
without PassPhrase
|
||||
|
||||
```bash
|
||||
$ openssl pkcs12 -in certificate.pfx -out certificate.cer
|
||||
```
|
||||
|
||||
Upload certificates
|
||||
-------------------
|
||||
|
||||
Copy certificate.cer to <whmcs_root>/modules/registrars/nicch/local_cert/certificate.cer
|
||||
Copy www.yourdomain.com.key to <whmcs_root>/modules/registrars/nicch/local_pk/www.yourdomain.com.key
|
||||
Copy a certificate authority file to <whmcs_root>/modules/registrars/nicch/cafile/
|
||||
|
||||
|
||||
or you may use https://letsencrypt.org/
|
||||
```bash
|
||||
$ dnf install git net-tools
|
||||
$ git clone https://github.com/certbot/certbot.git
|
||||
$ cd certbot/
|
||||
$ ./letsencrypt-auto --help
|
||||
$ systemctl stop httpd
|
||||
$ ./letsencrypt-auto certonly --standalone
|
||||
```
|
||||
|
||||
Test connection with the server
|
||||
-------------------------------
|
||||
|
||||
please make sure port 700 is not firewalled:
|
||||
|
||||
```bash
|
||||
$ telnet epp-test.switch.ch 700
|
||||
$ openssl s_client -showcerts -connect epp-test.switch.ch:700
|
||||
```
|
||||
|
||||
command line for acceptable client certificate CA names
|
||||
|
||||
```bash
|
||||
$ openssl s_client -showcerts -connect epp-test.switch.ch:700 -CAfile gd_bundle.crt
|
||||
```
|
||||
|
||||
command line to verify your own Certificate
|
||||
|
||||
```bash
|
||||
$ openssl s_client -showcerts -connect epp-test.switch.ch:700 -CAfile CA_bundle.crt -cert yourdomain.com.crt -key yourdomain.com.key
|
||||
```
|
||||
|
|
20
nicch/hooks.php
Normal file
20
nicch/hooks.php
Normal file
|
@ -0,0 +1,20 @@
|
|||
<?php
|
||||
/**
|
||||
*
|
||||
* NOTICE OF LICENSE
|
||||
*
|
||||
* @package NICCH
|
||||
* @version 1.0.1
|
||||
* @author Lilian Rudenco <info@xpanel.com>
|
||||
* @copyright 2019 Lilian Rudenco
|
||||
* @link http://www.xpanel.com/
|
||||
* @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0)
|
||||
*/
|
||||
|
||||
add_hook('ClientAreaHeadOutput', 1, function($vars) {
|
||||
$template = $vars['template'];
|
||||
return <<<HTML
|
||||
<script type="text/javascript" src="modules/registrars/nicch/js/scripts.js"></script>
|
||||
HTML;
|
||||
|
||||
});
|
75
nicch/hostNames.tpl
Normal file
75
nicch/hostNames.tpl
Normal file
|
@ -0,0 +1,75 @@
|
|||
<div class="alert alert-block alert-info">
|
||||
<p>{$LANG.domainname}: <strong>{$domain}</strong></p>
|
||||
</div>
|
||||
|
||||
{if $error}
|
||||
<div class="alert alert-error textcenter">
|
||||
{$error}
|
||||
</div>
|
||||
{else}
|
||||
{if $hosts eq 'YES'}
|
||||
<div class="form-group">
|
||||
<div class="col-xs-6"><b>Host</b></div>
|
||||
<div class="col-xs-4"><b>IP Addresses</b></div>
|
||||
<div class="col-xs-1"> </div>
|
||||
</div>
|
||||
<br />
|
||||
<hr>
|
||||
{foreach $hostList as $item}
|
||||
<form class="form-horizontal" role="form" method="post" action="clientarea.php" id="deleteHostForm">
|
||||
<input type="hidden" name="action" value="domaindetails" />
|
||||
<input type="hidden" name="id" value="{$domainid}" />
|
||||
<input type="hidden" name="modop" value="custom" />
|
||||
<input type="hidden" name="a" value="hostNames" />
|
||||
<input type="hidden" name="command" value="deleteHost" />
|
||||
<input type="hidden" name="host" value="{$item.host}" />
|
||||
|
||||
<div class="form-group">
|
||||
<div class="col-xs-6">{$item.host}</div>
|
||||
<div class="col-xs-3">{foreach $item.ips as $ipI => $ip}{$ip.ip}<br />{/foreach}</div>
|
||||
<div class="col-xs-1"><input type="submit" class="btn btn-primary" value="Delete" /></div>
|
||||
</div>
|
||||
</form>
|
||||
<hr>
|
||||
{/foreach}
|
||||
{else}
|
||||
<p style="font-size: 100%; text-align: center; background: #EEE; padding: 5px">{$hosts}</p>
|
||||
{/if}
|
||||
{/if}
|
||||
|
||||
<div id="addHost" class="form-group">
|
||||
<div class="col-xs-9"></div>
|
||||
<div class="col-xs-1"><button id="showCreateHost" class="btn btn-primary">Add</button></div>
|
||||
</div>
|
||||
|
||||
<br />
|
||||
|
||||
<div id="createHost" style="display: none;">
|
||||
<form class="form-horizontal" role="form" method="post" action="clientarea.php" id="createHostForm">
|
||||
<input type="hidden" name="action" value="domaindetails" />
|
||||
<input type="hidden" name="id" value="{$domainid}" />
|
||||
<input type="hidden" name="modop" value="custom" />
|
||||
<input type="hidden" name="a" value="hostNames" />
|
||||
<input type="hidden" name="command" value="createHost" />
|
||||
|
||||
<div class="form-group">
|
||||
<div class="col-xs-3"><input type="text" class="form-control" name="host" placeholder="Hostname" /></div>
|
||||
<div class="col-xs-3">.{$domainname}</div>
|
||||
<div class="col-xs-3"><input type="text" class="form-control" name="ipaddress[]" placeholder="IPv4 or IPv6 address" /></div>
|
||||
<div class="col-xs-1"></div>
|
||||
</div>
|
||||
|
||||
<div class="field_wrapper"></div>
|
||||
|
||||
<div class="form-group">
|
||||
<div class="col-xs-6"></div>
|
||||
<div class="col-xs-4"><a href="javascript:void(0);" class="add_button" title="Add field">Add IP Address</a></div>
|
||||
</div>
|
||||
</form>
|
||||
<p class="text-center">
|
||||
<button type="submit" form="createHostForm" class="btn btn-primary">Create Host</button>
|
||||
<button id="cancelCreateHost" class="btn btn-primary">Cancel</button>
|
||||
</p>
|
||||
</div>
|
||||
|
||||
<br />
|
BIN
nicch/img/remove-icon.png
Normal file
BIN
nicch/img/remove-icon.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 341 B |
30
nicch/js/scripts.js
Normal file
30
nicch/js/scripts.js
Normal file
|
@ -0,0 +1,30 @@
|
|||
$(document).ready(function(){
|
||||
var maxField = 10; //Input fields increment limitation
|
||||
var addButton = $('.add_button'); //Add button selector
|
||||
var wrapper = $('.field_wrapper'); //Input field wrapper
|
||||
var fieldHTML = '<div class="form-group"><div class="col-xs-6"></div><div class="col-xs-3"><input type="text" class="form-control" name="ipaddress[]" placeholder="IPv4 or IPv6 address" /></div><div class="col-xs-1"><a href="javascript:void(0);" class="remove_button" title="Remove field"><img src="modules/registrars/nicch/img/remove-icon.png"/></a></div></div>'; //New input field html
|
||||
var x = 1; //Initial field counter is 1
|
||||
|
||||
|
||||
$("#showCreateHost").click(function(){
|
||||
$("#createHost").show();
|
||||
$("#addHost").hide();
|
||||
});
|
||||
|
||||
$("#cancelCreateHost").click(function(){
|
||||
$("#createHost").hide();
|
||||
$("#addHost").show();
|
||||
});
|
||||
|
||||
$(addButton).click(function(){ //Once add button is clicked
|
||||
if(x < maxField){ //Check maximum number of input fields
|
||||
x++; //Increment field counter
|
||||
$(wrapper).append(fieldHTML); // Add field html
|
||||
}
|
||||
});
|
||||
$(wrapper).on('click', '.remove_button', function(e){ //Once remove button is clicked
|
||||
e.preventDefault();
|
||||
$(this).parent('div').parent('div').remove(); //Remove field html
|
||||
x--; //Decrement field counter
|
||||
});
|
||||
});
|
0
nicch/log/nicch.log
Normal file
0
nicch/log/nicch.log
Normal file
BIN
nicch/logo.gif
Normal file
BIN
nicch/logo.gif
Normal file
Binary file not shown.
After Width: | Height: | Size: 3.2 KiB |
81
nicch/manageDNSSECDSRecords.tpl
Normal file
81
nicch/manageDNSSECDSRecords.tpl
Normal file
|
@ -0,0 +1,81 @@
|
|||
<div class="alert alert-block alert-info">
|
||||
<p>{$LANG.domainname}: <strong>{$domain}</strong></p>
|
||||
</div>
|
||||
|
||||
{if $error}
|
||||
<div class="alert alert-error textcenter">
|
||||
{$error}
|
||||
</div>
|
||||
{else}
|
||||
{if $DSRecords eq 'YES'}
|
||||
<p style="font-size: 110%; text-align: center"><b>DS records:</b><br /></p>
|
||||
{foreach $DSRecordslist as $item}
|
||||
<div class="textcenter">
|
||||
<form method="post" action="clientarea.php">
|
||||
<input type="hidden" name="action" value="domaindetails" />
|
||||
<input type="hidden" name="id" value="{$domainid}" />
|
||||
<input type="hidden" name="modop" value="custom" />
|
||||
<input type="hidden" name="a" value="manageDNSSECDSRecords" />
|
||||
<input type="hidden" name="command" value="secDNSrem" />
|
||||
|
||||
<div>
|
||||
Key tag: <input name="keyTag" type="text" maxlength="65535" data-supported="True" data-required="True" value="{$item.keyTag}" />
|
||||
Algorithm: <input name="alg" data-supported="True" data-required="True" value="{$item.alg}">
|
||||
Digest type: <input name="digestType" data-supported="True" data-required="True" value="{$item.digestType}">
|
||||
Digest: <input name="digest" data-supported="True" data-required="True" value="{$item.digest}">
|
||||
</div>
|
||||
|
||||
<p class="text-center">
|
||||
<input type="submit" class="btn btn-primary" value="Remove DS Record" />
|
||||
</p>
|
||||
</form>
|
||||
</div>
|
||||
<br />
|
||||
{/foreach}
|
||||
{else}
|
||||
<p style="font-size: 200%; text-align: center; background: #EEE; padding: 5px">{$DSRecords}</p>
|
||||
{/if}
|
||||
{/if}
|
||||
|
||||
<hr>
|
||||
<div class="textcenter">
|
||||
<form method="post" action="clientarea.php">
|
||||
<input type="hidden" name="action" value="domaindetails" />
|
||||
<input type="hidden" name="id" value="{$domainid}" />
|
||||
<input type="hidden" name="modop" value="custom" />
|
||||
<input type="hidden" name="a" value="manageDNSSECDSRecords" />
|
||||
<input type="hidden" name="command" value="secDNSadd" />
|
||||
|
||||
<div>
|
||||
Key tag: <input name="keyTag" type="text" maxlength="65535" data-supported="True" data-required="True" data-previousvalue="" />
|
||||
|
||||
Algorithm: <select name="alg" data-supported="True" data-required="True" data-previousvalue="">
|
||||
<option value="1">1</option>
|
||||
<option value="2">2</option>
|
||||
<option value="3">3</option>
|
||||
<option value="4">4</option>
|
||||
<option value="5">5</option>
|
||||
<option value="6">6</option>
|
||||
<option value="7">7</option>
|
||||
<option value="8">8</option>
|
||||
<option value="10">10</option>
|
||||
<option value="12">12</option>
|
||||
<option value="13">13</option>
|
||||
<option value="253">253</option>
|
||||
<option value="254">254</option>
|
||||
</select>
|
||||
|
||||
Digest type: <select name="digestType" data-supported="True" data-required="True" data-previousvalue="">
|
||||
<option value="1">1</option>
|
||||
<option value="2">2</option>
|
||||
</select>
|
||||
</div>
|
||||
|
||||
<div>Digest: <textarea name="digest" rows="2" data-supported="True" data-required="True" data-previousvalue=""></textarea>
|
||||
</div>
|
||||
|
||||
<p class="text-center">
|
||||
<input type="submit" class="btn btn-primary" value="Create DS Record" />
|
||||
</p>
|
||||
</form>
|
||||
</div>
|
2636
nicch/nicch.php
Normal file
2636
nicch/nicch.php
Normal file
File diff suppressed because it is too large
Load diff
Loading…
Reference in a new issue