mirror of https://github.com/PurpleI2P/regi2p.git
Domain registry project
http://reg.i2p/
You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
R4SAS
d208f102dd
|
1 year ago | |
---|---|---|
bin | 4 years ago | |
cache | 4 years ago | |
lib | 1 year ago | |
logs | 4 years ago | |
messages | 1 year ago | |
public | 2 years ago | |
sql | 2 years ago | |
templates | 1 year ago | |
tmp | 4 years ago | |
views | 1 year ago | |
.gitattributes | 4 years ago | |
.gitignore | 2 years ago | |
LICENSE | 4 years ago | |
README.md | 1 year ago | |
checker.php | 2 years ago | |
composer.json | 1 year ago | |
composer.lock | 1 year ago | |
config.dist.php | 1 year ago | |
export.php | 3 years ago | |
fetch.php | 2 years ago | |
import.php | 3 years ago |
README.md
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 inbin
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
- Clone repository in your webserver working directory. Note: that must not be
/var/www/html
or something like this, your webserver must point topublic
directory of forked project. - Fetch requirements by runnning
composer update
. - Copy
config.dist.php
toconfig.php
and conigure project for your needs - Point your webserver to serving webpages from
public
directory. - 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