forked from bia-pain-bache/BPB-Worker-Panel
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
e852e2c
commit 84d4f1b
Showing
15 changed files
with
87 additions
and
136 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
import { isValidUUID } from './helpers.js'; | ||
const proxyIPs = ['bpb.yousef.isegaro.com']; | ||
let userID, dohURL, proxyIP, trojanPassword, defaultHttpPorts, defaultHttpsPorts, panelVersion; | ||
|
||
function initParams(env) { | ||
userID = env.UUID || '89b3cbba-e6ac-485a-9481-976a0415eab9'; | ||
if (!isValidUUID(userID)) throw new Error(`Invalid UUID: ${userID}`); | ||
dohURL = env.DOH_URL || 'https://cloudflare-dns.com/dns-query'; | ||
proxyIP = env.PROXYIP || proxyIPs[Math.floor(Math.random() * proxyIPs.length)]; | ||
trojanPassword = env.TROJAN_PASS || 'bpb-trojan'; | ||
defaultHttpPorts = ['80', '8080', '2052', '2082', '2086', '2095', '8880']; | ||
defaultHttpsPorts = ['443', '8443', '2053', '2083', '2087', '2096']; | ||
panelVersion = '2.7.2'; | ||
} | ||
|
||
export function initializeParams(env) { | ||
initParams(env); | ||
return Promise.resolve(); | ||
} | ||
|
||
export { userID, dohURL, proxyIP, trojanPassword, defaultHttpPorts, defaultHttpsPorts, panelVersion }; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,7 @@ | ||
import { configs } from '../helpers/config.js'; | ||
const { defaultHttpPorts, defaultHttpsPorts, panelVersion } = configs; | ||
let userID = configs.userID; | ||
import { initializeParams, userID, defaultHttpPorts, defaultHttpsPorts, panelVersion } from "../helpers/init.js"; | ||
|
||
export function renderHomePage (request, env, hostName, proxySettings, isPassSet) { | ||
userID = env.UUID || userID; | ||
export async function renderHomePage (request, env, hostName, proxySettings, isPassSet) { | ||
await initializeParams(env); | ||
const { | ||
remoteDNS, | ||
localDNS, | ||
|
@@ -72,6 +70,7 @@ export function renderHomePage (request, env, hostName, proxySettings, isPassSet | |
<head> | ||
<meta charset="UTF-8"> | ||
<meta name="viewport" content="width=device-width, initial-scale=1.0"> | ||
<meta name="timestamp" content=${Date.now()}> | ||
<title>BPB Panel ${panelVersion}</title> | ||
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/4.7.0/css/font-awesome.min.css"> | ||
<link rel="stylesheet" href="https://fonts.googleapis.com/css2?family=Material+Symbols+Outlined:opsz,wght,FILL,[email protected],100..700,0..1,-50..200" /> | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.