mirror of
https://github.com/andrey271192/amnezia_web.git
synced 2026-09-20 14:41:59 +00:00
fix: reset admin password on reinstall
This commit is contained in:
committed by
andrey271192
parent
0a3f9de717
commit
0143eafde7
19
server.js
19
server.js
@@ -29,6 +29,11 @@ function envTruthy(v) {
|
||||
return s === "1" || s === "true" || s === "yes";
|
||||
}
|
||||
|
||||
function proToolsEnabled() {
|
||||
const edition = process.env.PANEL_EDITION?.trim().toLowerCase();
|
||||
return envTruthy(process.env.ENABLE_PRO_TOOLS) || edition === "pro";
|
||||
}
|
||||
|
||||
/** Какие блоки веб-интерфейса скрыты: `UI_HIDE_SECTIONS=users,warp,cascade` или `UI_HIDE_USERS` и т.д. */
|
||||
function resolveUiHidden() {
|
||||
const raw = process.env.UI_HIDE_SECTIONS?.trim();
|
||||
@@ -101,19 +106,21 @@ function panelPromoFooterPayload() {
|
||||
}
|
||||
|
||||
function editionPayload() {
|
||||
const pro = proToolsEnabled();
|
||||
return {
|
||||
readOnlyClients: false,
|
||||
allowDeleteClients: true,
|
||||
showDebugWg: false,
|
||||
proHostTools: false,
|
||||
showDebugWg: pro,
|
||||
proHostTools: pro,
|
||||
};
|
||||
}
|
||||
|
||||
function effectiveUiHidden() {
|
||||
const pro = proToolsEnabled();
|
||||
return {
|
||||
users: UI_HIDDEN.users,
|
||||
warp: true,
|
||||
cascade: true,
|
||||
warp: UI_HIDDEN.warp || !pro,
|
||||
cascade: UI_HIDDEN.cascade || !pro,
|
||||
mtproto: UI_HIDDEN.mtproto,
|
||||
};
|
||||
}
|
||||
@@ -424,6 +431,10 @@ function rejectUnavailableFeature(res) {
|
||||
}
|
||||
|
||||
function requireProTier(_req, res, next) {
|
||||
if (proToolsEnabled()) {
|
||||
next();
|
||||
return;
|
||||
}
|
||||
rejectUnavailableFeature(res);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user