Skip to content

Commit fb042e7

Browse files
author
juniorbutyeah
committed
Interstellar V7
Major rewrite with Scramjet proxy engine. - Migrated from Ultraviolet to Scramjet - React 19 tabbed browser interface - Build-time obfuscation system - 12 theme options - Tab cloaking and panic key support
1 parent 8541be7 commit fb042e7

40 files changed

Lines changed: 3689 additions & 1209 deletions

astro.config.ts

Lines changed: 14 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,12 @@
1-
import { execSync } from "node:child_process";
1+
import { execFileSync } from "node:child_process";
22
import path from "node:path";
33
import node from "@astrojs/node";
44
import react from "@astrojs/react";
55
import tailwind from "@astrojs/tailwind";
66
import { baremuxPath } from "@mercuryworkshop/bare-mux/node";
7-
// @ts-expect-error shut
87
import { epoxyPath } from "@mercuryworkshop/epoxy-transport";
9-
// @ts-expect-error shut
108
import { server as wisp } from "@mercuryworkshop/wisp-js/server";
119
import compress from "@playform/compress";
12-
import { uvPath } from "@titaniumnetwork-dev/ultraviolet";
1310
import { defineConfig } from "astro/config";
1411
import { viteStaticCopy } from "vite-plugin-static-copy";
1512
import INConfig from "./config";
@@ -29,7 +26,6 @@ if (INConfig.server?.compress !== false) {
2926
);
3027
}
3128

32-
// https://astro.build/config
3329
export default defineConfig({
3430
output: "server",
3531
adapter: node({
@@ -50,9 +46,20 @@ export default defineConfig({
5046
],
5147
},
5248
vite: {
53-
logLevel: "warn",
49+
logLevel: "warn",
5450
define: {
55-
__COMMIT_DATE__: JSON.stringify(execSync("git show --no-patch --format=%ci").toString().trim()),
51+
__COMMIT_DATE__: JSON.stringify(
52+
(() => {
53+
try {
54+
return execFileSync("git", ["show", "--no-patch", "--format=%ci"])
55+
.toString()
56+
.trim()
57+
.replace(/[<>"'&]/g, "");
58+
} catch {
59+
return new Date().toISOString();
60+
}
61+
})(),
62+
),
5663
},
5764
resolve: {
5865
alias: {
@@ -80,12 +87,6 @@ export default defineConfig({
8087
overwrite: false,
8188
rename: (name) => `bm-${name}.js`,
8289
},
83-
{
84-
src: `${uvPath}/**/*.js`.replace(/\\/g, "/"),
85-
dest: "assets/bundled",
86-
overwrite: false,
87-
rename: (name) => `${name.replace("uv", "v").replace(/[aeiou]/gi, "")}.js`,
88-
},
8990
],
9091
}),
9192
],

biome.json

Lines changed: 11 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,22 @@
11
{
2-
"$schema": "https://biomejs.dev/schemas/2.2.4/schema.json",
2+
"$schema": "https://biomejs.dev/schemas/2.3.9/schema.json",
3+
"files": {
4+
"ignoreUnknown": true,
5+
"includes": ["**", "!**/src/global.css", "!**/.astro"]
6+
},
37
"assist": { "actions": { "source": { "organizeImports": "on" } } },
48
"linter": {
59
"enabled": true,
610
"rules": {
711
"recommended": true
8-
},
9-
"includes": ["**", "!**/pnpm-lock.yaml", "!**/dist/**", "!**/node_modules/**", "!**/assets/bundled/**", "!**/.astro/**"]
12+
}
1013
},
1114
"formatter": {
1215
"indentStyle": "space",
1316
"indentWidth": 2,
1417
"lineEnding": "lf",
1518
"lineWidth": 320,
16-
"attributePosition": "auto",
17-
"includes": ["**", "!**/pnpm-lock.yaml", "!**/dist/**", "!**/node_modules/**", "!**/assets/bundled/**", "!**/.astro/**"]
19+
"attributePosition": "auto"
1820
},
1921
"javascript": {
2022
"formatter": {
@@ -27,7 +29,10 @@
2729
"indentWidth": 3
2830
},
2931
"linter": {
30-
"enabled": true
32+
"enabled": false
33+
},
34+
"parser": {
35+
"cssModules": true
3136
}
3237
},
3338
"overrides": [

config.ts

Lines changed: 35 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,23 +1,46 @@
11
import type { Config } from "@/types/config";
22

3+
function buildAuthUsers(): Record<string, string> {
4+
const users: Record<string, string> = {};
5+
6+
const authUser = process.env.AUTH_USER;
7+
const authPass = process.env.AUTH_PASS;
8+
if (authUser && authPass) {
9+
users[authUser] = authPass;
10+
}
11+
12+
const authUsersJson = process.env.AUTH_USERS;
13+
if (authUsersJson) {
14+
try {
15+
const parsed = JSON.parse(authUsersJson);
16+
Object.assign(users, parsed);
17+
} catch {
18+
console.error("Failed to parse AUTH_USERS environment variable as JSON");
19+
}
20+
}
21+
22+
return users;
23+
}
24+
325
const config: Config = {
4-
// Server Configuration
526
server: {
6-
port: 8080, // The port on which Interstellar runs (Default: 8080)
7-
obfuscate: true, // Set to false to disable obfuscation
8-
compress: true, // Set to false to disable compression
27+
port: Number(process.env.PORT) || 8080,
28+
obfuscate: process.env.OBFUSCATE !== "false",
29+
compress: process.env.COMPRESS !== "false",
930
},
1031

11-
// Password Protection (Optional)
1232
auth: {
13-
// Enable password protection for your instance.
14-
challenge: false, // Set to true to require users to log in.
15-
// Add your users here: username: "password"
16-
// WARNING: Change default credentials before using
17-
users: {
18-
interstellar: "password",
19-
},
33+
challenge: process.env.AUTH_CHALLENGE === "true",
34+
users: buildAuthUsers(),
2035
},
2136
};
2237

38+
if (config.auth?.challenge && Object.keys(config.auth.users || {}).length === 0) {
39+
console.error("\x1b[31mError: AUTH_CHALLENGE is enabled but no users configured.\x1b[0m");
40+
console.error("Set AUTH_USER and AUTH_PASS environment variables, or AUTH_USERS as JSON.");
41+
console.error("Example: AUTH_USER=admin AUTH_PASS=secretpassword");
42+
console.error('Example: AUTH_USERS=\'{"admin":"password123"}\'');
43+
process.exit(1);
44+
}
45+
2346
export default config;

0 commit comments

Comments
 (0)