324 lines
8.8 KiB
JSON
324 lines
8.8 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": "card",
|
|
"label": "Search Blocked Domains",
|
|
"items": [
|
|
{
|
|
"type": "raw_html",
|
|
"html": "%BLOCKLIST_SEARCH_HTML%"
|
|
}
|
|
]
|
|
},
|
|
{
|
|
"type": "table",
|
|
"datasource": "config:blocklists",
|
|
"empty_message": "No blocklists configured.",
|
|
"columns": [
|
|
{
|
|
"label": "Name",
|
|
"field": "name"
|
|
},
|
|
{
|
|
"label": "Description",
|
|
"field": "description"
|
|
},
|
|
{
|
|
"label": "Type",
|
|
"field": "bl_type_label",
|
|
"class": "col-narrow"
|
|
},
|
|
{
|
|
"label": "Source",
|
|
"field": "source_display",
|
|
"class": "col-mono"
|
|
},
|
|
{
|
|
"label": "Used By VLAN(s)",
|
|
"field": "used_by",
|
|
"render": "tag_list"
|
|
}
|
|
],
|
|
"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",
|
|
"existing_ids": "%BLOCKLIST_EXISTING_NAMES_JS%"
|
|
},
|
|
{
|
|
"type": "field",
|
|
"label": "Description",
|
|
"name": "description",
|
|
"input_type": "text",
|
|
"placeholder": "e.g. Steven Black (ads, malware, trackers)"
|
|
},
|
|
{
|
|
"type": "raw_html",
|
|
"html": "<div id=\"type-row\">"
|
|
},
|
|
{
|
|
"type": "field",
|
|
"label": "Type",
|
|
"name": "bl_type",
|
|
"input_type": "select",
|
|
"options": [
|
|
{"value": "", "label": "-- Select Type --"},
|
|
{"value": "community", "label": "Community Blocklist"},
|
|
{"value": "local", "label": "Local Blocklist"}
|
|
]
|
|
},
|
|
{
|
|
"type": "raw_html",
|
|
"html": "</div>"
|
|
},
|
|
{
|
|
"type": "raw_html",
|
|
"html": "<div id=\"community-fields\" style=\"display:none\">"
|
|
},
|
|
{
|
|
"type": "field",
|
|
"label": "Source URL",
|
|
"name": "url",
|
|
"input_type": "text",
|
|
"validate": "VALIDATION_URL",
|
|
"placeholder": "https://...",
|
|
"optional": true
|
|
},
|
|
{
|
|
"type": "raw_html",
|
|
"html": "</div>"
|
|
},
|
|
{
|
|
"type": "raw_html",
|
|
"html": "<div id=\"local-fields\" style=\"display:none\">"
|
|
},
|
|
{
|
|
"type": "field",
|
|
"label": "Domains",
|
|
"name": "local_entries",
|
|
"input_type": "textarea",
|
|
"rows": 8,
|
|
"placeholder": "One domain per line, e.g.:\nads.example.com\ntracker.example.net",
|
|
"hint": "One domain per line. Subdomains are automatically blocked.",
|
|
"optional": true
|
|
},
|
|
{
|
|
"type": "raw_html",
|
|
"html": "</div>"
|
|
},
|
|
{
|
|
"type": "raw_html",
|
|
"html": "%VLAN_USED_BY_CHECKBOXES%"
|
|
},
|
|
{
|
|
"type": "button_row",
|
|
"items": [
|
|
{
|
|
"type": "button_primary",
|
|
"class": "add-blocklist-btn",
|
|
"text": "Add Blocklist",
|
|
"disabled": "true"
|
|
},
|
|
{
|
|
"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": "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": "field",
|
|
"label": "Max Log Size (KB)",
|
|
"name": "log_max_kb",
|
|
"input_type": "number",
|
|
"layout": "inline",
|
|
"value": "%GENERAL_LOG_MAX_KB%",
|
|
"min": 64,
|
|
"hint": "Log will automatically be cleared when it reaches this size."
|
|
},
|
|
{
|
|
"type": "hr"
|
|
},
|
|
{
|
|
"type": "field",
|
|
"label": "",
|
|
"name": "log_errors_only",
|
|
"input_type": "checkbox",
|
|
"checkbox_label": "Only record errors to log",
|
|
"value": "%GENERAL_LOG_ERRORS_ONLY%"
|
|
},
|
|
{
|
|
"type": "hr"
|
|
},
|
|
{
|
|
"type": "button_row",
|
|
"items": [
|
|
{
|
|
"type": "button_primary",
|
|
"action": "/action/dnsblocking/logging_save",
|
|
"method": "post",
|
|
"text": "Save"
|
|
},
|
|
{
|
|
"type": "button_cancel",
|
|
"text": "Cancel"
|
|
}
|
|
]
|
|
}
|
|
]
|
|
}
|
|
]
|
|
}
|
|
]
|
|
}
|