261 lines
7 KiB
JSON
261 lines
7 KiB
JSON
{
|
|
"client_requirement": "client_is_viewer+",
|
|
"items": [
|
|
{
|
|
"type": "header_page_title",
|
|
"items": [
|
|
{
|
|
"type": "h1",
|
|
"text": "DNS Blocking"
|
|
},
|
|
{
|
|
"type": "p",
|
|
"text": "Domain level blocking via dnsmasq."
|
|
}
|
|
]
|
|
},
|
|
{
|
|
"type": "table",
|
|
"datasource": "config:blocklists",
|
|
"empty_message": "No blocklists configured.",
|
|
"columns": [
|
|
{
|
|
"label": "Name",
|
|
"field": "name"
|
|
},
|
|
{
|
|
"label": "Description",
|
|
"field": "description"
|
|
},
|
|
{
|
|
"label": "Format",
|
|
"field": "format",
|
|
"class": "col-mono"
|
|
},
|
|
{
|
|
"label": "Source URL",
|
|
"field": "url",
|
|
"class": "col-mono"
|
|
}
|
|
],
|
|
"row_actions": [
|
|
{
|
|
"client_requirement": "client_is_administrator+",
|
|
"method": "js_edit",
|
|
"target": "add-form",
|
|
"text": "Edit",
|
|
"class": "btn-ghost btn-sm"
|
|
},
|
|
{
|
|
"client_requirement": "client_is_administrator+",
|
|
"action": "/action/dnsblocking/blocklists_delete",
|
|
"method": "post",
|
|
"text": "Delete",
|
|
"class": "btn-danger btn-sm"
|
|
}
|
|
]
|
|
},
|
|
{
|
|
"type": "card",
|
|
"id": "add-form",
|
|
"label": "Add Blocklist",
|
|
"client_requirement": "client_is_administrator+",
|
|
"items": [
|
|
{
|
|
"type": "form",
|
|
"action": "/action/dnsblocking/addblocklist_add",
|
|
"method": "post",
|
|
"items": [
|
|
{
|
|
"type": "hidden",
|
|
"name": "row_index",
|
|
"value": ""
|
|
},
|
|
{
|
|
"type": "field",
|
|
"label": "Name",
|
|
"name": "name",
|
|
"input_type": "text",
|
|
"validate": "VALIDATION_DASH_NAME",
|
|
"placeholder": "e.g. steven-black"
|
|
},
|
|
{
|
|
"type": "field",
|
|
"label": "Description",
|
|
"name": "description",
|
|
"input_type": "text",
|
|
"placeholder": "e.g. Steven Black (ads, malware, trackers)"
|
|
},
|
|
{
|
|
"type": "field",
|
|
"label": "Format",
|
|
"name": "format",
|
|
"input_type": "select",
|
|
"options": "%BLOCKLIST_FORMAT_OPTIONS%"
|
|
},
|
|
{
|
|
"type": "field",
|
|
"label": "Source URL",
|
|
"name": "url",
|
|
"input_type": "text",
|
|
"validate": "VALIDATION_URL",
|
|
"placeholder": "https://..."
|
|
},
|
|
{
|
|
"type": "button_row",
|
|
"items": [
|
|
{
|
|
"type": "button_primary",
|
|
"action": "/action/dnsblocking/addblocklist_add",
|
|
"method": "post",
|
|
"text": "Add Blocklist"
|
|
},
|
|
{
|
|
"type": "button_cancel",
|
|
"text": "Cancel"
|
|
}
|
|
]
|
|
}
|
|
]
|
|
}
|
|
]
|
|
},
|
|
{
|
|
"type": "card",
|
|
"label": "Blocklist Refresh",
|
|
"client_requirement": "client_is_administrator+",
|
|
"items": [
|
|
{
|
|
"type": "raw_html",
|
|
"html": "%BLOCKLIST_STATS_HTML%"
|
|
},
|
|
{
|
|
"type": "hr"
|
|
},
|
|
{
|
|
"type": "button_row",
|
|
"items": [
|
|
{
|
|
"type": "button_secondary",
|
|
"action": "/action/dnsblocking/blocklistrefresh_refresh",
|
|
"method": "post",
|
|
"text": "Refresh All Now"
|
|
}
|
|
]
|
|
},
|
|
{
|
|
"type": "hr"
|
|
},
|
|
{
|
|
"type": "form",
|
|
"action": "/action/dnsblocking/blocklistrefresh_save",
|
|
"method": "post",
|
|
"items": [
|
|
{
|
|
"type": "field",
|
|
"label": "Daily Refresh Time",
|
|
"name": "daily_execute_time_24hr_local",
|
|
"input_type": "text",
|
|
"validate": "VALIDATION_TIME24H",
|
|
"value": "%GENERAL_DAILY_EXECUTE_TIME%",
|
|
"placeholder": "e.g. 02:30",
|
|
"hint": "24-hour local time for the daily blocklist refresh."
|
|
},
|
|
{
|
|
"type": "button_row",
|
|
"items": [
|
|
{
|
|
"type": "button_primary",
|
|
"action": "/action/dnsblocking/blocklistrefresh_save",
|
|
"method": "post",
|
|
"text": "Save"
|
|
},
|
|
{
|
|
"type": "button_cancel",
|
|
"text": "Cancel"
|
|
}
|
|
]
|
|
}
|
|
]
|
|
}
|
|
]
|
|
},
|
|
{
|
|
"type": "card",
|
|
"label": "Logging",
|
|
"client_requirement": "client_is_administrator+",
|
|
"items": [
|
|
{
|
|
"type": "form",
|
|
"action": "/action/dnsblocking/logging_save",
|
|
"method": "post",
|
|
"items": [
|
|
{
|
|
"type": "field",
|
|
"label": "Max Log Size (KB)",
|
|
"name": "log_max_kb",
|
|
"input_type": "number",
|
|
"value": "%GENERAL_LOG_MAX_KB%",
|
|
"min": 64,
|
|
"hint": "Log is cleared and restarted when it exceeds this size."
|
|
},
|
|
{
|
|
"type": "field",
|
|
"label": "Only record errors to log",
|
|
"name": "log_errors_only",
|
|
"input_type": "checkbox",
|
|
"value": "%GENERAL_LOG_ERRORS_ONLY%",
|
|
"hint": "Only write error-level messages to the log."
|
|
},
|
|
{
|
|
"type": "hr"
|
|
},
|
|
{
|
|
"type": "pre_block",
|
|
"text": "%DNS_LOG_TAIL%",
|
|
"scroll_to_bottom": true
|
|
},
|
|
{
|
|
"type": "raw_html",
|
|
"html": "%DNS_LOG_SUMMARY%"
|
|
},
|
|
{
|
|
"type": "button_row",
|
|
"justify": "space-between",
|
|
"items": [
|
|
{
|
|
"type": "button_ghost",
|
|
"action": "/action/dnsblocking/logging_download",
|
|
"text": "Download Log"
|
|
},
|
|
{
|
|
"type": "button_danger",
|
|
"formaction": "/action/dnsblocking/logging_clear",
|
|
"text": "Clear Log"
|
|
}
|
|
]
|
|
},
|
|
{
|
|
"type": "hr"
|
|
},
|
|
{
|
|
"type": "button_row",
|
|
"items": [
|
|
{
|
|
"type": "button_primary",
|
|
"action": "/action/dnsblocking/logging_save",
|
|
"method": "post",
|
|
"text": "Save"
|
|
},
|
|
{
|
|
"type": "button_cancel",
|
|
"text": "Cancel"
|
|
}
|
|
]
|
|
}
|
|
]
|
|
}
|
|
]
|
|
}
|
|
]
|
|
}
|