mirror of
https://github.com/Nezumi-2711/9router.git
synced 2026-09-22 13:38:31 +00:00
fix(auth): real client IP rate-limiting + remote default-password guard
- Add custom-server.js: inject unspoofable socket IP, strip client XFF (wired into Docker CMD + CLI spawn + build-cli copy) - loginLimiter: key on trusted x-9r-real-ip, TRUST_PROXY opt-in, global fallback - Force password change on first remote login while default is in use - Add /api/auth/reset-password (local-only) so CLI reset writes live SQLite - CLI settings: reset via API instead of stale db.json - Fix OAuth modals opening duplicate browser tabs on add-connection - Add cli:pack / cli:publish scripts Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
+6
-2
@@ -470,9 +470,13 @@ function openBrowser(url) {
|
||||
});
|
||||
}
|
||||
|
||||
// Find standalone server (bundled in bin/app for published package)
|
||||
// Find standalone server (bundled in bin/app for published package).
|
||||
// Prefer custom-server.js (injects real socket IP) when present.
|
||||
const standaloneDir = path.join(__dirname, "app");
|
||||
const serverPath = path.join(standaloneDir, "server.js");
|
||||
const customServerPath = path.join(standaloneDir, "custom-server.js");
|
||||
const serverPath = fs.existsSync(customServerPath)
|
||||
? customServerPath
|
||||
: path.join(standaloneDir, "server.js");
|
||||
|
||||
if (!fs.existsSync(serverPath)) {
|
||||
console.error("Error: Standalone build not found.");
|
||||
|
||||
Reference in New Issue
Block a user