mirror of
https://github.com/ether/etherpad-lite.git
synced 2026-07-18 09:04:54 +00:00
chore: migrated settings to esm6 (#7062)
* chore: migrated settings to esm6 * chore: fixed frontends * chore: fixed missing usage of specialpages * chore: fixed last errors for settings * chore: fixed favicon test
This commit is contained in:
parent
920308a627
commit
8588d99f12
57 changed files with 698 additions and 562 deletions
|
|
@ -23,7 +23,7 @@ import {MapArrayType} from "../types/MapType";
|
|||
import { jwtDecode } from "jwt-decode";
|
||||
const api = require('../db/API');
|
||||
const padManager = require('../db/PadManager');
|
||||
const settings = require('../utils/Settings');
|
||||
import settings from '../utils/Settings';
|
||||
import createHTTPError from 'http-errors';
|
||||
import {Http2ServerRequest} from "node:http2";
|
||||
import {publicKeyExported} from "../security/OAuth2Provider";
|
||||
|
|
@ -183,7 +183,7 @@ exports.handle = async function (apiVersion: string, functionName: string, field
|
|||
throw new createHTTPError.Unauthorized('no or wrong API Key');
|
||||
}
|
||||
try {
|
||||
const clientIds: string[] = settings.sso.clients?.map((client: {client_id: string}) => client.client_id);
|
||||
const clientIds: string[] = settings.sso.clients?.map((client: {client_id: string}) => client.client_id) ?? [];
|
||||
const jwtToCheck = req.headers.authorization.replace("Bearer ", "")
|
||||
const payload = jwtDecode(jwtToCheck)
|
||||
// client_credentials
|
||||
|
|
|
|||
|
|
@ -1,9 +1,9 @@
|
|||
const absolutePaths = require('../utils/AbsolutePaths');
|
||||
import * as absolutePaths from '../utils/AbsolutePaths';
|
||||
import fs from 'fs';
|
||||
import log4js from 'log4js';
|
||||
import randomString from '../utils/randomstring';
|
||||
const argv = require('../utils/Cli').argv;
|
||||
const settings = require('../utils/Settings');
|
||||
import {argv} from '../utils/Cli'
|
||||
import settings from '../utils/Settings';
|
||||
|
||||
const apiHandlerLogger = log4js.getLogger('APIHandler');
|
||||
|
||||
|
|
|
|||
|
|
@ -24,7 +24,7 @@ const exporthtml = require('../utils/ExportHtml');
|
|||
const exporttxt = require('../utils/ExportTxt');
|
||||
const exportEtherpad = require('../utils/ExportEtherpad');
|
||||
import fs from 'fs';
|
||||
const settings = require('../utils/Settings');
|
||||
import settings from '../utils/Settings';
|
||||
import os from 'os';
|
||||
const hooks = require('../../static/js/pluginfw/hooks');
|
||||
import util from 'util';
|
||||
|
|
|
|||
|
|
@ -25,7 +25,7 @@ const padManager = require('../db/PadManager');
|
|||
const padMessageHandler = require('./PadMessageHandler');
|
||||
import {promises as fs} from 'fs';
|
||||
import path from 'path';
|
||||
const settings = require('../utils/Settings');
|
||||
import settings from '../utils/Settings';
|
||||
const {Formidable} = require('formidable');
|
||||
import os from 'os';
|
||||
const importHtml = require('../utils/ImportHtml');
|
||||
|
|
|
|||
|
|
@ -30,7 +30,11 @@ const AttributeManager = require('../../static/js/AttributeManager');
|
|||
const authorManager = require('../db/AuthorManager');
|
||||
import padutils from '../../static/js/pad_utils';
|
||||
import readOnlyManager from '../db/ReadOnlyManager';
|
||||
const settings = require('../utils/Settings');
|
||||
import settings, {
|
||||
exportAvailable,
|
||||
abiwordAvailable,
|
||||
sofficeAvailable
|
||||
} from '../utils/Settings';
|
||||
const securityManager = require('../db/SecurityManager');
|
||||
const plugins = require('../../static/js/pluginfw/plugin_defs');
|
||||
import log4js from 'log4js';
|
||||
|
|
@ -1021,9 +1025,9 @@ const handleClientReady = async (socket:any, message: ClientReadyMessage) => {
|
|||
serverTimestamp: Date.now(),
|
||||
sessionRefreshInterval: settings.cookie.sessionRefreshInterval,
|
||||
userId: sessionInfo.author,
|
||||
abiwordAvailable: settings.abiwordAvailable(),
|
||||
sofficeAvailable: settings.sofficeAvailable(),
|
||||
exportAvailable: settings.exportAvailable(),
|
||||
abiwordAvailable: abiwordAvailable(),
|
||||
sofficeAvailable: sofficeAvailable(),
|
||||
exportAvailable: exportAvailable(),
|
||||
plugins: {
|
||||
plugins: plugins.plugins,
|
||||
parts: plugins.parts,
|
||||
|
|
|
|||
|
|
@ -8,7 +8,7 @@ const apiHandler = require('./APIHandler')
|
|||
import {serve, setup} from 'swagger-ui-express'
|
||||
import express from "express";
|
||||
|
||||
const settings = require('../utils/Settings')
|
||||
import settings from '../utils/Settings';
|
||||
|
||||
|
||||
type RestAPIMapping = {
|
||||
|
|
|
|||
|
|
@ -22,8 +22,8 @@
|
|||
|
||||
import {MapArrayType} from "../types/MapType";
|
||||
import {SocketModule} from "../types/SocketModule";
|
||||
const log4js = require('log4js');
|
||||
const settings = require('../utils/Settings');
|
||||
import log4js from 'log4js';
|
||||
import settings from '../utils/Settings';
|
||||
const stats = require('../../node/stats')
|
||||
|
||||
const logger = log4js.getLogger('socket.io');
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue