<!--
  Reference for every field on the BigBrotherConfig model so admins know
  where each toggle lives and how automation updates it.
-->
{% extends 'faq/base.html' %}
{% load i18n %}

{% block details %}
{% include 'faq/settings_nav.html' %}

<h1>{% translate "BigBrotherConfig Fields" %}</h1>
<p>
  {% blocktrans %}The core BigBrother behaviour lives in <code>BigBrotherConfig</code>. These options handle activation, hostile lists, webhooks, and background schedulers. Adjust them from Django admin → BigBrother → BigBrotherConfig.{% endblocktrans %}
</p>

<h2 class="mt-4">{% translate "Installation & Identity" %}</h2>
<div class="table-responsive">
  <table class="table table-striped">
    <thead>
      <tr>
        <th>{% translate "Field" %}</th>
        <th>{% translate "Description" %}</th>
      </tr>
    </thead>
    <tbody>
      <tr>
        <td><code>main_corporation_id</code> / <code>main_corporation</code></td>
        <td>{% translate "Populated automatically from the first superuser character detected during the scheduled update task. Identifies your primary corporation." %}</td>
      </tr>
      <tr>
        <td><code>main_alliance_id</code> / <code>main_alliance</code></td>
        <td>{% translate "Automatically captured alliance counterpart. Both fields are read-only snapshots managed by the updater." %}</td>
      </tr>
      <tr>
        <td><code>is_active</code></td>
        <td>{% translate "Managed by the updater. Turns false if the corporation/alliance is not authorised." %}</td>
      </tr>
    </tbody>
  </table>
</div>

<h2 class="mt-4">{% translate "Access Control" %}</h2>
<div class="table-responsive">
  <table class="table table-striped settings">
    <thead>
      <tr>
        <th>{% translate "Field" %}</th>
        <th>{% translate "Description" %}</th>
      </tr>
    </thead>
    <tbody>
      <tr>
        <td><code>limit_to_main_corp</code></td>
        <td>{% translate "If enabled, compliance checks and dashboard visibility will be restricted to members of the primary corporation only. Use this if your Alliance Auth instance is dedicated to a single corporation but contains other alliance members." %}</td>
      </tr>
      <tr>
        <td><code>bb_guest_states</code></td>
        <td>{% translate "AllianceAuth states treated as guests. Recruiter-level users only see pilots in these states." %}</td>
      </tr>
      <tr>
        <td><code>bb_member_states</code></td>
        <td>{% translate "States that count as full members for BigBrother and CorpBrother checks." %}</td>
      </tr>
      <tr>
        <td><code>member_corporations</code> / <code>member_alliances</code></td>
        <td>{% translate "Comma-separated IDs that should be considered members even if they sit outside the primary corp/alliance." %}</td>
      </tr>
      <tr>
        <td><code>ignored_corporations</code></td>
        <td>{% translate "Corporation IDs excluded from CorpBrother dropdowns and compliance checks." %}</td>
      </tr>
    </tbody>
  </table>
</div>

<h2 class="mt-4">{% translate "Hostile & Whitelist Lists" %}</h2>
<div class="table-responsive">
  <table class="table table-striped">
    <thead>
      <tr>
        <th>{% translate "Field" %}</th>
        <th>{% translate "Description" %}</th>
      </tr>
    </thead>
    <tbody>
      <tr>
        <td><code>hostile_alliances</code> / <code>hostile_corporations</code></td>
        <td>{% translate "Comma-separated IDs that flag alliances or corporations as hostile. Cards, mails, and transactions look here to colour results red." %}</td>
      </tr>
      <tr>
        <td><code>whitelist_alliances</code> / <code>whitelist_corporations</code></td>
        <td>{% translate "IDs that should never be flagged, even if they appear in default hostile data sets." %}</td>
      </tr>
      <tr>
        <td><code>consider_nullsec_hostile</code></td>
        <td>{% translate "If enabled, all systems in nullsec regions are treated as hostile for asset and clone checks." %}</td>
      </tr>
      <tr>
        <td><code>consider_all_structures_hostile</code></td>
        <td>{% translate "When enabled, any player-owned structure not in your whitelists is treated as a hostile location." %}</td>
      </tr>
      <tr>
        <td><code>consider_npc_stations_hostile</code></td>
        <td>{% translate "Treats all NPC stations as hostile locations for asset/clone checks." %}</td>
      </tr>
      <tr>
        <td><code>excluded_systems</code> / <code>excluded_stations</code></td>
        <td>{% translate "Comma-separated IDs of systems or stations that should be ignored by hostile checks." %}</td>
      </tr>
      <tr>
        <td><code>hostile_assets_ships_only</code></td>
        <td>{% translate "If enabled, only ship assets are evaluated when checking for hostile asset placements." %}</td>
      </tr>
    </tbody>
  </table>
</div>

<h2 class="mt-4">{% translate "Blacklist Settings" %}</h2>
<div class="table-responsive">
  <table class="table table-striped">
    <thead>
      <tr>
        <th>{% translate "Field" %}</th>
        <th>{% translate "Description" %}</th>
      </tr>
    </thead>
    <tbody>
      <tr>
        <td><code>alliance_blacklist_url</code></td>
        <td>{% translate "URL for your alliance-level blacklist tool, if applicable." %}</td>
      </tr>
      <tr>
        <td><code>external_blacklist_url</code></td>
        <td>{% translate "URL for an external or coalition-level blacklist." %}</td>
      </tr>
    </tbody>
  </table>
</div>


<h2 class="mt-4">{% translate "aa-contacts Integration" %}</h2>
<div class="table-responsive">
  <table class="table table-striped">
    <thead>
      <tr>
        <th>{% translate "Field" %}</th>
        <th>{% translate "Description" %}</th>
      </tr>
    </thead>
    <tbody>
      <tr>
        <td><code>auto_import_contacts_enabled</code></td>
        <td>{% translate "When enabled, BigBrother will periodically import standings from aa-contacts and merge them into the member/hostile/whitelist lists." %}</td>
      </tr>
      <tr>
        <td><code>contacts_source_alliances</code> / <code>contacts_source_corporations</code></td>
        <td>{% translate "Alliances and Corporations whose aa-contacts standings should be imported. Positive standings become members; negative become hostile; neutral handling is controlled below." %}</td>
      </tr>
      <tr>
        <td><code>contacts_handle_neutrals</code></td>
        <td>{% translate "Controls how neutral (0) standings are treated: handle as hostile, whitelist/ignore, or do nothing." %}</td>
      </tr>
      <tr>
        <td><code>contacts_import_cache</code></td>
        <td>{% translate "Internal cache of imported IDs so removals from aa-contacts can be pruned without touching manually maintained lists." %}</td>
      </tr>
    </tbody>
  </table>
</div>


<h2 class="mt-4">{% translate "Discord Notifications" %}</h2>
<div class="table-responsive">
  <table class="table table-striped">
    <thead>
      <tr>
        <th>{% translate "Field" %}</th>
        <th>{% translate "Description" %}</th>
      </tr>
    </thead>
    <tbody>
      <tr>
        <td><code>*_notify</code> toggles</td>
        <td>{% translate "Individual checkboxes to enable/disable Discord alerts for: cyno changes, SP injections, hostile clones, assets, contacts, contracts, CT audits, AWOX kills, mails, and transactions." %}</td>
      </tr>
      <tr>
        <td><code>new_user_notify</code></td>
        <td>{% translate "If enabled, sends a full history digest when a user is first audited (can be very spammy)." %}</td>
      </tr>
      <tr>
        <td><code>ticket_notify_man</code> / <code>auto</code></td>
        <td>{% translate "Enable notifications when compliance tickets are closed manually or automatically." %}</td>
      </tr>
      <tr>
        <td><code>pingroleID</code> / <code>pingroleID2</code></td>
        <td>{% translate "Discord role IDs to mention when selected message types fire. Use raw numeric IDs." %}</td>
      </tr>
      <tr>
        <td><code>pingrole1_messages</code> / <code>pingrole2_messages</code></td>
        <td>{% translate "Choose which <code>MessageType</code> entries ping each role." %}</td>
      </tr>
      <tr>
        <td><code>here_messages</code> / <code>everyone_messages</code></td>
        <td>{% translate "Message types that should ping @here or @everyone through the configured webhook." %}</td>
      </tr>
      <tr>
        <td><code>webhook</code> / <code>loawebhook</code> / <code>dailywebhook</code> / <code>optwebhook1-5</code></td>
        <td>{% translate "Discord webhook destinations for core alerts, LoA notices, daily digests, and up to five optional channels." %}</td>
      </tr>
      <tr>
        <td><code>stats_webhook</code></td>
        <td>{% translate "Discord webhook used for recurring stats posts (when enabled)." %}</td>
      </tr>
    </tbody>
  </table>
</div>

<h2 class="mt-4">{% translate "Market Transaction Settings" %}</h2>
<div class="table-responsive">
  <table class="table table-striped">
    <thead>
      <tr>
        <th>{% translate "Field" %}</th>
        <th>{% translate "Description" %}</th>
      </tr>
    </thead>
    <tbody>
      <tr>
        <td><code>show_market_transactions</code></td>
        <td>{% translate "Master toggle to show market escrow and market transaction events in reports." %}</td>
      </tr>
      <tr>
        <td><code>market_transactions_show_major_hubs</code></td>
        <td>{% translate "Flag transactions occurring in Jita, Amarr, Dodixie, Rens, or Hek." %}</td>
      </tr>
      <tr>
        <td><code>market_transactions_show_secondary_hubs</code></td>
        <td>{% translate "Flag transactions in secondary hubs like Oursulaert, Agil, or Perimeter." %}</td>
      </tr>
      <tr>
        <td><code>market_transactions_excluded_systems</code></td>
        <td>{% translate "Comma-separated system IDs to ignore for market transaction monitoring." %}</td>
      </tr>
      <tr>
        <td><code>market_transactions_threshold_alert</code> / <code>percent</code></td>
        <td>{% translate "Enable alerts only when buy/sell prices deviate from market averages by the specified percentage." %}</td>
      </tr>
      <tr>
        <td><code>market_transactions_price_method</code></td>
        <td>{% translate "Choose between Fuzzwork or Janice for price lookups." %}</td>
      </tr>
      <tr>
        <td><code>market_transactions_janice_api_key</code></td>
        <td>{% translate "Required API key if Janice is selected as the price source." %}</td>
      </tr>
      <tr>
        <td><code>market_transactions_fuzzwork_station_id</code></td>
        <td>{% translate "Reference station for Fuzzwork prices (defaults to Jita IV-4)." %}</td>
      </tr>
      <tr>
        <td><code>market_transactions_price_instant</code></td>
        <td>{% translate "Prefer immediate/instant prices over average or percentile prices (Fuzzwork only)." %}</td>
      </tr>
      <tr>
        <td><code>market_transactions_price_max_age</code></td>
        <td>{% translate "Maximum age (in days) for cached market prices before a refresh is triggered." %}</td>
      </tr>
    </tbody>
  </table>
</div>

<h2 class="mt-4">{% translate "ESI Scope Enforcement" %}</h2>
<div class="table-responsive">
  <table class="table table-striped">
    <thead>
      <tr>
        <th>{% translate "Field" %}</th>
        <th>{% translate "Description" %}</th>
      </tr>
    </thead>
    <tbody>
      <tr>
        <td><code>character_scopes</code> / <code>corporation_scopes</code></td>
        <td>{% translate "Comma-separated scope requirements. Missing scopes surface in the Compliance card and related alerts." %}</td>
      </tr>
    </tbody>
  </table>
</div>

<h2 class="mt-4">{% translate "Scheduling & Feature Toggles" %}</h2>
<div class="table-responsive">
  <table class="table table-striped">
    <thead>
      <tr>
        <th>{% translate "Field" %}</th>
        <th>{% translate "Description" %}</th>
      </tr>
    </thead>
    <tbody>
      <tr>
        <td><code>dailyschedule</code> / <code>optschedule1-5</code></td>
        <td>{% translate "Celery beat schedules used for daily and optional webhook messages." %}</td>
      </tr>
      <tr>
        <td><code>stats_schedule</code></td>
        <td>{% translate "Celery beat schedule used for recurring stats posts." %}</td>
      </tr>
      <tr>
        <td><code>are_recurring_stats_active</code></td>
        <td>{% translate "Master switch for recurring stats posts." %}</td>
      </tr>
      <tr>
        <td><code>is_loa_active</code> / <code>is_paps_active</code></td>
        <td>{% translate "Toggle the integrated LoA and PAP modules. Restart AllianceAuth after changing." %}</td>
      </tr>
      <tr>
        <td><code>is_warmer_active</code></td>
        <td>{% translate "Enables the cache warmer that preloads contract/mail/transaction streams. Disable only if your gunicorn timeout in supervisor config is set to 0." %}</td>
      </tr>
      <tr>
        <td><code>are_daily_messages_active</code> / <code>are_opt_messages1-5_active</code></td>
        <td>{% translate "Master switches for daily and optional message delivery. Turn off to pause alerts without removing schedules or webhooks." %}</td>
      </tr>
      <tr>
        <td><code>update_stagger_seconds</code></td>
        <td>{% translate "The total time window across which user updates are performed." %}</td>
      </tr>
      <tr>
        <td><code>update_cache_ttl_hours</code></td>
        <td>{% translate "How long certain check results are cached before being refreshed. Such as Clone States." %}</td>
      </tr>
      <tr>
        <td><code>update_maintenance_window_start</code> / <code>end</code></td>
        <td>{% translate "Start and end times for the maintenance window where updating cached data is preferred." %}</td>
      </tr>
      <tr>
        <td><code>update_backlog_threshold</code> / <code>notify</code></td>
        <td>{% translate "Alert if more than this percentage of tasks from the previous run are still active." %}</td>
      </tr>
      <tr>
        <td><code>loa_max_logoff_days</code></td>
        <td>{% translate "Maximum days a user may stay logged off without an LoA before reminders escalate." %}</td>
      </tr>
      <tr>
        <td><code>clone_state_always_recheck</code></td>
        <td>{% translate "If enabled, characters with known skills proving Alpha/Omega state are re-checked every run, bypassing TTL. Disabling this improves performance for large fleets." %}</td>
      </tr>
    </tbody>
  </table>
</div>

<p class="mt-4 text-muted small">
  {% blocktrans %}Fields not listed above are read-only helpers populated by automation. Leave them unchanged unless instructed by the maintainer.{% endblocktrans %}
</p>
{% endblock %}
