move server into apps/ignis-server
This commit is contained in:
parent
a6807fe850
commit
8672fa11a3
65 changed files with 19 additions and 10 deletions
2
.gitignore
vendored
2
.gitignore
vendored
|
|
@ -4,5 +4,5 @@ investigation/
|
||||||
vaults/
|
vaults/
|
||||||
packages/*/dist/
|
packages/*/dist/
|
||||||
packages/bridge-plugin/main.js
|
packages/bridge-plugin/main.js
|
||||||
server/plugins/*/plugin/main.js
|
apps/ignis-server/server/plugins/*/plugin/main.js
|
||||||
demo-vaults/
|
demo-vaults/
|
||||||
|
|
|
||||||
|
|
@ -9,7 +9,8 @@
|
||||||
services:
|
services:
|
||||||
ignis-demo:
|
ignis-demo:
|
||||||
build:
|
build:
|
||||||
context: ../..
|
context: ../../../..
|
||||||
|
dockerfile: apps/ignis-server/Dockerfile
|
||||||
ports:
|
ports:
|
||||||
- "8080:8080"
|
- "8080:8080"
|
||||||
environment:
|
environment:
|
||||||
|
Before Width: | Height: | Size: 984 B After Width: | Height: | Size: 984 B |
|
Before Width: | Height: | Size: 15 KiB After Width: | Height: | Size: 15 KiB |
|
|
@ -6,7 +6,7 @@ const {
|
||||||
} = require("./plugin-system/obsidian-plugin");
|
} = require("./plugin-system/obsidian-plugin");
|
||||||
|
|
||||||
const BRIDGE_PLUGIN_ID = "ignis-bridge";
|
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
|
// .ignis metadata helpers
|
||||||
|
|
||||||
|
|
@ -1,12 +1,14 @@
|
||||||
const path = require("path");
|
const path = require("path");
|
||||||
const fs = require("fs");
|
const fs = require("fs");
|
||||||
|
|
||||||
|
const REPO_ROOT = path.join(__dirname, "..", "..", "..");
|
||||||
|
|
||||||
// VAULT_ROOT: a directory that contains vault folders.
|
// VAULT_ROOT: a directory that contains vault folders.
|
||||||
// Each subdirectory is a vault. New vaults are created as new subdirs.
|
// Each subdirectory is a vault. New vaults are created as new subdirs.
|
||||||
const vaultRoot =
|
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
|
// Ensure required directories exist
|
||||||
try {
|
try {
|
||||||
|
|
@ -91,7 +93,7 @@ module.exports = {
|
||||||
|
|
||||||
obsidianAssetsPath:
|
obsidianAssetsPath:
|
||||||
process.env.OBSIDIAN_ASSETS_PATH ||
|
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() {
|
get obsidianVersion() {
|
||||||
const assetsPath =
|
const assetsPath =
|
||||||
|
|
@ -12,6 +12,8 @@ writeCoalescer.configure({ writeCoalesceMs: config.writeCoalesceMs });
|
||||||
const { flushAll } = writeCoalescer;
|
const { flushAll } = writeCoalescer;
|
||||||
const { setupDemo, wireDemoWebSocket } = require("./demo");
|
const { setupDemo, wireDemoWebSocket } = require("./demo");
|
||||||
|
|
||||||
|
const REPO_ROOT = path.join(__dirname, "..", "..", "..");
|
||||||
|
|
||||||
const ANSI_RED = "\x1b[31m";
|
const ANSI_RED = "\x1b[31m";
|
||||||
const ANSI_YELLOW = "\x1b[33m";
|
const ANSI_YELLOW = "\x1b[33m";
|
||||||
const ANSI_GREEN = "\x1b[32m";
|
const ANSI_GREEN = "\x1b[32m";
|
||||||
|
|
@ -139,7 +141,7 @@ app.get(["/", "/index.html"], (req, res) => {
|
||||||
});
|
});
|
||||||
|
|
||||||
app.get("/favicon.png", (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
|
// Serve dist files with cache headers based on version param
|
||||||
|
|
@ -156,8 +158,8 @@ app.use((req, res, next) => {
|
||||||
next();
|
next();
|
||||||
});
|
});
|
||||||
|
|
||||||
app.use(express.static(path.join(__dirname, "..", "packages", "ui", "dist")));
|
app.use(express.static(path.join(REPO_ROOT, "packages", "ui", "dist")));
|
||||||
app.use(express.static(path.join(__dirname, "..", "packages", "shim", "dist")));
|
app.use(express.static(path.join(REPO_ROOT, "packages", "shim", "dist")));
|
||||||
|
|
||||||
app.use(express.static(config.obsidianAssetsPath));
|
app.use(express.static(config.obsidianAssetsPath));
|
||||||
|
|
||||||
4
build.js
4
build.js
|
|
@ -16,6 +16,8 @@ Promise.all([
|
||||||
entryPoints: [
|
entryPoints: [
|
||||||
path.join(
|
path.join(
|
||||||
__dirname,
|
__dirname,
|
||||||
|
"apps",
|
||||||
|
"ignis-server",
|
||||||
"server",
|
"server",
|
||||||
"plugins",
|
"plugins",
|
||||||
"headless-sync",
|
"headless-sync",
|
||||||
|
|
@ -27,6 +29,8 @@ Promise.all([
|
||||||
bundle: true,
|
bundle: true,
|
||||||
outfile: path.join(
|
outfile: path.join(
|
||||||
__dirname,
|
__dirname,
|
||||||
|
"apps",
|
||||||
|
"ignis-server",
|
||||||
"server",
|
"server",
|
||||||
"plugins",
|
"plugins",
|
||||||
"headless-sync",
|
"headless-sync",
|
||||||
|
|
|
||||||
|
|
@ -9,7 +9,7 @@
|
||||||
],
|
],
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"build": "node build.js",
|
"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",
|
"dev": "npm run build && npm run dev:server",
|
||||||
"test": "vitest run",
|
"test": "vitest run",
|
||||||
"test:watch": "vitest"
|
"test:watch": "vitest"
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue