Skip to content
Open
Show file tree
Hide file tree
Changes from 23 commits
Commits
Show all changes
41 commits
Select commit Hold shift + click to select a range
720cd28
✨ Refactor: Improve JSON column handling and table creation
Its4Nik Oct 1, 2025
97eb386
📝 Update README and package version
Its4Nik Oct 1, 2025
ac46ab9
✨ Feature: Implement Plugin Support and Theme Enhancements
Its4Nik Oct 8, 2025
6bfb529
feat(core): Plugin handler and runtime
Its4Nik Oct 9, 2025
a79207f
feat(lockfile): Remove bun.lock file
Its4Nik Oct 9, 2025
1385176
feat(sqlite-wrapper): Enhance create table and add metadata handling
Its4Nik Oct 11, 2025
038a2b5
feat(dockstore): Initial commit for dockstore app
Its4Nik Oct 12, 2025
62d7a27
feat(dockstacks): Remove writeStackToDisk function call
Its4Nik Oct 12, 2025
d33e551
feat(docknode): Implement Dockstack deployment endpoint
Its4Nik Oct 12, 2025
44b3509
feat(docknode): Refactor dockstack deployment and add auth plugin
Its4Nik Oct 14, 2025
25b8921
feat(logger): Refactor logger to support hierarchical logging
Its4Nik Oct 14, 2025
cae40ca
feat(dockstore): Implement plugin architecture and initial plugins
Its4Nik Oct 15, 2025
ed22e62
fix(dockstat): update dependencies and add elysia-react-router
Its4Nik Oct 20, 2025
5b767b6
feat(docknode): Implement docknode application
Its4Nik Oct 20, 2025
89bd4a6
feat(bun.lock): Add docknode app and update dependencies
Its4Nik Oct 20, 2025
13504d7
feat(dockstat): Refactor DockStat API with Elysia and backend routes
Its4Nik Oct 20, 2025
4a88972
feat(docknode): Refactor docknode application
Its4Nik Oct 20, 2025
c3a3824
✨ Refactor: Modernize DockStat app and server
Its4Nik Oct 22, 2025
5f30ce9
🐛 Fix: Correctly derive file and line number in logger
Its4Nik Oct 22, 2025
dc7ac3b
✨ Initial commit: React Router × ElysiaJS template
Its4Nik Oct 22, 2025
d9f5a08
📝 Update template package details and installation instructions
Its4Nik Oct 22, 2025
5eddd45
⬆️ Bump version to 1.0.2
Its4Nik Oct 22, 2025
9f824e6
```
Its4Nik Oct 22, 2025
aaba5a5
✨ API: Enhance API Functionality and Structure
Its4Nik Oct 23, 2025
9e3b5eb
feat(plugin-handler): Implement PluginHandler class and update depend…
Its4Nik Oct 23, 2025
e52220a
✨ Implement Plugin Handler
Its4Nik Oct 24, 2025
dd85dca
♻️ Refactor: Plugin Handler and Dependencies
Its4Nik Oct 24, 2025
7b6748d
🔥 Remove code: Delete unused plugin types
Its4Nik Oct 24, 2025
06967b5
✨ Refactor: Enhance plugin handler and SQLite wrapper
Its4Nik Oct 28, 2025
25319d2
✨ Add module and JSON parsing to query builder
Its4Nik Oct 29, 2025
9f426af
✨ feat: Introduce Plugin System with Database Integration
Its4Nik Oct 29, 2025
23d463d
```
Its4Nik Oct 29, 2025
7287bd0
✨ Feature: Enhance plugin system and API with new functionalities and…
Its4Nik Oct 30, 2025
27562f0
feat(deps): Update dependencies and add bunfig.toml files
Its4Nik Oct 30, 2025
ca80ca7
✨ feat: Add UI package with shared components
Its4Nik Oct 31, 2025
9a389b2
✨ feat: Theme provider and component styling updates
Its4Nik Nov 1, 2025
e83cc65
🚀 Bump @biomejs/biome to v2.3.3
Its4Nik Nov 5, 2025
6c7e2cc
✨ Improve intro screen animation and add message prop
Its4Nik Nov 5, 2025
3274ca6
🚀 Implement Plugin Store UI with UI Package
Its4Nik Nov 5, 2025
039969b
✨ Implement Extension Browser and related actions
Its4Nik Nov 6, 2025
e042ba0
✨ Implement repo manifest endpoint and plugin fetching
Its4Nik Nov 6, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions apps/docknode/.dockerignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
.gitignore
.dockstacks_instance_uuid.txt
dockerfile
.env
.prod.env
.dev.envw
node_modules
1 change: 1 addition & 0 deletions apps/docknode/.dockstacks_instance_uuid.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
34ca4e88-4ffc-40b5-b72e-592854728b5a
42 changes: 42 additions & 0 deletions apps/docknode/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
# See https://help.github.com/articles/ignoring-files/ for more about ignoring files.

# dependencies
/node_modules
/.pnp
.pnp.js

# testing
/coverage

# next.js
/.next/
/out/

# production
/build

# misc
.DS_Store
*.pem

# debug
npm-debug.log*
yarn-debug.log*
yarn-error.log*

# local env files
.env.local
.env.development.local
.env.test.local
.env.production.local

# vercel
.vercel

**/*.trace
**/*.zip
**/*.tar.gz
**/*.tgz
**/*.log
package-lock.json
**/*.bun
15 changes: 15 additions & 0 deletions apps/docknode/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
# Elysia with Bun runtime

## Getting Started
To get started with this template, simply paste this command into your terminal:
```bash
bun create elysia ./elysia-example
```

## Development
To start the development server run:
```bash
bun run dev
```

Open http://localhost:3000/ with your browser to see the result.
8 changes: 8 additions & 0 deletions apps/docknode/dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
FROM oven/bun:1.3 as BASE

FROM BASE AS BUNINSTALL
WORKDIR "/tmp/docknode-installer"
COPY . /tmp

RUN bun install
RUN bun run build
9 changes: 9 additions & 0 deletions apps/docknode/environment.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
declare module "bun" {
interface Env {
DOCKNODE_DOCKSTACK_AUTH_PSK?: string;
DOCKNODE_DOCKSTACK_DEV_AUTH?: string;
DOCKNODE_DOCKSTACK_AUTH_PRIORITY: string;
PORT?: string;
NODE_ENV: "development" | "production" | "test";
}
}
21 changes: 21 additions & 0 deletions apps/docknode/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
{
"name": "docknode",
"version": "1.0.50",
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1",
"install": "bunx turbo install",
"dev": "bun run --watch src/index.ts",
"build": "bun run src/build.ts"
},
"dependencies": {
"@dockstat/logger": "workspace:*",
"@elysiajs/openapi": "^1.4.0",
"@tqman/nice-logger": "^1.1.1",
"elysia": "1.4.12",
"elysia-basic-auth": "^1.0.7"
},
"devDependencies": {
"bun-types": "latest"
},
"module": "src/index.js"
}
14 changes: 14 additions & 0 deletions apps/docknode/src/builder.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
import { build } from "bun";

await build({
sourcemap: "linked",
compile: false,
entrypoints: ["./index.ts"],
minify: {
identifiers: false,
syntax: true,
whitespace: true,
keepNames: false,
},
outdir: "./dist",
});
10 changes: 10 additions & 0 deletions apps/docknode/src/handlers/auth/auth.model.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
import Elysia, { t } from "elysia";

const AuthObject = t.Object({
handler: t.String(),
key: t.String(),
});

export const authModel = new Elysia().model({ auth: AuthObject });

export type AuthObjectType = typeof AuthObject.static;
Empty file.
65 changes: 65 additions & 0 deletions apps/docknode/src/handlers/dockstack/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,65 @@
import { rm } from "node:fs/promises";
import Logger from "@dockstat/logger";
import openapi from "@elysiajs/openapi";
import Elysia, { t } from "elysia";
import { getStackDir, writeDockerCompose } from "./src/deployStack";

export const dockStackLogger = new Logger("DockStack", ["DockNode"]);

export const DockStackHandler = new Elysia({ prefix: "/dockstack" })
.use(
openapi({
path: "/docs",
provider: "scalar",
})
)
.post(
"/deploy",
async ({ body }) => {
try {
await writeDockerCompose(body.id, body.name, body.vars, body.data);
return new Response(
JSON.stringify({
status: "200",
message: `Succesfully deployed ${body.name}`,
})
);
} catch (error) {
return new Response(
JSON.stringify({
status: "400",
message: "An error occured while writing the Docker Compose file!",
error: `${error}`,
})
);
}
},
{
body: t.Object({
id: t.Number(),
name: t.String(),
data: t.String(),
vars: t.Record(t.String(), t.String()),
}),
}
)
.delete(
"/delete",
async ({ body }) => {
try {
await rm(getStackDir(body.id, body.name), { recursive: true });
} catch (error) {
if ((error as { code: string }).code === "ENOENT") {
console.log("Directory doesn't exist");
} else {
throw error;
}
}
},
{
body: t.Object({
id: t.Number(),
name: t.String(),
}),
}
);
41 changes: 41 additions & 0 deletions apps/docknode/src/handlers/dockstack/src/deployStack.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
import { dockStackLogger } from "..";

export const STACK_DIR = "./stacks" as const;

export async function writeDockerCompose(
stackId: number,
stackName: string,
vars: Record<string, string>,
compose: string
) {
try {
dockStackLogger.info(`Writing Docker Compose of ${stackName}`);
const stackDir = getStackDir(stackId, stackName);

const YamlDump = Bun.YAML.parse(parseVars(vars, compose)) as string;

return await Bun.write(`${stackDir}/docker-compose.yaml`, YamlDump);
} catch (error) {
throw new Error(`Could not write Docker Compose file ${error}`);
}
}

function parseVars(deployConfig: Record<string, string>, data: string) {
data.replace(/{{(.*?)}}/g, (_, key) => deployConfig[key.trim()] ?? "");

const matches = data.search(/{{(.*?)}}/g);

if (matches <= 0) {
throw new Error(
"Not all variables were provided values in the deploy config"
);
}

return data;
}

export function getStackDir(stackId: number, stackName: string) {
const pId = Number(stackId);
const pSN = String(stackName).replaceAll("../", "").replaceAll("..\\", "");
return `./stacks/stackId${pId}-stackName${pSN}`;
}
50 changes: 50 additions & 0 deletions apps/docknode/src/handlers/dockstack/src/types.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
export interface BaseResponse {
success: boolean;
message: string;
timestamp: string;
}

export interface SuccessResponse<T = undefined> extends BaseResponse {
success: true;
data?: T;
}

export interface ErrorResponse extends BaseResponse {
success: false;
error: {
code: string;
details?: string;
};
}

export const ErrorCodes = {
// Authentication errors
UNAUTHORIZED: "UNAUTHORIZED",
INVALID_TOKEN: "INVALID_TOKEN",
MISSING_CREDENTIALS: "MISSING_CREDENTIALS",
INVALID_CREDENTIALS: "INVALID_CREDENTIALS",

// Validation errors
VALIDATION_ERROR: "VALIDATION_ERROR",

// Server errors
INTERNAL_SERVER_ERROR: "INTERNAL_SERVER_ERROR",
SERVICE_UNAVAILABLE: "SERVICE_UNAVAILABLE",

// Client errors
BAD_REQUEST: "BAD_REQUEST",
NOT_FOUND: "NOT_FOUND",
FORBIDDEN: "FORBIDDEN",
} as const;

// HTTP Status Codes
export const HttpStatus = {
OK: 200,
CREATED: 201,
BAD_REQUEST: 400,
UNAUTHORIZED: 401,
FORBIDDEN: 403,
NOT_FOUND: 404,
INTERNAL_SERVER_ERROR: 500,
SERVICE_UNAVAILABLE: 503,
} as const;
3 changes: 3 additions & 0 deletions apps/docknode/src/handlers/dockstack/src/utils/constants.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
// src/constants.ts
export const INSTANCE_UUID_PATH = "./.dockstacks_instance_uuid.txt";
export const INSTANCE_UUID_BUN_FILE = Bun.file(INSTANCE_UUID_PATH);
Loading
Loading