Skip to content
This repository has been archived by the owner on Oct 10, 2024. It is now read-only.

Commit

Permalink
chore: removed unused file, temporary icon, actual cli
Browse files Browse the repository at this point in the history
  • Loading branch information
IncognitoTGT committed Mar 26, 2024
1 parent 48a2c00 commit f748808
Show file tree
Hide file tree
Showing 6 changed files with 58 additions and 90 deletions.
2 changes: 2 additions & 0 deletions ephemeral
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
#!/usr/bin/env tsx
await import("./index.ts")
77 changes: 41 additions & 36 deletions index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand All @@ -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 {
Expand Down Expand Up @@ -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"));
Expand Down Expand Up @@ -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}
`);
6 changes: 3 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,17 +1,17 @@
{
"name": "ephemeral",
"private": true,
"version": "0.7.0",
"version": "0.8.0",
"type": "module",
"scripts": {
"preinstall": "npx only-allow pnpm",
"ephemeral": "tsx index.ts",
"dev": "pnpm ephemeral --dev",
"dev": "tsx index.ts --dev",
"build": "tsc && vite build",
"lint": "eslint . --ext ts,tsx --report-unused-disable-directives --max-warnings 0",
"format": "prettier --write .",
"bstart": "pnpm build && pnpm start",
"start": "pnpm ephemeral"
"start": "tsx index.ts"
},
"dependencies": {
"@mercuryworkshop/bare-mux": "^1.0.5",
Expand Down
41 changes: 0 additions & 41 deletions src/components/Navbar.tsx

This file was deleted.

7 changes: 5 additions & 2 deletions src/layout.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import Meta from "@/components/Meta";
import { Toaster } from "@/components/ui/toaster";
import { ThemeProvider } from "@/components/theme-provider";
import { Link } from "react-router-dom";
import { LucideHome, Settings, LayoutGrid } from "lucide-react";
import { LucideHome, Settings, LayoutGrid, CircleDashed } from "lucide-react";
import {
NavigationMenu,
NavigationMenuItem,
Expand All @@ -27,7 +27,10 @@ function Navbar() {
return (
<div className="flex justify-between">
<div className={`p-5 text-2xl font-bold text-foreground`}>
<Link to="/">Ephemeral</Link>
<Link to="/" className="flex items-center justify-center">
<CircleDashed className="mr-2 flex size-6 flex-row" strokeWidth={3} />
Ephemeral
</Link>
</div>
<div className="justify-end p-5">
<NavigationMenu>
Expand Down
15 changes: 7 additions & 8 deletions src/pages/Settings.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import ProxySettings from "./settings/ProxySettings";
import CloakSettings from "./settings/CloakSettings";
import SearchSettings from "./settings/SearchSettings";
import Header from "@/components/Header";
import { Info } from "lucide-react";
import { Info, CircleDashed } from "lucide-react";
import { Button } from "@/components/ui/button";
import { ModeToggle } from "@/components/mode-toggle";
import lastPushDate from "@/push-date?raw";
Expand Down Expand Up @@ -41,15 +41,14 @@ export default function Settings() {
</DialogTrigger>
<DialogContent>
<DialogHeader>
<DialogTitle className="m-2 text-center text-foreground">
Ephemeral 0.7.0 - Beta
<DialogTitle className="m-2 flex items-center justify-center text-center text-2xl text-foreground">
<CircleDashed
className="mr-2 flex size-6 flex-row"
strokeWidth={3}
/>
Ephemeral 0.8.0 - Beta
</DialogTitle>
<DialogDescription className="items-center justify-center text-foreground">
<img
src="/ephemeral.png"
alt="Ephemeral"
className="mx-auto mb-6 h-96 w-96 rounded-lg"
/>
Ephemeral is a powerful proxy with Ultraviolet and other
features, made by the z1g Project.
<br />
Expand Down

0 comments on commit f748808

Please sign in to comment.