feat: make IPv6 CIDR prefix cap configurable via SYS_IP6_SUBNET_PREFIX_CAP env variable

This commit is contained in:
Rekryt 2025-05-14 22:27:17 +03:00
parent 2391db343a
commit fd0232debc
4 changed files with 17 additions and 14 deletions

View file

@ -4,6 +4,7 @@ SYS_DNS_RESOLVE_IP4="true"
SYS_DNS_RESOLVE_IP6="true"
SYS_DNS_RESOLVE_CHUNK_SIZE="10"
SYS_DNS_RESOLVE_DELAY="100"
SYS_IP6_SUBNET_PREFIX_CAP="64"
SYS_MEMORY_LIMIT="1024M"
SYS_TIMEZONE="Europe/Moscow"
DEBUG="true"

View file

@ -92,19 +92,20 @@ cp .env.example .env
If needed, edit the `.env` file:
| property | default value | description |
|----------------------------|---------------|-----------------------------------------------------------------|
| COMPOSE_PROJECT_NAME | iplist | Name of the compose project |
| STORAGE_SAVE_INTERVAL | 120 | Cache save interval for whois (seconds) |
| SYS_DNS_RESOLVE_IP4 | true | Resolve IPv4 addresses |
| SYS_DNS_RESOLVE_IP6 | true | Resolve IPv6 addresses |
| SYS_DNS_RESOLVE_CHUNK_SIZE | 10 | Chunk size for retrieving DNS records |
| SYS_DNS_RESOLVE_DELAY | 100 | Delay between receiving dns records (milliseconds) |
| SYS_MEMORY_LIMIT | 1024M | Memory limit |
| SYS_TIMEZONE | Europe/Moscow | List of URLs to obtain initial CIDRv4 zones for IPv4 addresses |
| HTTP_HOST | 0.0.0.0 | IP of network interface (default is all interfaces) |
| HTTP_PORT | 8080 | Server network port (default 8080) |
| DEBUG | true | Determines the logging level |
| property | default value | description |
|----------------------------|---------------|----------------------------------------------------------------|
| COMPOSE_PROJECT_NAME | iplist | Name of the compose project |
| STORAGE_SAVE_INTERVAL | 120 | Cache save interval for whois (seconds) |
| SYS_DNS_RESOLVE_IP4 | true | Resolve IPv4 addresses |
| SYS_DNS_RESOLVE_IP6 | true | Resolve IPv6 addresses |
| SYS_DNS_RESOLVE_CHUNK_SIZE | 10 | Chunk size for retrieving DNS records |
| SYS_DNS_RESOLVE_DELAY | 100 | Delay between receiving dns records (milliseconds) |
| SYS_IP6_SUBNET_PREFIX_CAP | 64 | The maximum allowed IPv6 subnet prefix length |
| SYS_MEMORY_LIMIT | 1024M | Memory limit |
| SYS_TIMEZONE | Europe/Moscow | List of URLs to obtain initial CIDRv4 zones for IPv4 addresses |
| HTTP_HOST | 0.0.0.0 | IP of network interface (default is all interfaces) |
| HTTP_PORT | 8080 | Server network port (default 8080) |
| DEBUG | true | Determines the logging level |
You can access the service in your browser via the HTTP protocol on port 8080:
```

View file

@ -102,6 +102,7 @@ cp .env.example .env
| SYS_DNS_RESOLVE_IP6 | true | Получать ipv6 адреса |
| SYS_DNS_RESOLVE_CHUNK_SIZE | 10 | Размер чанка для получения dns записей |
| SYS_DNS_RESOLVE_DELAY | 100 | Задержка между получением dns записей (миллисекунды) |
| SYS_IP6_SUBNET_PREFIX_CAP | 64 | Максимально допустимая длина префикса IPv6-подсети |
| SYS_MEMORY_LIMIT | 1024M | Предельное кол-во памяти. |
| SYS_TIMEZONE | Europe/Moscow | Список URL для получения начальных CIDRv4 зон ipv4 адресов |
| HTTP_HOST | 0.0.0.0 | IP сетевого интерфейса (по умолчанию все интерфейсы) |

View file

@ -101,7 +101,7 @@ class IP6Helper {
foreach (explode(' ', $search) as $cidr) {
if (str_contains($cidr, '/')) {
[$address, $prefix] = explode('/', trim($cidr));
$subnets[] = $address . '/' . min($prefix, 64);
$subnets[] = $address . '/' . min($prefix, \OpenCCK\getEnv('SYS_IP6_SUBNET_PREFIX_CAP') ?? 64);
}
}
}