Skip to content

Commit 0860c36

Browse files
committed
feat: add custom oauth for auth, fix auth and linting bugs and errors
1 parent 6a80203 commit 0860c36

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

83 files changed

+649
-618
lines changed

apps/daemon/src/index.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ import { docker } from "~/lib/docker";
99
import sessionHandler from "~/session";
1010
import workspaceHandler from "~/workspace";
1111
import generateToken from "./lib/auth-token";
12+
1213
const config = getConfig();
1314
export const app = new Elysia()
1415
.get("/", async (c) => {

apps/daemon/src/lib/config/index.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ import { load } from "js-yaml";
33
import defaultSchema from "~/../schema.json";
44
import getConfigFile from "./location";
55
import type { Config } from "./types";
6+
67
let loadedConfig: unknown;
78
try {
89
loadedConfig = load(await (await getConfigFile()).text());

apps/daemon/src/lib/docker.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
import Dockerode from "dockerode";
22
import { getConfig } from "~/lib/config";
3+
34
const { docker: config } = getConfig();
45
const socketConfig: Dockerode.DockerOptions = { socketPath: config.socket || "/var/run/docker.sock" };
56
const httpConfig: Dockerode.DockerOptions = {

apps/daemon/src/lib/network-check.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
import { getConfig } from "~/lib/config";
22
import { docker } from "~/lib/docker";
3+
34
const { docker: config } = getConfig();
45

56
export default async function checkDockerNetwork() {

apps/daemon/src/server.ts

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,19 @@
11
#!/usr/bin/env bun
22
import "./help-message";
33
import { getConfig, validateConfig } from "~/lib/config";
4+
45
if (!validateConfig(getConfig())) {
56
console.error("Invalid configuration");
67
process.exit(1);
78
}
8-
import { type Socket, connect } from "node:net";
9+
10+
import { connect, type Socket } from "node:net";
911
import generateToken from "~/lib/auth-token";
1012
import { docker } from "~/lib/docker";
1113
import checkDockerNetwork from "~/lib/network-check";
1214
import checkSystemService from "~/lib/service-check";
1315
import { app } from ".";
16+
1417
await checkDockerNetwork();
1518
const config = getConfig();
1619
if (typeof config.service !== "boolean" || config.service === true) {

apps/daemon/src/session/index.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ export default new Elysia({ prefix: "/sessions" })
1515
return {
1616
success: true,
1717
id: session.Id,
18-
created: new Date().getTime(),
18+
created: Date.now(),
1919
};
2020
},
2121
{

apps/daemon/src/workspace/index.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
import { Elysia, type Static, t } from "elysia";
22
import { docker } from "~/lib/docker";
33
import { pullImage } from "./pull";
4+
45
const statuses = t.Union([
56
t.Literal("pulled"),
67
t.Literal("in-progress"),

apps/web/next.config.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ import "@stardust/config/load-config";
22
import { execSync } from "node:child_process";
33
import NextBundleAnalyzer from "@next/bundle-analyzer";
44
import type { NextConfig } from "next";
5+
56
const nextConfig: NextConfig = {
67
transpilePackages: ["@stardust/common"],
78
images: {

apps/web/package.json

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,6 @@
4242
"class-variance-authority": "^0.7.1",
4343
"clsx": "^2.1.1",
4444
"geist": "^1.3.1",
45-
"i": "^0.3.7",
4645
"lucide-react": "^0.460.0",
4746
"next": "15.4.2-canary.20",
4847
"next-themes": "^0.4.6",

apps/web/server.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,10 @@
11
import "@stardust/config/load-config";
22
import { createServer } from "node:http";
3-
import scheduleAutoDelete from "@/lib/session/auto-delete";
43
import { shouldRoute, stardustdUpgrade } from "@stardust/common/session/ws";
54
import { getConfig, validateConfig } from "@stardust/config";
65
import next from "next";
6+
import scheduleAutoDelete from "@/lib/session/auto-delete";
7+
78
const config = getConfig();
89
if (!validateConfig(config)) {
910
console.error("✨ Stardust: Config file schema invalid");

0 commit comments

Comments
 (0)