mirror of
https://github.com/ether/etherpad-lite.git
synced 2025-02-01 03:12:42 +01:00
Fixed settings.
This commit is contained in:
parent
419ee5b371
commit
ff5a0688f3
9 changed files with 22 additions and 20 deletions
|
@ -17,7 +17,7 @@ const padMessageHandler = require('../handler/PadMessageHandler');
|
|||
const groupManager = require('./GroupManager');
|
||||
const CustomError = require('../utils/customError');
|
||||
const readOnlyManager = require('./ReadOnlyManager');
|
||||
const randomString = require('../utils/randomstring');
|
||||
import randomString from '../utils/randomstring';
|
||||
const hooks = require('../../static/js/pluginfw/hooks');
|
||||
const {padutils: {warnDeprecated}} = require('../../static/js/pad_utils');
|
||||
const promises = require('../utils/promises');
|
||||
|
|
|
@ -21,7 +21,7 @@
|
|||
|
||||
|
||||
const db = require('./DB');
|
||||
const randomString = require('../utils/randomstring');
|
||||
import randomString from '../utils/randomstring';
|
||||
|
||||
|
||||
/**
|
||||
|
|
|
@ -22,7 +22,7 @@
|
|||
|
||||
const CustomError = require('../utils/customError');
|
||||
const promises = require('../utils/promises');
|
||||
const randomString = require('../utils/randomstring');
|
||||
import randomString from '../utils/randomstring';
|
||||
const db = require('./DB');
|
||||
const groupManager = require('./GroupManager');
|
||||
const authorManager = require('./AuthorManager');
|
||||
|
|
|
@ -23,14 +23,14 @@ const log4js = require('log4js');
|
|||
const os = require('os');
|
||||
const path = require('path');
|
||||
const runCmd = require('./run_cmd');
|
||||
import {soffice} from './Settings';
|
||||
import {settings} from './Settings';
|
||||
|
||||
const logger = log4js.getLogger('LibreOffice');
|
||||
|
||||
const doConvertTask = async (task) => {
|
||||
const tmpDir = os.tmpdir();
|
||||
const p = runCmd([
|
||||
soffice,
|
||||
settings.soffice,
|
||||
'--headless',
|
||||
'--invisible',
|
||||
'--nologo',
|
||||
|
|
|
@ -5,11 +5,11 @@ import {ChildProcess} from "node:child_process";
|
|||
import {PromiseWithStd} from "../types/PromiseWithStd";
|
||||
import {Readable} from "node:stream";
|
||||
|
||||
import {root, settings} from "./Settings";
|
||||
import {root} from "./Settings";
|
||||
|
||||
const spawn = require('cross-spawn');
|
||||
const log4js = require('log4js');
|
||||
const path = require('path');
|
||||
import spawn from 'cross-spawn';
|
||||
import log4js from 'log4js';
|
||||
import path from 'path';
|
||||
const logger = log4js.getLogger('runCmd');
|
||||
|
||||
const logLines = (readable: undefined | Readable | null, logLineFn: (arg0: (string | undefined)) => void) => {
|
||||
|
@ -74,7 +74,7 @@ const logLines = (readable: undefined | Readable | null, logLineFn: (arg0: (stri
|
|||
* - `stderr`: Similar to `stdout` but for stderr.
|
||||
* - `child`: The ChildProcess object.
|
||||
*/
|
||||
module.exports = exports = (args: string[], opts:RunCMDOptions = {}) => {
|
||||
module.exports = exports = (args: string[], opts:any = {}) => {
|
||||
logger.debug(`Executing command: ${args.join(' ')}`);
|
||||
|
||||
opts = {cwd: root, ...opts};
|
||||
|
|
|
@ -80,6 +80,7 @@
|
|||
},
|
||||
"devDependencies": {
|
||||
"@types/async": "^3.2.24",
|
||||
"@types/cross-spawn": "^6.0.6",
|
||||
"@types/express": "^4.17.21",
|
||||
"@types/formidable": "^3.4.5",
|
||||
"@types/jsonminify": "^0.4.3",
|
||||
|
|
|
@ -9,7 +9,7 @@ const tsort = require('./tsort');
|
|||
const pluginUtils = require('./shared');
|
||||
const defs = require('./plugin_defs');
|
||||
const {manager} = require('./installer');
|
||||
const settings = require("../../../node/utils/Settings");
|
||||
import {getEpVersion, root, settings} from "../../../node/utils/Settings";
|
||||
|
||||
const logger = log4js.getLogger('plugins');
|
||||
|
||||
|
@ -121,10 +121,10 @@ exports.getPackages = async () => {
|
|||
|
||||
newDependencies['ep_etherpad-lite'] = {
|
||||
name: 'ep_etherpad-lite',
|
||||
version: settings.getEpVersion(),
|
||||
path: path.join(settings.root, 'node_modules/ep_etherpad-lite'),
|
||||
realPath: path.join(settings.root, 'src'),
|
||||
}
|
||||
version: getEpVersion(),
|
||||
path: path.join(root, 'node_modules/ep_etherpad-lite'),
|
||||
realPath: path.join(root, 'src'),
|
||||
};
|
||||
|
||||
return newDependencies;
|
||||
};
|
||||
|
|
|
@ -190,6 +190,7 @@ describe(__filename, function () {
|
|||
before(async function () {
|
||||
if ((!settings.abiword || settings.abiword.indexOf('/') === -1) &&
|
||||
(!settings.soffice || settings.soffice.indexOf('/') === -1)) {
|
||||
console.log('Skipping AbiWord/LibreOffice tests because abiword or soffice is not set.');
|
||||
this.skip();
|
||||
}
|
||||
});
|
||||
|
|
|
@ -5,7 +5,7 @@ const common = require('../common');
|
|||
const fs = require('fs');
|
||||
const fsp = fs.promises;
|
||||
const path = require('path');
|
||||
import {settings} from '../../../node/utils/Settings'
|
||||
import {root, settings} from '../../../node/utils/Settings'
|
||||
const superagent = require('superagent');
|
||||
|
||||
describe(__filename, function () {
|
||||
|
@ -19,13 +19,13 @@ describe(__filename, function () {
|
|||
before(async function () {
|
||||
agent = await common.init();
|
||||
wantCustomIcon = await fsp.readFile(path.join(__dirname, 'favicon-test-custom.png'));
|
||||
wantDefaultIcon = await fsp.readFile(path.join(settings.root, 'src', 'static', 'favicon.ico'));
|
||||
wantDefaultIcon = await fsp.readFile(path.join(root, 'src', 'static', 'favicon.ico'));
|
||||
wantSkinIcon = await fsp.readFile(path.join(__dirname, 'favicon-test-skin.png'));
|
||||
});
|
||||
|
||||
beforeEach(async function () {
|
||||
backupSettings = {...settings};
|
||||
skinDir = await fsp.mkdtemp(path.join(settings.root, 'src', 'static', 'skins', 'test-'));
|
||||
skinDir = await fsp.mkdtemp(path.join(root, 'src', 'static', 'skins', 'test-'));
|
||||
settings.skinName = path.basename(skinDir);
|
||||
});
|
||||
|
||||
|
@ -43,7 +43,7 @@ describe(__filename, function () {
|
|||
|
||||
it('uses custom favicon if set (relative pathname)', async function () {
|
||||
settings.favicon =
|
||||
path.relative(settings.root, path.join(__dirname, 'favicon-test-custom.png'));
|
||||
path.relative(root, path.join(__dirname, 'favicon-test-custom.png'));
|
||||
assert(!path.isAbsolute(settings.favicon));
|
||||
const {body: gotIcon} = await agent.get('/favicon.ico')
|
||||
.accept('png').buffer(true).parse(superagent.parse.image)
|
||||
|
@ -69,7 +69,7 @@ describe(__filename, function () {
|
|||
it('falls back if custom favicon is missing', async function () {
|
||||
// The previous default for settings.favicon was 'favicon.ico', so many users will continue to
|
||||
// have that in their settings.json for a long time. There is unlikely to be a favicon at
|
||||
// path.resolve(settings.root, 'favicon.ico'), so this test ensures that 'favicon.ico' won't be
|
||||
// path.resolve(root, 'favicon.ico'), so this test ensures that 'favicon.ico' won't be
|
||||
// a problem for those users.
|
||||
settings.favicon = 'favicon.ico';
|
||||
const {body: gotIcon} = await agent.get('/favicon.ico')
|
||||
|
|
Loading…
Reference in a new issue