Skip to content

Commit b6f1898

Browse files
committed
Merge branch 'develop'
2 parents 8174ebc + 2ecb78b commit b6f1898

File tree

10 files changed

+69
-55
lines changed

10 files changed

+69
-55
lines changed

.github/workflows/codeql-analysis.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -35,10 +35,10 @@ jobs:
3535
if: ${{ github.event_name == 'pull_request' }}
3636
-
3737
name: Initialize CodeQL
38-
uses: github/codeql-action/init@v2
38+
uses: github/codeql-action/init@v3
3939
-
4040
name: Autobuild
41-
uses: github/codeql-action/autobuild@v2
41+
uses: github/codeql-action/autobuild@v3
4242
-
4343
name: Perform CodeQL Analysis
44-
uses: github/codeql-action/analyze@v2
44+
uses: github/codeql-action/analyze@v3

.github/workflows/windows.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ jobs:
4747
run: src/bin/buildForWindows.sh
4848
-
4949
name: Archive production artifacts
50-
uses: actions/upload-artifact@v3
50+
uses: actions/upload-artifact@v4
5151
with:
5252
name: etherpad-win.zip
5353
path: etherpad-win.zip
@@ -65,7 +65,7 @@ jobs:
6565
uses: actions/checkout@v4
6666
-
6767
name: Download .zip
68-
uses: actions/download-artifact@v3
68+
uses: actions/download-artifact@v4
6969
with:
7070
name: etherpad-win.zip
7171
path: ..
@@ -80,7 +80,7 @@ jobs:
8080
script-file: 'src/bin/nsis/etherpad.nsi'
8181
-
8282
name: Archive production artifacts
83-
uses: actions/upload-artifact@v3
83+
uses: actions/upload-artifact@v4
8484
with:
8585
name: etherpad-win.exe
8686
path: etherpad-win.exe
@@ -99,7 +99,7 @@ jobs:
9999
steps:
100100
-
101101
name: Download zip
102-
uses: actions/download-artifact@v3
102+
uses: actions/download-artifact@v4
103103
with:
104104
name: etherpad-win.zip
105105
-

CHANGELOG.md

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,12 @@
1+
# 1.9.6
2+
3+
### Notable enhancements and fixes
4+
5+
* Prevent etherpad crash when update server is not reachable
6+
* Use npm@6 in Docker build
7+
* Fix setting the log level in settings.json
8+
9+
110
# 1.9.5
211

312
### Compability changes

README.md

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -52,9 +52,8 @@ We're looking for maintainers and have some funding available. Please contact J
5252

5353
#### Quick install on Debian/Ubuntu
5454

55+
Install the latest Node.js LTS per [official install instructions](https://github.com/nodesource/distributions#installation-instructions), then:
5556
```sh
56-
curl -sL https://deb.nodesource.com/setup_14.x | sudo -E bash -
57-
sudo apt install -y nodejs
5857
git clone --branch master https://github.com/ether/etherpad-lite.git &&
5958
cd etherpad-lite &&
6059
src/bin/run.sh

src/bin/doc/package-lock.json

Lines changed: 3 additions & 3 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/bin/doc/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
"node": ">=12.17.0"
88
},
99
"dependencies": {
10-
"marked": "^11.0.1"
10+
"marked": "^11.1.0"
1111
},
1212
"devDependencies": {},
1313
"optionalDependencies": {},

src/node/utils/Settings.js

Lines changed: 21 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -50,15 +50,14 @@ const nonSettings = [
5050

5151
// This is a function to make it easy to create a new instance. It is important to not reuse a
5252
// config object after passing it to log4js.configure() because that method mutates the object. :(
53-
const defaultLogConfig = () => ({appenders: {console: {type: 'console'}},
53+
const defaultLogConfig = (level) => ({appenders: {console: {type: 'console'}},
5454
categories: {
55-
default: {appenders: ['console'], level: 'info'},
55+
default: {appenders: ['console'], level},
5656
}});
5757
const defaultLogLevel = 'INFO';
5858

5959
const initLogging = (logLevel, config) => {
6060
// log4js.configure() modifies exports.logconfig so check for equality first.
61-
const logConfigIsDefault = deepEqual(config, defaultLogConfig());
6261
log4js.configure(config);
6362
log4js.getLogger('console');
6463

@@ -67,19 +66,16 @@ const initLogging = (logLevel, config) => {
6766
console.log = logger.info.bind(logger);
6867
console.warn = logger.warn.bind(logger);
6968
console.error = logger.error.bind(logger);
70-
71-
// Log the warning after configuring log4js to increase the chances the user will see it.
72-
if (!logConfigIsDefault) logger.warn('The logconfig setting is deprecated.');
7369
};
7470

7571
// Initialize logging as early as possible with reasonable defaults. Logging will be re-initialized
7672
// with the user's chosen log level and logger config after the settings have been loaded.
77-
initLogging(defaultLogLevel, defaultLogConfig());
73+
initLogging(defaultLogLevel, defaultLogConfig(defaultLogLevel));
7874

7975
/* Root path of the installation */
8076
exports.root = absolutePaths.findEtherpadRoot();
8177
logger.info('All relative paths will be interpreted relative to the identified ' +
82-
`Etherpad base dir: ${exports.root}`);
78+
`Etherpad base dir: ${exports.root}`);
8379
exports.settingsFilename = absolutePaths.makeAbsolute(argv.settings || 'settings.json');
8480
exports.credentialsFilename = absolutePaths.makeAbsolute(argv.credentials || 'credentials.json');
8581

@@ -160,7 +156,7 @@ exports.defaultPadText = [
160156
'Welcome to Etherpad!',
161157
'',
162158
'This pad text is synchronized as you type, so that everyone viewing this page sees the same ' +
163-
'text. This allows you to collaborate seamlessly on documents!',
159+
'text. This allows you to collaborate seamlessly on documents!',
164160
'',
165161
'Etherpad on Github: https://github.com/ether/etherpad-lite',
166162
].join('\n');
@@ -298,7 +294,7 @@ exports.indentationOnNewLine = true;
298294
/*
299295
* log4js appender configuration
300296
*/
301-
exports.logconfig = defaultLogConfig();
297+
exports.logconfig = null;
302298

303299
/*
304300
* Deprecated cookie signing key.
@@ -646,9 +642,9 @@ const lookupEnvironmentVariables = (obj) => {
646642

647643
if ((envVarValue === undefined) && (defaultValue === undefined)) {
648644
logger.warn(`Environment variable "${envVarName}" does not contain any value for ` +
649-
`configuration key "${key}", and no default was given. Using null. ` +
650-
'THIS BEHAVIOR MAY CHANGE IN A FUTURE VERSION OF ETHERPAD; you should ' +
651-
'explicitly use "null" as the default if you want to continue to use null.');
645+
`configuration key "${key}", and no default was given. Using null. ` +
646+
'THIS BEHAVIOR MAY CHANGE IN A FUTURE VERSION OF ETHERPAD; you should ' +
647+
'explicitly use "null" as the default if you want to continue to use null.');
652648

653649
/*
654650
* We have to return null, because if we just returned undefined, the
@@ -659,7 +655,7 @@ const lookupEnvironmentVariables = (obj) => {
659655

660656
if ((envVarValue === undefined) && (defaultValue !== undefined)) {
661657
logger.debug(`Environment variable "${envVarName}" not found for ` +
662-
`configuration key "${key}". Falling back to default value.`);
658+
`configuration key "${key}". Falling back to default value.`);
663659

664660
return coerceValue(defaultValue);
665661
}
@@ -726,7 +722,7 @@ const parseSettings = (settingsFilename, isSettings) => {
726722
return replacedSettings;
727723
} catch (e) {
728724
logger.error(`There was an error processing your ${settingsType} ` +
729-
`file from ${settingsFilename}: ${e.message}`);
725+
`file from ${settingsFilename}: ${e.message}`);
730726

731727
process.exit(1);
732728
}
@@ -738,11 +734,13 @@ exports.reloadSettings = () => {
738734
storeSettings(settings);
739735
storeSettings(credentials);
740736

737+
// Init logging config
738+
exports.logconfig = defaultLogConfig(exports.loglevel ? exports.loglevel : defaultLogLevel);
741739
initLogging(exports.loglevel, exports.logconfig);
742740

743741
if (!exports.skinName) {
744742
logger.warn('No "skinName" parameter found. Please check out settings.json.template and ' +
745-
'update your settings.json. Falling back to the default "colibris".');
743+
'update your settings.json. Falling back to the default "colibris".');
746744
exports.skinName = 'colibris';
747745
}
748746

@@ -753,7 +751,7 @@ exports.reloadSettings = () => {
753751

754752
if (countPieces !== 1) {
755753
logger.error(`skinName must be the name of a directory under "${skinBasePath}". This is ` +
756-
`not valid: "${exports.skinName}". Falling back to the default "colibris".`);
754+
`not valid: "${exports.skinName}". Falling back to the default "colibris".`);
757755

758756
exports.skinName = 'colibris';
759757
}
@@ -764,7 +762,7 @@ exports.reloadSettings = () => {
764762
// what if someone sets skinName == ".." or "."? We catch him!
765763
if (absolutePaths.isSubdir(skinBasePath, skinPath) === false) {
766764
logger.error(`Skin path ${skinPath} must be a subdirectory of ${skinBasePath}. ` +
767-
'Falling back to the default "colibris".');
765+
'Falling back to the default "colibris".');
768766

769767
exports.skinName = 'colibris';
770768
skinPath = path.join(skinBasePath, exports.skinName);
@@ -825,9 +823,9 @@ exports.reloadSettings = () => {
825823
}
826824
} else {
827825
logger.warn('Declaring the sessionKey in the settings.json is deprecated. ' +
828-
'This value is auto-generated now. Please remove the setting from the file. -- ' +
829-
'If you are seeing this error after restarting using the Admin User ' +
830-
'Interface then you can ignore this message.');
826+
'This value is auto-generated now. Please remove the setting from the file. -- ' +
827+
'If you are seeing this error after restarting using the Admin User ' +
828+
'Interface then you can ignore this message.');
831829
}
832830
if (exports.sessionKey) {
833831
logger.warn(`The sessionKey setting and ${sessionkeyFilename} file are deprecated; ` +
@@ -847,7 +845,7 @@ exports.reloadSettings = () => {
847845
if (exports.ip === '') {
848846
// using Unix socket for connectivity
849847
logger.warn('The settings file contains an empty string ("") for the "ip" parameter. The ' +
850-
'"port" parameter will be interpreted as the path to a Unix socket to bind at.');
848+
'"port" parameter will be interpreted as the path to a Unix socket to bind at.');
851849
}
852850

853851
/*
@@ -871,3 +869,4 @@ exports.exportedForTestingOnly = {
871869

872870
// initially load settings
873871
exports.reloadSettings();
872+

src/package-lock.json

Lines changed: 11 additions & 11 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/package.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@
5656
"npm": "^6.14.18",
5757
"openapi-backend": "^5.10.5",
5858
"proxy-addr": "^2.0.7",
59-
"rate-limiter-flexible": "^3.0.6",
59+
"rate-limiter-flexible": "^4.0.0",
6060
"rehype": "^13.0.1",
6161
"rehype-minify-whitespace": "^6.0.0",
6262
"resolve": "1.22.8",
@@ -78,7 +78,7 @@
7878
"etherpad-lite": "node/server.js"
7979
},
8080
"devDependencies": {
81-
"eslint": "^8.55.0",
81+
"eslint": "^8.56.0",
8282
"eslint-config-etherpad": "^3.0.22",
8383
"etherpad-cli-client": "^2.0.2",
8484
"mocha": "^10.0.0",
@@ -105,6 +105,6 @@
105105
"test": "mocha --timeout 120000 --recursive tests/backend/specs ../node_modules/ep_*/static/tests/backend/specs",
106106
"test-container": "mocha --timeout 5000 tests/container/specs/api"
107107
},
108-
"version": "1.9.5",
108+
"version": "1.9.6",
109109
"license": "Apache-2.0"
110110
}

src/static/js/pluginfw/installer.js

Lines changed: 13 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,10 @@ const onAllTasksFinished = async () => {
1515
await hooks.aCallAll('restartServer');
1616
};
1717

18+
const headers = {
19+
'User-Agent': 'Etherpad/' + settings.getEpVersion(),
20+
}
21+
1822
let tasks = 0;
1923

2024
const wrapTaskCb = (cb) => {
@@ -77,12 +81,15 @@ exports.getAvailablePlugins = (maxCacheAge) => {
7781
return resolve(exports.availablePlugins);
7882
}
7983

80-
await axios.get('https://static.etherpad.org/plugins.json')
81-
.then(pluginsLoaded => {
82-
exports.availablePlugins = pluginsLoaded.data;
83-
cacheTimestamp = nowTimestamp;
84-
resolve(exports.availablePlugins);
85-
})
84+
await axios.get('https://static.etherpad.org/plugins.json', {headers: headers})
85+
.then(pluginsLoaded => {
86+
exports.availablePlugins = pluginsLoaded.data;
87+
cacheTimestamp = nowTimestamp;
88+
resolve(exports.availablePlugins);
89+
})
90+
.catch(async err => {
91+
return reject(err);
92+
});
8693
})
8794
}
8895

0 commit comments

Comments
 (0)