mirror of
https://github.com/ether/etherpad-lite.git
synced 2025-04-21 07:56:16 -04:00
lint: Fix some straightforward ESLint errors
This commit is contained in:
parent
ac086c7925
commit
ff19181cd1
10 changed files with 154 additions and 153 deletions
|
@ -1,3 +1,5 @@
|
|||
'use strict';
|
||||
|
||||
const _ = require('underscore');
|
||||
const cookieParser = require('cookie-parser');
|
||||
const express = require('express');
|
||||
|
@ -5,9 +7,7 @@ const expressSession = require('express-session');
|
|||
const fs = require('fs');
|
||||
const hooks = require('../../static/js/pluginfw/hooks');
|
||||
const log4js = require('log4js');
|
||||
const npm = require('npm/lib/npm');
|
||||
const path = require('path');
|
||||
const sessionStore = require('../db/SessionStore');
|
||||
const SessionStore = require('../db/SessionStore');
|
||||
const settings = require('../utils/Settings');
|
||||
const stats = require('../stats');
|
||||
const util = require('util');
|
||||
|
@ -36,13 +36,16 @@ exports.createServer = async () => {
|
|||
if (!_.isEmpty(settings.users)) {
|
||||
console.log(`The plugin admin page is at http://${settings.ip}:${settings.port}/admin/plugins`);
|
||||
} else {
|
||||
console.warn("Admin username and password not set in settings.json. To access admin please uncomment and edit 'users' in settings.json");
|
||||
console.warn('Admin username and password not set in settings.json. ' +
|
||||
'To access admin please uncomment and edit "users" in settings.json');
|
||||
}
|
||||
|
||||
const env = process.env.NODE_ENV || 'development';
|
||||
|
||||
if (env !== 'production') {
|
||||
console.warn('Etherpad is running in Development mode. This mode is slower for users and less secure than production mode. You should set the NODE_ENV environment variable to production by using: export NODE_ENV=production');
|
||||
console.warn('Etherpad is running in Development mode. This mode is slower for users and ' +
|
||||
'less secure than production mode. You should set the NODE_ENV environment ' +
|
||||
'variable to production by using: export NODE_ENV=production');
|
||||
}
|
||||
};
|
||||
|
||||
|
@ -138,7 +141,7 @@ exports.restartServer = async () => {
|
|||
|
||||
exports.sessionMiddleware = expressSession({
|
||||
secret: settings.sessionKey,
|
||||
store: new sessionStore(),
|
||||
store: new SessionStore(),
|
||||
resave: false,
|
||||
saveUninitialized: true,
|
||||
// Set the cookie name to a javascript identifier compatible string. Makes code handling it
|
||||
|
|
|
@ -1,9 +1,11 @@
|
|||
const eejs = require('ep_etherpad-lite/node/eejs');
|
||||
const settings = require('ep_etherpad-lite/node/utils/Settings');
|
||||
const hooks = require('ep_etherpad-lite/static/js/pluginfw/hooks');
|
||||
const fs = require('fs');
|
||||
'use strict';
|
||||
|
||||
exports.expressCreateServer = function (hook_name, args, cb) {
|
||||
const eejs = require('../../eejs');
|
||||
const fs = require('fs');
|
||||
const hooks = require('../../../static/js/pluginfw/hooks');
|
||||
const settings = require('../../utils/Settings');
|
||||
|
||||
exports.expressCreateServer = (hookName, args, cb) => {
|
||||
args.app.get('/admin/settings', (req, res) => {
|
||||
res.send(eejs.require('ep_etherpad-lite/templates/admin/settings.html', {
|
||||
req,
|
||||
|
@ -14,10 +16,11 @@ exports.expressCreateServer = function (hook_name, args, cb) {
|
|||
return cb();
|
||||
};
|
||||
|
||||
exports.socketio = function (hook_name, args, cb) {
|
||||
exports.socketio = (hookName, args, cb) => {
|
||||
const io = args.io.of('/settings');
|
||||
io.on('connection', (socket) => {
|
||||
if (!socket.conn.request.session || !socket.conn.request.session.user || !socket.conn.request.session.user.is_admin) return;
|
||||
const {session: {user: {is_admin: isAdmin} = {}} = {}} = socket.conn.request;
|
||||
if (!isAdmin) return;
|
||||
|
||||
socket.on('load', (query) => {
|
||||
fs.readFile('settings.json', 'utf8', (err, data) => {
|
||||
|
|
|
@ -1,13 +1,15 @@
|
|||
'use strict';
|
||||
|
||||
const express = require('../express');
|
||||
const proxyaddr = require('proxy-addr');
|
||||
const settings = require('../../utils/Settings');
|
||||
const socketio = require('socket.io');
|
||||
const socketIORouter = require('../../handler/SocketIORouter');
|
||||
const hooks = require('ep_etherpad-lite/static/js/pluginfw/hooks');
|
||||
const hooks = require('../../../static/js/pluginfw/hooks');
|
||||
|
||||
const padMessageHandler = require('../../handler/PadMessageHandler');
|
||||
|
||||
exports.expressCreateServer = function (hook_name, args, cb) {
|
||||
exports.expressCreateServer = (hookName, args, cb) => {
|
||||
// init socket.io and redirect all requests to the MessageHandler
|
||||
// there shouldn't be a browser that isn't compatible to all
|
||||
// transports in this list at once
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue