mirror of
https://github.com/diegosouzapw/OmniRoute.git
synced 2026-08-07 15:52:52 +03:00
Release v3.8.33 (#4515)
Release v3.8.33 — full CHANGELOG in the PR body. Blocking gates green (Build, Lint, Unit Tests 8/8, Package Artifact, Quality Gates, Quality Ratchet, Docs Sync, PR Test Policy, test-vitest). Admin-merged over a Node 26 future-compat timer flake (1/4) + an E2E UI flake (3/9) — both verified non-deterministic; full test:unit validated locally (16936 pass).
This commit is contained in:
committed by
GitHub
parent
bfaf459f3c
commit
ee24eb52d4
@@ -9,6 +9,7 @@ import { cliMitmStartSchema, cliMitmStopSchema } from "@/shared/validation/schem
|
||||
import { isValidationFailure, validateBody } from "@/shared/validation/helpers";
|
||||
import { resolveApiKey } from "@/shared/services/apiKeyResolver";
|
||||
import { isRoot } from "@/mitm/systemCommands";
|
||||
import { isSudoPasswordRequired } from "@/mitm/dns/dnsConfig";
|
||||
|
||||
// GET - Check MITM status
|
||||
export async function GET(request) {
|
||||
@@ -18,12 +19,21 @@ export async function GET(request) {
|
||||
try {
|
||||
const { getMitmStatus, getCachedPassword } = await import("@/mitm/manager.runtime");
|
||||
const status = await getMitmStatus();
|
||||
const isWin = process.platform === "win32";
|
||||
const hasCachedPassword = !!getCachedPassword();
|
||||
// Probe sudo availability so the UI can hide the password modal on hosts
|
||||
// where it's unnecessary (Windows, root user, NOPASSWD sudoers, minimal
|
||||
// containers without sudo). MITM elevation is decided by the server OS,
|
||||
// not by the browser's user agent — see PR title.
|
||||
const needsSudoPassword = !isWin && !hasCachedPassword && isSudoPasswordRequired();
|
||||
return NextResponse.json({
|
||||
running: status.running,
|
||||
pid: status.pid || null,
|
||||
dnsConfigured: status.dnsConfigured || false,
|
||||
certExists: status.certExists || false,
|
||||
hasCachedPassword: !!getCachedPassword(),
|
||||
hasCachedPassword,
|
||||
isWin,
|
||||
needsSudoPassword,
|
||||
});
|
||||
} catch (error) {
|
||||
console.log("Error getting MITM status:", sanitizeErrorMessage(error));
|
||||
@@ -71,12 +81,15 @@ export async function POST(request) {
|
||||
const isRootUser = !isWin && isRoot();
|
||||
const pwd = sudoPassword || getCachedPassword() || "";
|
||||
|
||||
if (!isWin && !pwd && !isRootUser) {
|
||||
// Require a sudo password only when the OS actually needs one. Skips the
|
||||
// prompt on Windows (UAC), root, NOPASSWD sudoers, and minimal containers
|
||||
// without sudo on PATH (#822).
|
||||
if (!isWin && !pwd && !isRootUser && isSudoPasswordRequired()) {
|
||||
return NextResponse.json({ error: "Missing sudoPassword" }, { status: 400 });
|
||||
}
|
||||
|
||||
const result = await startMitm(apiKey, pwd);
|
||||
if (!isWin) setCachedPassword(pwd);
|
||||
if (!isWin && pwd) setCachedPassword(pwd);
|
||||
|
||||
return NextResponse.json({
|
||||
success: true,
|
||||
@@ -124,7 +137,10 @@ export async function DELETE(request) {
|
||||
const isRootUser = !isWin && isRoot();
|
||||
const pwd = sudoPassword || getCachedPassword() || "";
|
||||
|
||||
if (!isWin && !pwd && !isRootUser) {
|
||||
// Require a sudo password only when the OS actually needs one. Skips the
|
||||
// prompt on Windows (UAC), root, NOPASSWD sudoers, and minimal containers
|
||||
// without sudo on PATH (#822).
|
||||
if (!isWin && !pwd && !isRootUser && isSudoPasswordRequired()) {
|
||||
return NextResponse.json({ error: "Missing sudoPassword" }, { status: 400 });
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user