feat: enhance DoH profile management and resolver policy in modules
CI / changes (push) Successful in 6s
CI / openapi (push) Successful in 1m2s
CI / go (push) Successful in 27s
CI / docker-web (push) Successful in 1m27s
CI / docker-bird (push) Has been skipped
CI / bird2 (push) Successful in 16s
CI / docker-go (push) Successful in 8m5s

- Added `DohResolverPolicy` schema to OpenAPI documentation, defining policies for domain resolution.
- Updated module handling to support multiple DoH profiles via `doh_profile_ids` and introduced `doh_resolver_policy` in the API.
- Refactored related functions to accommodate the new DoH profile structure, ensuring backward compatibility with existing `doh_profile_id`.
- Enhanced UI components to allow selection and management of DoH profiles and policies in the web interface.
- Updated database interactions to handle new fields and ensure proper data normalization.
This commit is contained in:
Denozordec
2026-05-19 14:57:50 +07:00
parent a536a2d5eb
commit 34ecc5c235
21 changed files with 810 additions and 114 deletions
+7
View File
@@ -8,6 +8,8 @@ export type Page<T> = {
// ---- Modules ----
export type ModuleType = 'AS_PREFIXES' | 'CDN_CIDRS' | 'DOMAINS' | 'IP_RANGES';
export type DohResolverPolicy = 'primary_only' | 'failover' | 'union';
export type ModuleRow = {
id: string;
type: ModuleType;
@@ -17,7 +19,10 @@ export type ModuleRow = {
refresh_interval_sec: number | null;
cron_expr: string | null;
default_community_id: string | null;
/** @deprecated use doh_profile_ids */
doh_profile_id: string | null;
doh_profile_ids: string[];
doh_resolver_policy: DohResolverPolicy;
last_refreshed_at: string | null;
};
export type ModulesResponse = Page<ModuleRow>;
@@ -36,6 +41,8 @@ export type ModuleCreate = {
enabled?: boolean;
priority?: number;
doh_profile_id?: string | null;
doh_profile_ids?: string[];
doh_resolver_policy?: DohResolverPolicy;
refresh_interval_sec?: number | null;
cron_expr?: string | null;
default_community_id?: string | null;