P7 r8 fixes: lazy mounts catch ProviderNotActiveError (503 not 500), wg redeem added to PUBLIC_ROUTES (redemption is sessionless), live-curl probe script
This commit is contained in:
3 files changed
+90
-2
No files matched your search
@@ -788,7 +788,12 @@ async function createApp() {
|
||||
// factory requires a provider at construction; get one only when the
|
||||
// WireGuard provider is registered, else mount a 503 stub.
|
||||
const p7WgProviderFactory = () => {
|
||||
const prov = getActiveProvider();
|
||||
let prov = null;
|
||||
try {
|
||||
prov = getActiveProvider();
|
||||
} catch (_inactive) {
|
||||
return null; // registry throws ProviderNotActiveError when inactive
|
||||
}
|
||||
return prov && prov.id && prov.id() === 'wireguard' ? prov : null;
|
||||
};
|
||||
let p7WgRedeemRouter = null;
|
||||
@@ -820,7 +825,12 @@ async function createApp() {
|
||||
let p7ForwardAuthRouter = null;
|
||||
const p7ForwardAuthLazy = (req, res, next) => {
|
||||
if (!p7ForwardAuthRouter) {
|
||||
const prov = getActiveProvider();
|
||||
let prov = null;
|
||||
try {
|
||||
prov = getActiveProvider();
|
||||
} catch (_inactive) {
|
||||
prov = null; // registry throws ProviderNotActiveError when inactive
|
||||
}
|
||||
if (!prov) {
|
||||
return res.status(503).json({ error: 'network provider not active' });
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user