Housekeeping

This commit is contained in:
Pinga 2023-11-27 13:54:43 +02:00
parent f3cbf5b2af
commit 147ddb4861
7 changed files with 65 additions and 6 deletions

View file

@ -75,8 +75,16 @@ ln -s /usr/share/adminer/latest.php /usr/share/adminer/adminer.php
## 4. Download Namingo:
First, clone the Namingo registry repository into the `/opt/registry` directory:
```bash
git clone https://github.com/getnamingo/registry
git clone https://github.com/getnamingo/registry /opt/registry
```
Next, create the directory for Namingo logs. This directory will be used to store log files generated by the Namingo registry:
```bash
mkdir -p /var/log/namingo
```
## 5. Edit ```/etc/caddy/Caddyfile``` and place the following content:
@ -203,7 +211,7 @@ Navigate to the automation directory in your command line interface.
Execute the following command to install the necessary dependencies:
```bash
composer require badcow/dns phpseclib/phpseclib
composer require badcow/dns phpseclib/phpseclib phpbu/phpbu
```
This command will install the ```badcow/dns``` and ```phpseclib/phpseclib``` packages which are essential for the automation script to function correctly.
@ -224,6 +232,14 @@ composer require phpmailer/phpmailer
This command will install one of the packages which are essential for the notification script to function correctly.
### Configuring the Crontab for Automation Scripts
To set up automated tasks for Namingo, open the example crontab file located at ```/opt/registry/automation/crontab.example```. Review the contents and copy the relevant lines into your system's crontab file. Remember to adjust the paths and timings as necessary to suit your environment.
### Running the `notifications.php` Script in the Background
To run the notifications.php script as a background process, execute the following command: ```/usr/bin/php /opt/registry/automation/notifications.php &```. This will start the script and place it in the background, allowing it to run independently of your current terminal session.
## 11. RDE (Registry data escrow) configuration:
### Generate the Key Pair:

View file

@ -0,0 +1,36 @@
#----------> Crontab Configuration for Namingo <--------------------------------#
# run write-zone.php every 15 min.
*/15 * * * * root /usr/bin/php8.2 /opt/registry/automation/write-zone.php >> /var/log/namingo/write-zone.log
# run statistics.php at 59 min, every hour
59 * * * * root /usr/bin/php8.2 /opt/registry/automation/statistics.php >> /var/log/namingo/statistics.log
# run backup at 59 min, every hour
59 * * * * /opt/registry/automation/vendor/bin/phpbu --configuration=/opt/registry/automation/backup.xml
# run change-domain-status.php every hour
30 * * * * root /usr/bin/php8.2 /opt/registry/automation/change-domain-status.php >> /var/log/namingo/change-domain-status.log
# run auto-approve-transfer.php every hour
45 * * * * root /usr/bin/php8.2 /opt/registry/automation/auto-approve-transfer.php >> /var/log/namingo/auto-approve-transfer.log
# run send-invoice.php every 1st day
1 0 1 * * root /usr/bin/php8.2 /opt/registry/automation/send-invoice.php >> /var/log/namingo/send-invoice.log
# run auto-clean-unused-contact-and-host.php every day
5 0 * * * root /usr/bin/php8.2 /opt/registry/automation/auto-clean-unused-contact-and-host.php >> /var/log/namingo/auto-clean-unused-contact-and-host.log
# run tmch.php every day
5 0 * * * root /usr/bin/php8.2 /opt/registry/automation/tmch.php >> /var/log/namingo/tmch.log
# run escrow.php every day
5 0 * * * root /usr/bin/php8.2 /opt/registry/automation/escrow.php >> /var/log/namingo/escrow.log
# run reporting.php every 1st day
1 0 1 * * root /usr/bin/php8.2 /opt/registry/automation/reporting.php >> /var/log/namingo/reporting.log
# run urs.php every hour
45 * * * * root /usr/bin/php8.2 /opt/registry/automation/urs.php >> /var/log/namingo/urs.log
#----------> End Crontab Configuration for Namingo <----------------------------#

View file

@ -24,6 +24,13 @@ $c = require_once 'config.php';
require_once 'helpers.php';
$server = new Server("127.0.0.1", 8250);
$server->set([
'daemonize' => false,
'log_file' => '/var/log/namingo/notifications.log',
'log_level' => SWOOLE_LOG_INFO,
'worker_num' => swoole_cpu_num() * 2,
'pid_file' => '/var/run/notifications.pid'
]);
$server->on("request", function (Request $request, Response $response) use ($c) {
// Parse the received data

View file

@ -8,7 +8,7 @@ if (!extension_loaded('swoole')) {
$server = new Swoole\Server('0.0.0.0', 1043);
$server->set([
'daemonize' => false,
'log_file' => '/var/log/das/das.log',
'log_file' => '/var/log/namingo/das.log',
'log_level' => SWOOLE_LOG_INFO,
'worker_num' => swoole_cpu_num() * 2,
'pid_file' => '/var/run/das.pid',

View file

@ -31,7 +31,7 @@ Swoole\Runtime::enableCoroutine();
$server = new Server($c['epp_host'], $c['epp_port']);
$server->set([
'enable_coroutine' => true,
'log_file' => '/var/log/epp/epp.log',
'log_file' => '/var/log/namingo/epp.log',
'log_level' => SWOOLE_LOG_INFO,
'worker_num' => swoole_cpu_num() * 4,
'pid_file' => $c['epp_pid'],

View file

@ -60,7 +60,7 @@ function mapContactToVCard($contactDetails, $role, $c) {
$http = new Swoole\Http\Server('0.0.0.0', 7500);
$http->set([
'daemonize' => false,
'log_file' => '/var/log/rdap/rdap.log',
'log_file' => '/var/log/namingo/rdap.log',
'log_level' => SWOOLE_LOG_INFO,
'worker_num' => swoole_cpu_num() * 2,
'pid_file' => '/var/run/rdap.pid',

View file

@ -8,7 +8,7 @@ if (!extension_loaded('swoole')) {
$server = new Swoole\Server('0.0.0.0', 43);
$server->set([
'daemonize' => false,
'log_file' => '/var/log/whois/whois.log',
'log_file' => '/var/log/namingo/whois.log',
'log_level' => SWOOLE_LOG_INFO,
'worker_num' => swoole_cpu_num() * 2,
'pid_file' => '/var/run/whois.pid',