mirror of
https://github.com/actualbudget/actual.git
synced 2026-04-30 10:14:53 -05:00
updating the way the server loads the actual web build path to account for different folder structure
This commit is contained in:
@@ -41,6 +41,7 @@
|
|||||||
"rebuild-node": "yarn workspace loot-core rebuild",
|
"rebuild-node": "yarn workspace loot-core rebuild",
|
||||||
"lint": "eslint . --max-warnings 0",
|
"lint": "eslint . --max-warnings 0",
|
||||||
"lint:verbose": "DEBUG=eslint:cli-engine eslint . --max-warnings 0",
|
"lint:verbose": "DEBUG=eslint:cli-engine eslint . --max-warnings 0",
|
||||||
|
"install:server": "yarn workspaces focus actual-sync --production",
|
||||||
"typecheck": "yarn tsc && tsc-strict",
|
"typecheck": "yarn tsc && tsc-strict",
|
||||||
"jq": "./node_modules/node-jq/bin/jq",
|
"jq": "./node_modules/node-jq/bin/jq",
|
||||||
"prepare": "husky"
|
"prepare": "husky"
|
||||||
|
|||||||
@@ -2,7 +2,9 @@ import fs from 'node:fs';
|
|||||||
import path from 'node:path';
|
import path from 'node:path';
|
||||||
import { fileURLToPath } from 'node:url';
|
import { fileURLToPath } from 'node:url';
|
||||||
import createDebug from 'debug';
|
import createDebug from 'debug';
|
||||||
|
import { createRequire } from 'module';
|
||||||
|
|
||||||
|
const require = createRequire(import.meta.url);
|
||||||
const debug = createDebug('actual:config');
|
const debug = createDebug('actual:config');
|
||||||
const debugSensitive = createDebug('actual-sensitive:config');
|
const debugSensitive = createDebug('actual-sensitive:config');
|
||||||
|
|
||||||
@@ -51,6 +53,14 @@ if (process.env.ACTUAL_CONFIG_PATH) {
|
|||||||
userConfig = parseJSON(configFile, true);
|
userConfig = parseJSON(configFile, true);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
const actualAppWebBuildPath = path.join(
|
||||||
|
// require.resolve is used to recursively search up the workspace to find the node_modules directory
|
||||||
|
path.dirname(require.resolve('@actual-app/web/package.json')),
|
||||||
|
'build',
|
||||||
|
);
|
||||||
|
|
||||||
|
debug(`Actual web build path: '${actualAppWebBuildPath}'`);
|
||||||
|
|
||||||
/** @type {Omit<import('./config-types.js').Config, 'mode' | 'dataDir' | 'serverFiles' | 'userFiles'>} */
|
/** @type {Omit<import('./config-types.js').Config, 'mode' | 'dataDir' | 'serverFiles' | 'userFiles'>} */
|
||||||
let defaultConfig = {
|
let defaultConfig = {
|
||||||
loginMethod: 'password',
|
loginMethod: 'password',
|
||||||
@@ -68,13 +78,7 @@ let defaultConfig = {
|
|||||||
trustedAuthProxies: null,
|
trustedAuthProxies: null,
|
||||||
port: 5006,
|
port: 5006,
|
||||||
hostname: '::',
|
hostname: '::',
|
||||||
webRoot: path.join(
|
webRoot: actualAppWebBuildPath,
|
||||||
projectRoot,
|
|
||||||
'node_modules',
|
|
||||||
'@actual-app',
|
|
||||||
'web',
|
|
||||||
'build',
|
|
||||||
),
|
|
||||||
upload: {
|
upload: {
|
||||||
fileSizeSyncLimitMB: 20,
|
fileSizeSyncLimitMB: 20,
|
||||||
syncEncryptedFileSizeLimitMB: 50,
|
syncEncryptedFileSizeLimitMB: 50,
|
||||||
|
|||||||
Reference in New Issue
Block a user