1
0
mirror of https://github.com/PurpleI2P/regi2p.git synced 2025-01-13 19:27:51 +00:00
Domain registry project http://reg.i2p/
Go to file
r4sas 932fca796f
[checker] print time to logs
Signed-off-by: r4sas <r4sas@i2pmail.org>
2023-05-02 18:16:00 +00:00
bin reg.i2p files 2021-02-21 17:02:38 +00:00
cache reg.i2p files 2021-02-21 17:02:38 +00:00
lib [checker] print time to logs 2023-05-02 18:16:00 +00:00
logs reg.i2p files 2021-02-21 17:02:38 +00:00
public move routing defining inside class 2022-06-12 00:00:24 +00:00
sql save re-registered records to "outdated" table 2022-08-28 20:15:06 +00:00
templates changes on hidden records page 2023-02-19 11:46:55 +00:00
tmp reg.i2p files 2021-02-21 17:02:38 +00:00
views changes on hidden records page 2023-02-19 11:46:55 +00:00
.gitattributes update git ignorance files 2021-02-23 14:38:32 +00:00
.gitignore add lockfile for checker 2023-02-19 11:46:13 +00:00
checker.php [checker] print time to logs 2023-05-02 18:16:00 +00:00
composer.json reg.i2p files 2021-02-21 17:02:38 +00:00
composer.lock update composer lockfile 2023-02-19 11:47:17 +00:00
config.php.dist make checker threads configurable 2022-08-28 19:32:52 +00:00
export.php various security, functional and validation changes 2021-07-15 22:37:33 +00:00
fetch.php push recent updates 2022-06-06 17:57:49 +00:00
import.php update code 2021-06-27 16:05:27 +00:00
LICENSE reg.i2p files 2021-02-21 17:02:38 +00:00
README.md add sql dump of service data at 210913-173000 2021-09-13 17:41:48 +00:00

Registry - reg.i2p

This is reg.i2p domain registry code

Requirements

  • i2pd with enabled BOB protocol
  • verifyhost binary built inside i2pd-tools project folder. It must be placed in bin directory
  • PHP and php-fpm 7.2+
  • php-intl package on PHP 7.4+ (php7.4-intl as example on Debian with PHP 7.4)
  • Composer
  • Corntab (for jobs)

Installation

  1. Clone repository in your webserver working directory. Note: that must not be /var/www/html or something like this, your webserver must point to public directory of forked project.
  2. Fetch requirements by runnning composer update.
  3. Copy config.php.dist to config.php and conigure project for your needs
  4. Point your webserver to serving webpages from public directory.
  5. Create cron jobs for quering and updating hosts lists.

Configuration examples below are using /home/www/reg.i2p as website homedir. Note that files inside that directory must be owned by php user (usually it is www-data):

nginx configuration

server {
    listen       127.0.0.1:8000;

    access_log   /dev/null;
    error_log    /dev/null;

    root         /home/www/reg.i2p/public;
    index        index.php index.html;
    port_in_redirect off;

    location ~* ^/hosts\.txt$ {
        if ($http_if_none_match) {
            rewrite ^/hosts\.txt$ /export/hosts.txt break;
        }

        rewrite ^/hosts\.txt$ /export/hosts-basic.txt break;
    }

    location / {
        try_files $uri $uri/ /index.php$request_uri;
    }

    location ~ ^/index\.php(/|$) {
        include       fastcgi_params;
        fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
        fastcgi_param SERVER_PORT     80;
        fastcgi_pass  unix:/home/www/reg.i2p/tmp/php-fpm.sock;
    }
}

php-fpm configuration

[reg.i2p]

prefix = /home/www/$pool
user = www-data
group = www-data
listen = tmp/php-fpm.sock

listen.owner = www-data
listen.group = www-data
listen.mode = 0660

pm = dynamic
pm.max_children = 5
pm.start_servers = 1
pm.min_spare_servers = 1
pm.max_spare_servers = 2
pm.max_requests = 500

chdir = public

php_admin_flag[log_errors] = On
php_admin_flag[display_errors] = Off
php_admin_value[error_reporting] = E_ALL
php_admin_value[error_log] = /home/www/$pool/logs/php-error.log

php_admin_value[upload_tmp_dir] = /home/www/$pool/tmp
php_admin_value[date.timezone] = Etc/UTC

php_admin_value[session.save_path] = /home/www/$pool/sessions
php_admin_value[session.save_handler] = files
php_admin_value[session.gc_probability] = 2
php_admin_value[session.gc_maxlifetime] = 1440

php_admin_value[memory_limit] = 32M
php_admin_value[upload_max_filesize] = "2M"
php_admin_value[max_execution_time] = 60

Cron jobs

5 * * * *    php7.2 /home/www/reg.i2p/checker.php > /home/www/reg.i2p/logs/checker.log 2>&1
45 */6 * * * php7.2 /home/www/reg.i2p/export.php  > /home/www/reg.i2p/logs/export.log  2>&1
50 23 * * *  php7.2 /home/www/reg.i2p/fetch.php   > /home/www/reg.i2p/logs/fetch.log   2>&1