mirror of
https://github.com/getnamingo/registry.git
synced 2025-07-22 02:25:59 +02:00
Fixed #131
This commit is contained in:
parent
7e215b4932
commit
6211256e65
2 changed files with 2 additions and 6 deletions
|
@ -7,8 +7,7 @@ return [
|
||||||
'db_database' => 'registry',
|
'db_database' => 'registry',
|
||||||
'db_username' => 'your_username',
|
'db_username' => 'your_username',
|
||||||
'db_password' => 'your_password',
|
'db_password' => 'your_password',
|
||||||
'epp_host' => '0.0.0.0',
|
'epp_host' => '::', // Set to 0.0.0.0 if no IPv6 support
|
||||||
'epp_host_ipv6' => '::', // Set to false if no IPv6 support
|
|
||||||
'epp_port' => 700,
|
'epp_port' => 700,
|
||||||
'epp_pid' => '/var/run/epp.pid',
|
'epp_pid' => '/var/run/epp.pid',
|
||||||
'epp_greeting' => 'Namingo EPP Server 1.0',
|
'epp_greeting' => 'Namingo EPP Server 1.0',
|
||||||
|
|
|
@ -48,9 +48,6 @@ $pool = new Swoole\Database\PDOPool(
|
||||||
|
|
||||||
Swoole\Runtime::enableCoroutine();
|
Swoole\Runtime::enableCoroutine();
|
||||||
$server = new Server($c['epp_host'], $c['epp_port']);
|
$server = new Server($c['epp_host'], $c['epp_port']);
|
||||||
if ($c['epp_host_ipv6'] !== false) {
|
|
||||||
//$server->addListener($c['epp_host_ipv6'], $c['epp_port'], SWOOLE_SOCK_TCP6);
|
|
||||||
}
|
|
||||||
$server->set([
|
$server->set([
|
||||||
'enable_coroutine' => true,
|
'enable_coroutine' => true,
|
||||||
'log_file' => '/var/log/namingo/epp_application.log',
|
'log_file' => '/var/log/namingo/epp_application.log',
|
||||||
|
@ -78,7 +75,7 @@ $log->info('Namingo EPP server started');
|
||||||
$server->handle(function (Connection $conn) use ($table, $pool, $c, $log, $permittedIPsTable, $rateLimiter) {
|
$server->handle(function (Connection $conn) use ($table, $pool, $c, $log, $permittedIPsTable, $rateLimiter) {
|
||||||
// Get the client information
|
// Get the client information
|
||||||
$clientInfo = $conn->exportSocket()->getpeername();
|
$clientInfo = $conn->exportSocket()->getpeername();
|
||||||
$clientIP = $clientInfo['address'] ?? '';
|
$clientIP = isset($clientInfo['address']) ? (strpos($clientInfo['address'], '::ffff:') === 0 ? substr($clientInfo['address'], 7) : $clientInfo['address']) : '';
|
||||||
|
|
||||||
// Check if the IP is in the permitted list
|
// Check if the IP is in the permitted list
|
||||||
if (!$permittedIPsTable->exist($clientIP)) {
|
if (!$permittedIPsTable->exist($clientIP)) {
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue