This repository has been archived by the owner on Oct 10, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 19
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
chore: removed unused file, temporary icon, actual cli
- Loading branch information
1 parent
48a2c00
commit f748808
Showing
6 changed files
with
58 additions
and
90 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
#!/usr/bin/env tsx | ||
await import("./index.ts") |
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 |
---|---|---|
|
@@ -18,32 +18,38 @@ import { epoxyPath } from "@mercuryworkshop/epoxy-transport"; | |
// @ts-expect-error stfu | ||
import { baremuxPath } from "@mercuryworkshop/bare-mux"; | ||
const devMode = argv.includes("--dev"); | ||
const usingMasqr = argv.includes("--masqr"); | ||
const usingMasqr = process.env.MASQR || argv.includes("--masqr"); | ||
const noIpLeak = argv.includes("--no-ip-leak"); | ||
const port = | ||
process.env.PORT || | ||
(argv.includes("--port") && argv[argv.indexOf("--port") + 1]) || | ||
8080; | ||
config.config(); | ||
process.chdir(import.meta.url.replace("file://", "").replace("index.ts", "")); | ||
if (argv.includes("-h") || argv.includes("--help")) { | ||
console.log(` | ||
\x1b[34;49;1mEphemeral | ||
--------- | ||
\x1B[32m | ||
default: Run in production mode | ||
--dev: Run in development mode | ||
--help, -h: Display this help message | ||
--masqr: Enable masqr | ||
--no-ip-leak: only allow going to asdf.com | ||
\x1b[34;49mEphemeral | ||
\x1b[37;49m | ||
default: Run in production mode | ||
--port <port>: Specify the port to run on | ||
--dev: Run in development mode | ||
--help, -h: Display this help message | ||
--masqr: Enable masqr | ||
--no-ip-leak: only allow going to asdf.com | ||
`); | ||
process.exit(0); | ||
} | ||
const bare = createBareServer("/bend/", { | ||
maintainer: { | ||
website: "https://z1g-project.vercel.app", | ||
// todo: change this | ||
email: "[email protected]", | ||
}, | ||
}); | ||
const vite = await createViteServer({ | ||
server: { middlewareMode: true }, | ||
}); | ||
const app = express(); | ||
const port = process.env.PORT || 8080; | ||
const corsOptions = { | ||
origin: `http://localhost:${port}`, | ||
methods: "GET,HEAD,PUT,PATCH,POST,DELETE", | ||
|
@@ -65,6 +71,26 @@ const setCjsHeaders = { | |
}; | ||
app.use(compression(compressionOptions)); | ||
app.use(cors(corsOptions)); | ||
app.get("/json/apps", async (_, response) => { | ||
try { | ||
const data = await fetch("https://incognitotgt.me/ephemeral/apps.json") | ||
.then(statusValidator) | ||
.then((response) => response.json()) | ||
.then((response) => Array(20).fill(response).flat()) | ||
.catch(statusCatcher); | ||
|
||
response.json({ status: "success", data }); | ||
} catch (error) { | ||
console.log(error); | ||
response.status(500).json({ | ||
status: "error", | ||
error: { | ||
message: "An error occurred while retrieving the apps", | ||
detail: error, | ||
}, | ||
}); | ||
} | ||
}); | ||
if (!devMode) { | ||
app.use(express.static("dist", setCjsHeaders)); | ||
} else { | ||
|
@@ -106,26 +132,6 @@ app.get("/search", async (request, response) => { | |
}); | ||
} | ||
}); | ||
app.get("/json/apps", async (_, response) => { | ||
try { | ||
const data = await fetch("https://incognitotgt.me/ephemeral/apps.json") | ||
.then(statusValidator) | ||
.then((response) => response.json()) | ||
.then((response) => Array(20).fill(response).flat()) | ||
.catch(statusCatcher); | ||
|
||
response.json({ status: "success", data }); | ||
} catch (error) { | ||
console.log(error); | ||
response.status(500).json({ | ||
status: "error", | ||
error: { | ||
message: "An error occurred while retrieving the apps", | ||
detail: error, | ||
}, | ||
}); | ||
} | ||
}); | ||
if (!devMode) { | ||
app.get("*", (_, response) => { | ||
response.sendFile(path.resolve("dist", "index.html")); | ||
|
@@ -164,9 +170,8 @@ server.on("upgrade", (req: IncomingMessage, socket: Socket, head) => { | |
server.listen({ | ||
port: port, | ||
}); | ||
console.log( | ||
`\x1b[34;49;1m[Ephemeral] \x1B[32mINFO: Running on port ${port} in ${devMode ? "dev" : "production"} mode | ||
\x1b[34;49;1m[Ephemeral] \x1B[32mINFO: Configured with Masqr: ${masqr} | ||
\x1b[34;49;1m[Ephemeral] \x1B[32mINFO: Configured with IP Leak Protection: ${noIpLeak} | ||
`, | ||
); | ||
console.log(` | ||
\x1b[34;49;1m[Ephemeral] \x1B[32mINFO: Running on port ${port} in ${devMode ? "dev" : "production"} mode | ||
Configured with Masqr: ${masqr} | ||
Configured with IP Leak Protection: ${noIpLeak} | ||
`); |
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