move server into apps/ignis-server

This commit is contained in:
Nystik
2026-05-21 17:26:08 +02:00
parent a6807fe850
commit 8672fa11a3
65 changed files with 19 additions and 10 deletions

2
.gitignore vendored
View File

@@ -4,5 +4,5 @@ investigation/
vaults/
packages/*/dist/
packages/bridge-plugin/main.js
server/plugins/*/plugin/main.js
apps/ignis-server/server/plugins/*/plugin/main.js
demo-vaults/

View File

@@ -9,7 +9,8 @@
services:
ignis-demo:
build:
context: ../..
context: ../../../..
dockerfile: apps/ignis-server/Dockerfile
ports:
- "8080:8080"
environment:

View File

Before

Width:  |  Height:  |  Size: 984 B

After

Width:  |  Height:  |  Size: 984 B

View File

Before

Width:  |  Height:  |  Size: 15 KiB

After

Width:  |  Height:  |  Size: 15 KiB

View File

@@ -6,7 +6,7 @@ const {
} = require("./plugin-system/obsidian-plugin");
const BRIDGE_PLUGIN_ID = "ignis-bridge";
const BRIDGE_PLUGIN_DIR = path.join(__dirname, "..", "packages", "bridge-plugin");
const BRIDGE_PLUGIN_DIR = path.join(__dirname, "..", "..", "..", "packages", "bridge-plugin");
// .ignis metadata helpers

View File

@@ -1,12 +1,14 @@
const path = require("path");
const fs = require("fs");
const REPO_ROOT = path.join(__dirname, "..", "..", "..");
// VAULT_ROOT: a directory that contains vault folders.
// Each subdirectory is a vault. New vaults are created as new subdirs.
const vaultRoot =
process.env.VAULT_ROOT || path.join(__dirname, "..", "vaults");
process.env.VAULT_ROOT || path.join(REPO_ROOT, "vaults");
const dataRoot = process.env.DATA_ROOT || path.join(__dirname, "..", "data");
const dataRoot = process.env.DATA_ROOT || path.join(REPO_ROOT, "data");
// Ensure required directories exist
try {
@@ -91,7 +93,7 @@ module.exports = {
obsidianAssetsPath:
process.env.OBSIDIAN_ASSETS_PATH ||
path.join(__dirname, "..", "investigation", "obsidian_1.12.7_unpacked"),
path.join(REPO_ROOT, "investigation", "obsidian_1.12.7_unpacked"),
get obsidianVersion() {
const assetsPath =

View File

@@ -12,6 +12,8 @@ writeCoalescer.configure({ writeCoalesceMs: config.writeCoalesceMs });
const { flushAll } = writeCoalescer;
const { setupDemo, wireDemoWebSocket } = require("./demo");
const REPO_ROOT = path.join(__dirname, "..", "..", "..");
const ANSI_RED = "\x1b[31m";
const ANSI_YELLOW = "\x1b[33m";
const ANSI_GREEN = "\x1b[32m";
@@ -139,7 +141,7 @@ app.get(["/", "/index.html"], (req, res) => {
});
app.get("/favicon.png", (req, res) => {
res.sendFile(path.join(__dirname, "..", "images", "favicon.png"));
res.sendFile(path.join(REPO_ROOT, "images", "favicon.png"));
});
// Serve dist files with cache headers based on version param
@@ -156,8 +158,8 @@ app.use((req, res, next) => {
next();
});
app.use(express.static(path.join(__dirname, "..", "packages", "ui", "dist")));
app.use(express.static(path.join(__dirname, "..", "packages", "shim", "dist")));
app.use(express.static(path.join(REPO_ROOT, "packages", "ui", "dist")));
app.use(express.static(path.join(REPO_ROOT, "packages", "shim", "dist")));
app.use(express.static(config.obsidianAssetsPath));

View File

@@ -16,6 +16,8 @@ Promise.all([
entryPoints: [
path.join(
__dirname,
"apps",
"ignis-server",
"server",
"plugins",
"headless-sync",
@@ -27,6 +29,8 @@ Promise.all([
bundle: true,
outfile: path.join(
__dirname,
"apps",
"ignis-server",
"server",
"plugins",
"headless-sync",

View File

@@ -9,7 +9,7 @@
],
"scripts": {
"build": "node build.js",
"dev:server": "node server/index.js",
"dev:server": "node apps/ignis-server/server/index.js",
"dev": "npm run build && npm run dev:server",
"test": "vitest run",
"test:watch": "vitest"