You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
<p>Graceful connection draining on secret removal (<ahref="https://github.com/teleproxy/teleproxy/issues/45">#45</a>).</p>
1760
+
<ul>
1761
+
<li><strong>Zero-downtime secret rotation</strong> — removing a secret from <code>config.toml</code> and sending SIGHUP no longer drops the in-flight connections that were authenticated under it. The slot enters a "draining" state: new connections matching that secret are rejected, but existing ones keep working until they close on their own or <code>drain_timeout_secs</code> (default 300, <code>0</code> = infinite) elapses. Re-adding a draining secret revives the same slot — counters and IP tracking carry over.</li>
1762
+
<li>New TOML option <code>drain_timeout_secs</code> (reloadable). Pinned <code>-S</code> CLI secrets are immutable across SIGHUP and never drain.</li>
1763
+
<li>New stats: <code>secret_<lbl>_draining</code>, <code>secret_<lbl>_drain_age_seconds</code>, <code>secret_<lbl>_rejected_draining</code>, <code>secret_<lbl>_drain_forced</code>. Same fields exposed in Prometheus as <code>teleproxy_secret_draining</code>, <code>teleproxy_secret_drain_age_seconds</code>, <code>teleproxy_secret_rejected_draining_total</code>, <code>teleproxy_secret_drain_forced_total</code>.</li>
1764
+
<li>Slot capacity expanded internally: 16 active secrets at a time as before, plus up to 16 additional draining slots.</li>
1765
+
<li>Fixes a latent bug where the per-secret connection counter could go negative if a TLS connection was closed between the TLS handshake and the obfs2 init.</li>
<p>Graceful connection draining on secret removal (<ahref="https://github.com/teleproxy/teleproxy/issues/45">#45</a>).</p>
1760
+
<ul>
1761
+
<li><strong>Zero-downtime secret rotation</strong> — removing a secret from <code>config.toml</code> and sending SIGHUP no longer drops the in-flight connections that were authenticated under it. The slot enters a "draining" state: new connections matching that secret are rejected, but existing ones keep working until they close on their own or <code>drain_timeout_secs</code> (default 300, <code>0</code> = infinite) elapses. Re-adding a draining secret revives the same slot — counters and IP tracking carry over.</li>
1762
+
<li>New TOML option <code>drain_timeout_secs</code> (reloadable). Pinned <code>-S</code> CLI secrets are immutable across SIGHUP and never drain.</li>
1763
+
<li>New stats: <code>secret_<lbl>_draining</code>, <code>secret_<lbl>_drain_age_seconds</code>, <code>secret_<lbl>_rejected_draining</code>, <code>secret_<lbl>_drain_forced</code>. Same fields exposed in Prometheus as <code>teleproxy_secret_draining</code>, <code>teleproxy_secret_drain_age_seconds</code>, <code>teleproxy_secret_rejected_draining_total</code>, <code>teleproxy_secret_drain_forced_total</code>.</li>
1764
+
<li>Slot capacity expanded internally: 16 active secrets at a time as before, plus up to 16 additional draining slots.</li>
1765
+
<li>Fixes a latent bug where the per-secret connection counter could go negative if a TLS connection was closed between the TLS handshake and the obfs2 init.</li>
<p>Surface the heaviest client IPs per secret in <code>/metrics</code> to diagnose rogue clients. Disabled by default — opt in with a top-level config knob, not a per-secret one (cardinality is an operator concern).</p>
1870
1929
<p>TOML config:</p>
1871
-
<divclass="highlight"><pre><span></span><code><aid="__codelineno-17-1" name="__codelineno-17-1" href="#__codelineno-17-1"></a><spanclass="n">top_ips_per_secret</span><spanclass="w"></span><spanclass="o">=</span><spanclass="w"></span><spanclass="mi">10</span><spanclass="w"></span><spanclass="c1"># 0 disables; max 32</span>
1930
+
<divclass="highlight"><pre><span></span><code><aid="__codelineno-18-1" name="__codelineno-18-1" href="#__codelineno-18-1"></a><spanclass="n">top_ips_per_secret</span><spanclass="w"></span><spanclass="o">=</span><spanclass="w"></span><spanclass="mi">10</span><spanclass="w"></span><spanclass="c1"># 0 disables; max 32</span>
<p>When enabled, three new Prometheus metric families are emitted, each labelled <code>{secret="...", ip="..."}</code> for the top-N heaviest IPs per secret (sorted by total bytes):</p>
<p>Cardinality is bounded at <code>top_ips_per_secret × secret_count</code> labelled samples per family. Counters reset when an IP entry is recycled — Prometheus <code>rate()</code> handles this correctly.</p>
0 commit comments