Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
148 changes: 56 additions & 92 deletions client/package-lock.json

Large diffs are not rendered by default.

53 changes: 52 additions & 1 deletion client/src/__locales/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -758,5 +758,56 @@
"saturday_short": "Sat",
"upstream_dns_cache_configuration": "Upstream DNS cache configuration",
"enable_upstream_dns_cache": "Enable DNS caching for this client's custom upstream configuration",
"dns_cache_size": "DNS cache size, in bytes"
"dns_cache_size": "DNS cache size, in bytes",
"ipset_settings": "IP Set",
"ipset_title": "IP Set Configuration",
"ipset_storage_mode": "Storage mode",
"ipset_storage_mode_desc": "Choose where to store IP Set rules: in AdGuard Home configuration or in an external file",
"ipset_mode_config": "Store rules in configuration",
"ipset_mode_file": "Store rules in external file",
"ipset_rules": "IP Set rules",
"ipset_rules_desc": "Add domains and their corresponding IP Set names. IP addresses resolved for these domains will be added to the specified IP Sets.",
"ipset_rules_from_file": "Rules are loaded from external file",
"ipset_no_rules": "No rules configured yet",
"ipset_add_rule": "Add rule",
"ipset_edit_rule": "Edit rule",
"ipset_confirm_delete": "Are you sure you want to delete this rule?",
"ipset_duplicate_rule": "This rule already exists",
"ipset_invalid_rule": "Invalid rule format",
"ipset_domains": "Domains",
"ipset_domains_desc": "Comma-separated list of domain names (wildcards like *.example.com are supported)",
"ipset_names": "IP Set names",
"ipset_names_desc": "Comma-separated list of IP Set names (only letters, digits, underscore and hyphen allowed)",
"ipset_example": "Example",
"ipset_file_path": "File path",
"ipset_file_path_desc": "Absolute path to a file containing IP Set rules (one rule per line, comments starting with # are supported)",
"ipset_file_path_required": "File path cannot be empty",
"ipset_info_title": "IP Set information",
"ipset_info_desc": "IP Set allows adding resolved IP addresses to Linux ipset lists for advanced firewall rules.",
"ipset_info_linux_only": "This feature is only supported on Linux systems",
"ipset_info_format": "Rule format: DOMAIN[,DOMAIN,...]/IPSET_NAME[,IPSET_NAME,...]",
"ipset_error_unknown": "Unknown IPSet",
"ipset_error_not_exists": "The specified IPSet does not exist in the system. Please create it first using the 'ipset create' command.",
"ipset_error_save_failed": "Failed to save IPSet configuration. Please check your rules and ensure all IPSets exist in the system.",
"ipset_autocreate_title": "Create IPSet if it is missing",
"ipset_autocreate_desc": "Automatically create IPSets if they don't exist in the system when AdGuard Home starts",
"ipset_autocreate_enable": "Enable automatic IPSet creation",
"ipset_autocreate_sets": "IPSet Definitions",
"ipset_autocreate_sets_desc": "Define IPSets to be created automatically. You can specify multiple IPSet names separated by commas to create a group with the same settings. If an IPSet already exists, creation will be skipped and logged.",
"ipset_autocreate_add": "Add IPSet Definition",
"ipset_autocreate_edit": "Edit IPSet Definition",
"ipset_autocreate_name": "IPSet Name",
"ipset_autocreate_name_desc": "Name of the IPSet or multiple names separated by commas (letters, digits, underscore, hyphen)",
"ipset_autocreate_type": "Type",
"ipset_autocreate_type_desc": "Type of IPSet entries",
"ipset_autocreate_type_ip": "IP addresses (hash:ip)",
"ipset_autocreate_type_net": "IP networks (hash:net)",
"ipset_autocreate_family": "IP Family",
"ipset_autocreate_family_desc": "Protocol family for this IPSet",
"ipset_autocreate_family_ipv4": "IPv4 (inet)",
"ipset_autocreate_family_ipv6": "IPv6 (inet6)",
"ipset_autocreate_timeout": "Timeout (seconds)",
"ipset_autocreate_timeout_desc": "Entry timeout in seconds (0 or empty = no timeout, entries permanent)",
"ipset_autocreate_no_sets": "No IPSet definitions configured",
"ipset_autocreate_confirm_delete": "Are you sure you want to delete this IPSet definition?"
}
53 changes: 52 additions & 1 deletion client/src/__locales/ru.json
Original file line number Diff line number Diff line change
Expand Up @@ -758,5 +758,56 @@
"saturday_short": "Сб",
"upstream_dns_cache_configuration": "Конфигурация кеша upstream DNS-серверов",
"enable_upstream_dns_cache": "Включить кеширование для пользовательской конфигурации upstream-серверов этого клиента",
"dns_cache_size": "Размер DNS-кеша в байтах"
"dns_cache_size": "Размер DNS-кеша в байтах",
"ipset_settings": "IP Set",
"ipset_title": "Настройка IP Set",
"ipset_storage_mode": "Режим хранения",
"ipset_storage_mode_desc": "Выберите, где хранить правила IP Set: в конфигурации AdGuard Home или во внешнем файле",
"ipset_mode_config": "Хранить правила в конфигурации",
"ipset_mode_file": "Хранить правила во внешнем файле",
"ipset_rules": "Правила IP Set",
"ipset_rules_desc": "Добавьте домены и соответствующие имена IP Set. IP-адреса, полученные для этих доменов, будут добавлены в указанные IP Set списки.",
"ipset_rules_from_file": "Правила загружаются из внешнего файла",
"ipset_no_rules": "Правила ещё не настроены",
"ipset_add_rule": "Добавить правило",
"ipset_edit_rule": "Редактировать правило",
"ipset_confirm_delete": "Вы уверены, что хотите удалить это правило?",
"ipset_duplicate_rule": "Это правило уже существует",
"ipset_invalid_rule": "Неверный формат правила",
"ipset_domains": "Домены",
"ipset_domains_desc": "Список доменных имён через запятую (поддерживаются маски вида *.example.com)",
"ipset_names": "Имена IP Set",
"ipset_names_desc": "Список имён IP Set через запятую (разрешены только буквы, цифры, подчёркивание и дефис)",
"ipset_example": "Пример",
"ipset_file_path": "Путь к файлу",
"ipset_file_path_desc": "Абсолютный путь к файлу с правилами IP Set (одно правило на строку, поддерживаются комментарии, начинающиеся с #)",
"ipset_file_path_required": "Путь к файлу не может быть пустым",
"ipset_info_title": "Информация об IP Set",
"ipset_info_desc": "IP Set позволяет добавлять полученные IP-адреса в списки Linux ipset для расширенных правил файрвола.",
"ipset_info_linux_only": "Эта функция поддерживается только в системах Linux",
"ipset_info_format": "Формат правила: DOMAIN[,DOMAIN,...]/IPSET_NAME[,IPSET_NAME,...]",
"ipset_error_unknown": "Неизвестный IPSet",
"ipset_error_not_exists": "Указанный IPSet не существует в системе. Сначала создайте его с помощью команды 'ipset create'.",
"ipset_error_save_failed": "Не удалось сохранить конфигурацию IPSet. Проверьте правила и убедитесь, что все IPSet существуют в системе.",
"ipset_autocreate_title": "Создать IPSet, если он отсутствует",
"ipset_autocreate_desc": "Автоматически создавать IPSet, если они не существуют в системе при запуске AdGuard Home",
"ipset_autocreate_enable": "Включить автоматическое создание IPSet",
"ipset_autocreate_sets": "Определения IPSet",
"ipset_autocreate_sets_desc": "Определите IPSet для автоматического создания. Вы можете указать несколько имён IPSet через запятую, чтобы создать группу с одинаковыми настройками. Если IPSet уже существует, создание будет пропущено и залогировано.",
"ipset_autocreate_add": "Добавить определение IPSet",
"ipset_autocreate_edit": "Редактировать определение IPSet",
"ipset_autocreate_name": "Имя IPSet",
"ipset_autocreate_name_desc": "Имя IPSet или несколько имён через запятую (буквы, цифры, подчёркивание, дефис)",
"ipset_autocreate_type": "Тип",
"ipset_autocreate_type_desc": "Тип записей IPSet",
"ipset_autocreate_type_ip": "IP-адреса (hash:ip)",
"ipset_autocreate_type_net": "IP-сети (hash:net)",
"ipset_autocreate_family": "Семейство IP",
"ipset_autocreate_family_desc": "Семейство протоколов для этого IPSet",
"ipset_autocreate_family_ipv4": "IPv4 (inet)",
"ipset_autocreate_family_ipv6": "IPv6 (inet6)",
"ipset_autocreate_timeout": "Таймаут (секунды)",
"ipset_autocreate_timeout_desc": "Таймаут записи в секундах (0 или пусто = без таймаута, записи постоянные)",
"ipset_autocreate_no_sets": "Определения IPSet не настроены",
"ipset_autocreate_confirm_delete": "Вы уверены, что хотите удалить это определение IPSet?"
}
17 changes: 15 additions & 2 deletions client/src/actions/dnsConfig.ts
Original file line number Diff line number Diff line change
Expand Up @@ -70,15 +70,28 @@ export const setDnsConfig = (config: any) => async (dispatch: any) => {

await apiClient.setDnsConfig(data);

// Reload configuration from server to ensure UI reflects saved state
const updatedConfig = await apiClient.getDnsConfig();

if (hasDnsSettings) {
dispatch(addSuccessToast('updated_upstream_dns_toast'));
} else {
dispatch(addSuccessToast('config_successfully_saved'));
}

dispatch(setDnsConfigSuccess(config));
dispatch(setDnsConfigSuccess(updatedConfig));
} catch (error) {
dispatch(addErrorToast({ error }));
// Parse error message to provide better user feedback
const errorMessage = error instanceof Error ? error.message : String(error);

// Check if error is related to IPSet
if (errorMessage.includes('ipset') || errorMessage.includes('unknown ipset')) {
const customError = new Error(i18next.t('ipset_error_save_failed'));
dispatch(addErrorToast({ error: customError }));
} else {
dispatch(addErrorToast({ error }));
}

dispatch(setDnsConfigFailure());
}
};
5 changes: 5 additions & 0 deletions client/src/components/App/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ import Dns from '../../containers/Dns';
import Encryption from '../../containers/Encryption';

import Dhcp from '../Settings/Dhcp';
import Ipset from '../Settings/Ipset';
import Clients from '../../containers/Clients';
import DnsBlocklist from '../../containers/DnsBlocklist';
import DnsAllowlist from '../../containers/DnsAllowlist';
Expand Down Expand Up @@ -77,6 +78,10 @@ const ROUTES = [
path: SETTINGS_URLS.dhcp,
component: Dhcp,
},
{
path: SETTINGS_URLS.ipset,
component: Ipset,
},
{
path: SETTINGS_URLS.clients,
component: Clients,
Expand Down
4 changes: 4 additions & 0 deletions client/src/components/Header/Menu.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,10 @@ const SETTINGS_ITEMS = [
route: SETTINGS_URLS.dhcp,
text: 'dhcp_settings',
},
{
route: SETTINGS_URLS.ipset,
text: 'ipset_settings',
},
];

const FILTERS_ITEMS = [
Expand Down
Loading