fix(archive): The latest version of the matrix-js-sdk dependency requires a Node version of at least: 12.9. Node 12 introduced TLSv1.3 as default, which axios then uses. This is causing the archive command to break, so the particular command will continue forward with TLSv1.2 for now.

This commit is contained in:
vulet 2021-08-09 17:14:46 +08:00
parent 6273452876
commit 06e0ce26a9

View file

@ -1,5 +1,6 @@
const { JSDOM } = require('jsdom'); const { JSDOM } = require('jsdom');
const qs = require('qs'); const qs = require('qs');
const https = require('https');
const sleep = ms => new Promise(r => setTimeout(r, ms)); const sleep = ms => new Promise(r => setTimeout(r, ms));
@ -35,6 +36,7 @@ const arc3Str = str => `<em>Timed out <code>${str}</code></em>`;
const run = async (roomId, userInput, rearchive) => { const run = async (roomId, userInput, rearchive) => {
const instance = axios.create({ const instance = axios.create({
baseURL: `https://${config.archive.domain}`, baseURL: `https://${config.archive.domain}`,
httpsAgent: https.Agent({ maxVersion: "TLSv1.2"}),
headers: headers(config.archive), headers: headers(config.archive),
transformResponse: [], transformResponse: [],
timeout: 10 * 1000 timeout: 10 * 1000