Compare commits
4 Commits
v0.9.19-rc
...
v0.9.19-rc
| Author | SHA1 | Date | |
|---|---|---|---|
| 99e1b74405 | |||
| 9fe52755a5 | |||
| 9d2d6fadf3 | |||
| 2e5ac092bf |
@@ -1 +1 @@
|
||||
v0.9.19-rc.2
|
||||
v0.9.19-rc.4
|
||||
|
||||
@@ -102,10 +102,15 @@ CREATE TABLE IF NOT EXISTS schema_migrations (
|
||||
"""
|
||||
|
||||
# Ordered list of DDL statements to execute on initialisation.
|
||||
# NOTE: _CREATE_SESSIONS_TOKEN_INDEX is intentionally omitted here.
|
||||
# The old 0.8.0 schema has a `sessions.token` column (not `token_hash`), so
|
||||
# running CREATE INDEX … ON sessions (token_hash) in migration 1 would fail
|
||||
# with "no such column: token_hash" on legacy databases. Migration 2 drops
|
||||
# and recreates the sessions table with token_hash and also creates the index,
|
||||
# so there is no need to create it in migration 1.
|
||||
_SCHEMA_STATEMENTS: list[str] = [
|
||||
_CREATE_SETTINGS,
|
||||
_CREATE_SESSIONS,
|
||||
_CREATE_SESSIONS_TOKEN_INDEX,
|
||||
_CREATE_BLOCKLIST_SOURCES,
|
||||
_CREATE_IMPORT_LOG,
|
||||
_CREATE_GEO_CACHE,
|
||||
@@ -133,8 +138,24 @@ CREATE UNIQUE INDEX idx_sessions_token_hash ON sessions (token_hash);
|
||||
3: """
|
||||
-- Migration 3: Add last_seen timestamp to geo_cache for retention policy.
|
||||
-- Tracks when each IP was last referenced to enable purging of stale entries.
|
||||
-- Default to current timestamp for existing rows.
|
||||
ALTER TABLE geo_cache ADD COLUMN last_seen TEXT NOT NULL DEFAULT (strftime('%Y-%m-%dT%H:%M:%fZ', 'now'));
|
||||
-- SQLite rejects ALTER TABLE ADD COLUMN with a non-constant NOT NULL default
|
||||
-- when the table already contains rows, so we rebuild the table instead.
|
||||
-- Existing rows receive last_seen = cached_at as a reasonable approximation
|
||||
-- (the IP was at least seen when it was first cached).
|
||||
DROP TABLE IF EXISTS geo_cache_new;
|
||||
CREATE TABLE geo_cache_new (
|
||||
ip TEXT PRIMARY KEY,
|
||||
country_code TEXT,
|
||||
country_name TEXT,
|
||||
asn TEXT,
|
||||
org TEXT,
|
||||
cached_at TEXT NOT NULL DEFAULT (strftime('%Y-%m-%dT%H:%M:%fZ', 'now')),
|
||||
last_seen TEXT NOT NULL DEFAULT (strftime('%Y-%m-%dT%H:%M:%fZ', 'now'))
|
||||
);
|
||||
INSERT INTO geo_cache_new (ip, country_code, country_name, asn, org, cached_at, last_seen)
|
||||
SELECT ip, country_code, country_name, asn, org, cached_at, cached_at FROM geo_cache;
|
||||
DROP TABLE geo_cache;
|
||||
ALTER TABLE geo_cache_new RENAME TO geo_cache;
|
||||
""",
|
||||
4: """
|
||||
-- Migration 4: Add scheduler_lock table for multi-worker safety.
|
||||
|
||||
@@ -4,7 +4,7 @@ build-backend = "hatchling.build"
|
||||
|
||||
[project]
|
||||
name = "bangui-backend"
|
||||
version = "0.9.19-rc.1"
|
||||
version = "0.9.19-rc.3"
|
||||
description = "BanGUI backend — fail2ban web management interface"
|
||||
requires-python = ">=3.12"
|
||||
dependencies = [
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
{
|
||||
"name": "bangui-frontend",
|
||||
"private": true,
|
||||
"version": "0.9.19-rc.2",
|
||||
"version": "0.9.19-rc.4",
|
||||
"description": "BanGUI frontend — fail2ban web management interface",
|
||||
"type": "module",
|
||||
"scripts": {
|
||||
|
||||
@@ -56,7 +56,7 @@ import React, {
|
||||
} from "react";
|
||||
import { useNavigate } from "react-router-dom";
|
||||
import * as authApi from "../api/auth";
|
||||
import { setUnauthorizedHandler, resetLogoutState, clearSessionCorrelationId } from "../api/client";
|
||||
import { ApiError, setUnauthorizedHandler, resetLogoutState, clearSessionCorrelationId } from "../api/client";
|
||||
import { setAuthErrorHandler, resetLogoutState as resetFetchErrorLogoutState } from "../utils/fetchError";
|
||||
import { STORAGE_KEY_AUTHENTICATED } from "../utils/constants";
|
||||
import { SessionValidationLoading } from "../components/SessionValidationLoading";
|
||||
@@ -133,6 +133,11 @@ export function AuthProvider({
|
||||
|
||||
const handleValidationError = useCallback(
|
||||
(error: Error): void => {
|
||||
// Suppress noisy warning for 5xx gateway errors (e.g. 502 Bad Gateway)
|
||||
// during startup — these are server-side issues, not network issues.
|
||||
if (error instanceof ApiError && error.status >= 500) {
|
||||
return;
|
||||
}
|
||||
// Network error — log but don't logout.
|
||||
console.warn("Session validation network error:", error);
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user