mirror of
https://github.com/swissmakers/fail2ban-ui.git
synced 2026-04-17 14:03:15 +02:00
Add default chain and default BantimeRndtime settings and make configurable through the settings page
This commit is contained in:
@@ -833,6 +833,14 @@
|
||||
<p class="text-xs text-red-600 mt-1 hidden" id="banTimeError"></p>
|
||||
</div>
|
||||
|
||||
<!-- Bantime Rndtime (optional, for bantime increment formula) -->
|
||||
<div class="mb-4">
|
||||
<label for="bantimeRndtime" class="block text-sm font-medium text-gray-700 mb-2" data-i18n="settings.bantime_rndtime">Bantime Rndtime</label>
|
||||
<p class="text-xs text-gray-500 mb-2" data-i18n="settings.bantime_rndtime.description">Optional. Max random seconds added in bantime increment formula (e.g. 2048). Leave empty to use Fail2ban default.</p>
|
||||
<input type="text" class="w-full border border-gray-300 rounded-md px-3 py-2 focus:outline-none focus:ring-2 focus:ring-blue-500" id="bantimeRndtime"
|
||||
data-i18n-placeholder="settings.bantime_rndtime_placeholder" placeholder="e.g., 2048" />
|
||||
</div>
|
||||
|
||||
<!-- Banaction -->
|
||||
<div class="mb-4">
|
||||
<label for="banaction" class="block text-sm font-medium text-gray-700 mb-2" data-i18n="settings.banaction">Banaction</label>
|
||||
@@ -907,6 +915,20 @@
|
||||
</select>
|
||||
</div>
|
||||
|
||||
<!-- Default Chain -->
|
||||
<div class="mb-4">
|
||||
<div class="flex items-center gap-2 mb-2">
|
||||
<label for="defaultChain" class="block text-sm font-medium text-gray-700" data-i18n="settings.default_chain">Default Chain</label>
|
||||
<button type="button" onclick="document.getElementById('chainHelpModal').classList.remove('hidden')" class="inline-flex items-center justify-center w-5 h-5 rounded-full bg-gray-200 text-gray-600 hover:bg-gray-300 text-xs font-medium" aria-label="Chain help" title="Chains help">?</button>
|
||||
</div>
|
||||
<p class="text-xs text-gray-500 mb-2" data-i18n="settings.default_chain.description">iptables/nftables chain used for banning (e.g. INPUT for host, DOCKER-USER for Docker containers).</p>
|
||||
<select id="defaultChain" class="w-full border border-gray-300 rounded-md px-3 py-2 focus:outline-none focus:ring-2 focus:ring-blue-500">
|
||||
<option value="INPUT" data-i18n="settings.chain_input">INPUT</option>
|
||||
<option value="DOCKER-USER" data-i18n="settings.chain_docker_user">DOCKER-USER</option>
|
||||
<option value="FORWARD" data-i18n="settings.chain_forward">FORWARD</option>
|
||||
</select>
|
||||
</div>
|
||||
|
||||
<!-- Findtime -->
|
||||
<div class="mb-4">
|
||||
<label for="findTime" class="block text-sm font-medium text-gray-700 mb-2" data-i18n="settings.default_findtime">Default Findtime</label>
|
||||
@@ -1478,6 +1500,47 @@
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- Chain Help Modal -->
|
||||
<div id="chainHelpModal" class="hidden fixed inset-0 z-50 overflow-y-auto">
|
||||
<div class="relative flex min-h-full w-full items-center justify-center p-4 sm:p-6">
|
||||
<div class="fixed inset-0 bg-gray-500 opacity-75" aria-hidden="true"></div>
|
||||
|
||||
<div class="relative z-10 w-full rounded-lg bg-white text-left shadow-xl transition-all" style="max-width: 560px;">
|
||||
<div class="bg-white px-4 pt-5 pb-4 sm:p-6 sm:pb-4">
|
||||
<div class="sm:flex sm:items-start">
|
||||
<div class="mt-3 text-center sm:mt-0 sm:ml-4 sm:text-left w-full">
|
||||
<div class="flex items-center justify-between">
|
||||
<h3 class="text-lg leading-6 font-medium text-gray-900" data-i18n="settings.chain_help_title">Default chain</h3>
|
||||
<button type="button" onclick="closeModal('chainHelpModal')" class="text-gray-400 hover:text-gray-600 focus:outline-none focus:text-gray-600" aria-label="Close">
|
||||
<svg class="h-6 w-6" fill="none" viewBox="0 0 24 24" stroke="currentColor">
|
||||
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M6 18L18 6M6 6l12 12" />
|
||||
</svg>
|
||||
</button>
|
||||
</div>
|
||||
<dl class="mt-4 space-y-4 text-sm">
|
||||
<div>
|
||||
<dt class="font-medium text-gray-900" data-i18n="settings.chain_docker_user">DOCKER-USER</dt>
|
||||
<dd class="text-gray-600 mt-1" data-i18n="settings.chain_help_docker_user">Use for apps running in Docker. Bans apply to all containers on the host.</dd>
|
||||
</div>
|
||||
<div>
|
||||
<dt class="font-medium text-gray-900" data-i18n="settings.chain_input">INPUT</dt>
|
||||
<dd class="text-gray-600 mt-1" data-i18n="settings.chain_help_input">Use for apps on the host. Bans apply to the host network only, not Docker networks.</dd>
|
||||
</div>
|
||||
<div>
|
||||
<dt class="font-medium text-gray-900" data-i18n="settings.chain_forward">FORWARD</dt>
|
||||
<dd class="text-gray-600 mt-1" data-i18n="settings.chain_help_forward">Only for older Docker setups where DOCKER-USER is not available.</dd>
|
||||
</div>
|
||||
</dl>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="bg-gray-50 px-4 py-3 sm:px-6 sm:flex sm:flex-row-reverse">
|
||||
<button type="button" class="w-full inline-flex justify-center rounded-md border border-gray-300 shadow-sm px-4 py-2 bg-white text-base font-medium text-gray-700 hover:bg-gray-50 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-blue-500 sm:ml-3 sm:w-auto sm:text-sm" onclick="closeModal('chainHelpModal')" data-i18n="modal.close">Close</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- ********************** Modal Templates END ************************ -->
|
||||
|
||||
<!-- jQuery (used by Select2) -->
|
||||
|
||||
Reference in New Issue
Block a user