@lordbex/thelounge 4.4.4-blowfish → 4.5.0-blowfish-pre
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +2 -2
- package/dist/defaults/config.js +31 -2
- package/dist/package.json +93 -91
- package/dist/server/client.js +188 -194
- package/dist/server/clientManager.js +65 -63
- package/dist/server/command-line/index.js +44 -43
- package/dist/server/command-line/install.js +37 -70
- package/dist/server/command-line/outdated.js +12 -17
- package/dist/server/command-line/start.js +25 -26
- package/dist/server/command-line/storage.js +26 -31
- package/dist/server/command-line/uninstall.js +16 -23
- package/dist/server/command-line/upgrade.js +20 -26
- package/dist/server/command-line/users/add.js +33 -40
- package/dist/server/command-line/users/edit.js +18 -24
- package/dist/server/command-line/users/index.js +12 -16
- package/dist/server/command-line/users/list.js +11 -39
- package/dist/server/command-line/users/remove.js +16 -22
- package/dist/server/command-line/users/reset.js +34 -35
- package/dist/server/command-line/utils.js +231 -87
- package/dist/server/config.js +61 -52
- package/dist/server/helper.js +29 -28
- package/dist/server/identification.js +39 -34
- package/dist/server/index.js +1 -3
- package/dist/server/log.js +19 -16
- package/dist/server/models/chan.js +36 -33
- package/dist/server/models/msg.js +15 -19
- package/dist/server/models/network.js +88 -86
- package/dist/server/models/prefix.js +4 -7
- package/dist/server/models/user.js +5 -10
- package/dist/server/path-helper.js +8 -0
- package/dist/server/plugins/auth/ldap.js +177 -112
- package/dist/server/plugins/auth/local.js +10 -15
- package/dist/server/plugins/auth.js +6 -35
- package/dist/server/plugins/changelog.js +30 -27
- package/dist/server/plugins/clientCertificate.js +33 -37
- package/dist/server/plugins/dev-server.js +15 -21
- package/dist/server/plugins/inputs/action.js +9 -14
- package/dist/server/plugins/inputs/away.js +1 -3
- package/dist/server/plugins/inputs/ban.js +9 -14
- package/dist/server/plugins/inputs/blow.js +9 -14
- package/dist/server/plugins/inputs/connect.js +5 -10
- package/dist/server/plugins/inputs/ctcp.js +7 -12
- package/dist/server/plugins/inputs/disconnect.js +1 -3
- package/dist/server/plugins/inputs/ignore.js +23 -29
- package/dist/server/plugins/inputs/ignorelist.js +12 -18
- package/dist/server/plugins/inputs/index.js +8 -34
- package/dist/server/plugins/inputs/invite.js +7 -12
- package/dist/server/plugins/inputs/kick.js +7 -12
- package/dist/server/plugins/inputs/kill.js +1 -3
- package/dist/server/plugins/inputs/list.js +1 -3
- package/dist/server/plugins/inputs/mode.js +10 -15
- package/dist/server/plugins/inputs/msg.js +13 -18
- package/dist/server/plugins/inputs/mute.js +9 -15
- package/dist/server/plugins/inputs/nick.js +9 -14
- package/dist/server/plugins/inputs/notice.js +5 -7
- package/dist/server/plugins/inputs/part.js +11 -16
- package/dist/server/plugins/inputs/quit.js +7 -13
- package/dist/server/plugins/inputs/rainbow.js +55 -0
- package/dist/server/plugins/inputs/raw.js +1 -3
- package/dist/server/plugins/inputs/rejoin.js +7 -12
- package/dist/server/plugins/inputs/topic.js +7 -12
- package/dist/server/plugins/inputs/whois.js +1 -3
- package/dist/server/plugins/irc-events/away.js +14 -20
- package/dist/server/plugins/irc-events/cap.js +16 -22
- package/dist/server/plugins/irc-events/chghost.js +14 -13
- package/dist/server/plugins/irc-events/connection.js +61 -63
- package/dist/server/plugins/irc-events/ctcp.js +22 -28
- package/dist/server/plugins/irc-events/error.js +20 -26
- package/dist/server/plugins/irc-events/help.js +7 -13
- package/dist/server/plugins/irc-events/info.js +7 -13
- package/dist/server/plugins/irc-events/invite.js +7 -13
- package/dist/server/plugins/irc-events/join.js +30 -27
- package/dist/server/plugins/irc-events/kick.js +21 -17
- package/dist/server/plugins/irc-events/link.js +75 -96
- package/dist/server/plugins/irc-events/list.js +23 -26
- package/dist/server/plugins/irc-events/message.js +46 -52
- package/dist/server/plugins/irc-events/mode.js +66 -63
- package/dist/server/plugins/irc-events/modelist.js +29 -35
- package/dist/server/plugins/irc-events/motd.js +10 -16
- package/dist/server/plugins/irc-events/names.js +3 -6
- package/dist/server/plugins/irc-events/nick.js +26 -23
- package/dist/server/plugins/irc-events/part.js +19 -15
- package/dist/server/plugins/irc-events/quit.js +17 -14
- package/dist/server/plugins/irc-events/sasl.js +9 -15
- package/dist/server/plugins/irc-events/spgroups.js +38 -0
- package/dist/server/plugins/irc-events/spjoin.js +52 -0
- package/dist/server/plugins/irc-events/topic.js +12 -18
- package/dist/server/plugins/irc-events/unhandled.js +12 -12
- package/dist/server/plugins/irc-events/welcome.js +7 -13
- package/dist/server/plugins/irc-events/whois.js +20 -24
- package/dist/server/plugins/massEventAggregator.js +214 -0
- package/dist/server/plugins/messageStorage/sqlite.js +322 -141
- package/dist/server/plugins/messageStorage/text.js +21 -26
- package/dist/server/plugins/packages/index.js +105 -74
- package/dist/server/plugins/packages/publicClient.js +7 -16
- package/dist/server/plugins/packages/themes.js +11 -16
- package/dist/server/plugins/storage.js +28 -33
- package/dist/server/plugins/sts.js +12 -17
- package/dist/server/plugins/uploader.js +40 -43
- package/dist/server/plugins/webpush.js +23 -51
- package/dist/server/server.js +318 -271
- package/dist/server/storageCleaner.js +29 -37
- package/dist/server/utils/fish.js +7 -14
- package/dist/shared/irc.js +3 -6
- package/dist/shared/linkify.js +7 -14
- package/dist/shared/types/chan.js +6 -9
- package/dist/shared/types/changelog.js +1 -2
- package/dist/shared/types/config.js +1 -2
- package/dist/shared/types/mention.js +1 -2
- package/dist/shared/types/msg.js +3 -5
- package/dist/shared/types/network.js +1 -2
- package/dist/shared/types/storage.js +1 -2
- package/dist/shared/types/user.js +1 -2
- package/index.js +14 -10
- package/package.json +93 -91
- package/public/css/style.css +9 -6
- package/public/css/style.css.map +1 -1
- package/public/fonts/font-awesome/fa-brands-400.ttf +0 -0
- package/public/fonts/font-awesome/fa-brands-400.woff2 +0 -0
- package/public/fonts/font-awesome/fa-duotone-900.ttf +0 -0
- package/public/fonts/font-awesome/fa-duotone-900.woff2 +0 -0
- package/public/fonts/font-awesome/fa-light-300.ttf +0 -0
- package/public/fonts/font-awesome/fa-light-300.woff2 +0 -0
- package/public/fonts/font-awesome/fa-regular-400.ttf +0 -0
- package/public/fonts/font-awesome/fa-regular-400.woff2 +0 -0
- package/public/fonts/font-awesome/fa-solid-900.ttf +0 -0
- package/public/fonts/font-awesome/fa-solid-900.woff2 +0 -0
- package/public/fonts/font-awesome/fa-thin-100.ttf +0 -0
- package/public/fonts/font-awesome/fa-thin-100.woff2 +0 -0
- package/public/fonts/font-awesome/fa-v4compatibility.ttf +0 -0
- package/public/fonts/font-awesome/fa-v4compatibility.woff2 +0 -0
- package/public/js/bundle.js +1 -1
- package/public/js/bundle.js.map +1 -1
- package/public/js/bundle.vendor.js +1 -1
- package/public/js/bundle.vendor.js.LICENSE.txt +24 -6
- package/public/js/bundle.vendor.js.map +1 -1
- package/public/service-worker.js +1 -1
- package/public/themes/default.css +1 -1
- package/public/themes/morning.css +1 -1
- package/dist/webpack.config.js +0 -224
|
@@ -1,31 +1,25 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
};
|
|
5
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
exports.StorageCleaner = void 0;
|
|
7
|
-
const config_1 = __importDefault(require("./config"));
|
|
8
|
-
const log_1 = __importDefault(require("./log"));
|
|
9
|
-
const msg_1 = require("../shared/types/msg");
|
|
1
|
+
import Config from "./config.js";
|
|
2
|
+
import log from "./log.js";
|
|
3
|
+
import { MessageType } from "../shared/types/msg.js";
|
|
10
4
|
const status_types = [
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
5
|
+
MessageType.AWAY,
|
|
6
|
+
MessageType.BACK,
|
|
7
|
+
MessageType.INVITE,
|
|
8
|
+
MessageType.JOIN,
|
|
9
|
+
MessageType.KICK,
|
|
10
|
+
MessageType.MODE,
|
|
11
|
+
MessageType.MODE_CHANNEL,
|
|
12
|
+
MessageType.MODE_USER,
|
|
13
|
+
MessageType.NICK,
|
|
14
|
+
MessageType.PART,
|
|
15
|
+
MessageType.QUIT,
|
|
16
|
+
MessageType.CTCP, // not technically a status, but generally those are only of interest temporarily
|
|
17
|
+
MessageType.CTCP_REQUEST,
|
|
18
|
+
MessageType.CHGHOST,
|
|
19
|
+
MessageType.TOPIC,
|
|
20
|
+
MessageType.TOPIC_SET_BY,
|
|
27
21
|
];
|
|
28
|
-
class StorageCleaner {
|
|
22
|
+
export class StorageCleaner {
|
|
29
23
|
db;
|
|
30
24
|
olderThanDays;
|
|
31
25
|
messageTypes;
|
|
@@ -38,7 +32,7 @@ class StorageCleaner {
|
|
|
38
32
|
this.isStopped = true;
|
|
39
33
|
this.db = db;
|
|
40
34
|
this.limit = 200;
|
|
41
|
-
const policy =
|
|
35
|
+
const policy = Config.values.storagePolicy;
|
|
42
36
|
this.olderThanDays = policy.maxAgeDays;
|
|
43
37
|
switch (policy.deletionPolicy) {
|
|
44
38
|
case "statusOnly":
|
|
@@ -49,7 +43,7 @@ class StorageCleaner {
|
|
|
49
43
|
break;
|
|
50
44
|
default:
|
|
51
45
|
// exhaustive switch guard, blows up when user specifies a invalid policy enum
|
|
52
|
-
this.messageTypes = assertNoBadPolicy(
|
|
46
|
+
this.messageTypes = assertNoBadPolicy();
|
|
53
47
|
}
|
|
54
48
|
}
|
|
55
49
|
genDeletionRequest() {
|
|
@@ -60,7 +54,7 @@ class StorageCleaner {
|
|
|
60
54
|
};
|
|
61
55
|
}
|
|
62
56
|
async runDeletesNoLimit() {
|
|
63
|
-
if (!
|
|
57
|
+
if (!Config.values.storagePolicy.enabled) {
|
|
64
58
|
// this is meant to be used by cli tools, so we guard against this
|
|
65
59
|
throw new Error("storage policy is disabled");
|
|
66
60
|
}
|
|
@@ -86,9 +80,9 @@ class StorageCleaner {
|
|
|
86
80
|
}
|
|
87
81
|
catch (err) {
|
|
88
82
|
this.errCount++;
|
|
89
|
-
|
|
83
|
+
log.error("can't clean messages", err instanceof Error ? err.message : String(err));
|
|
90
84
|
if (this.errCount === 2) {
|
|
91
|
-
|
|
85
|
+
log.error("Cleaning failed too many times, will not retry");
|
|
92
86
|
this.stop();
|
|
93
87
|
return;
|
|
94
88
|
}
|
|
@@ -105,10 +99,9 @@ class StorageCleaner {
|
|
|
105
99
|
}
|
|
106
100
|
}
|
|
107
101
|
schedule(ms) {
|
|
108
|
-
const self = this;
|
|
109
102
|
this.ticker = setTimeout(() => {
|
|
110
|
-
|
|
111
|
-
|
|
103
|
+
this.runDeletes().catch((err) => {
|
|
104
|
+
log.error("storageCleaner: unexpected failure");
|
|
112
105
|
throw err;
|
|
113
106
|
});
|
|
114
107
|
}, ms);
|
|
@@ -125,7 +118,6 @@ class StorageCleaner {
|
|
|
125
118
|
clearTimeout(this.ticker);
|
|
126
119
|
}
|
|
127
120
|
}
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
throw new Error(`Invalid deletion policy "${config_1.default.values.storagePolicy.deletionPolicy}" in the \`storagePolicy\` object, fix your config.`);
|
|
121
|
+
function assertNoBadPolicy() {
|
|
122
|
+
throw new Error(`Invalid deletion policy "${Config.values.storagePolicy.deletionPolicy}" in the \`storagePolicy\` object, fix your config.`);
|
|
131
123
|
}
|
|
@@ -1,8 +1,5 @@
|
|
|
1
|
-
"use strict";
|
|
2
1
|
// Modern TypeScript FiSH Blowfish implementation
|
|
3
2
|
// Functional approach with proper typing and error handling
|
|
4
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
5
|
-
exports.tryDecryptFishLine = exports.createFishMessage = exports.tryDecryptFishMessage = exports.fishDecrypt = exports.fishEncrypt = void 0;
|
|
6
3
|
// Constants
|
|
7
4
|
const FISH_BASE64 = "./0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ";
|
|
8
5
|
const INITIAL_P = [
|
|
@@ -302,7 +299,7 @@ const decodeBase64Block = (chunk) => {
|
|
|
302
299
|
return [left >>> 0, right >>> 0];
|
|
303
300
|
};
|
|
304
301
|
// Main encryption function
|
|
305
|
-
const fishEncrypt = (plaintext, key) => {
|
|
302
|
+
export const fishEncrypt = (plaintext, key) => {
|
|
306
303
|
const blowfish = createBlowfish(stringToBytes(key));
|
|
307
304
|
const data = padData(stringToBytes(plaintext));
|
|
308
305
|
let result = "";
|
|
@@ -325,9 +322,8 @@ const fishEncrypt = (plaintext, key) => {
|
|
|
325
322
|
}
|
|
326
323
|
return result;
|
|
327
324
|
};
|
|
328
|
-
exports.fishEncrypt = fishEncrypt;
|
|
329
325
|
// Main decryption function
|
|
330
|
-
const fishDecrypt = (ciphertext, key) => {
|
|
326
|
+
export const fishDecrypt = (ciphertext, key) => {
|
|
331
327
|
if (ciphertext.length < 12) {
|
|
332
328
|
return { text: "", status: "error" };
|
|
333
329
|
}
|
|
@@ -376,9 +372,8 @@ const fishDecrypt = (ciphertext, key) => {
|
|
|
376
372
|
return { text: "", status: "error" };
|
|
377
373
|
}
|
|
378
374
|
};
|
|
379
|
-
exports.fishDecrypt = fishDecrypt;
|
|
380
375
|
// High-level functions
|
|
381
|
-
const tryDecryptFishMessage = (message, key) => {
|
|
376
|
+
export const tryDecryptFishMessage = (message, key) => {
|
|
382
377
|
if (!key) {
|
|
383
378
|
return null;
|
|
384
379
|
}
|
|
@@ -387,13 +382,11 @@ const tryDecryptFishMessage = (message, key) => {
|
|
|
387
382
|
return null;
|
|
388
383
|
}
|
|
389
384
|
const payload = match[1].trim();
|
|
390
|
-
const result =
|
|
385
|
+
const result = fishDecrypt(payload, key);
|
|
391
386
|
return result.status !== "error" ? `\u000314[ECB]\u0003 ${result.text}` : null;
|
|
392
387
|
};
|
|
393
|
-
|
|
394
|
-
const
|
|
395
|
-
const encrypted = (0, exports.fishEncrypt)(plaintext, key);
|
|
388
|
+
export const createFishMessage = (plaintext, key) => {
|
|
389
|
+
const encrypted = fishEncrypt(plaintext, key);
|
|
396
390
|
return `+OK ${encrypted}`;
|
|
397
391
|
};
|
|
398
|
-
|
|
399
|
-
exports.tryDecryptFishLine = exports.tryDecryptFishMessage;
|
|
392
|
+
export const tryDecryptFishLine = tryDecryptFishMessage;
|
package/dist/shared/irc.js
CHANGED
|
@@ -1,17 +1,14 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.condensedTypes = exports.cleanIrcMessage = void 0;
|
|
4
1
|
const matchFormatting = /\x02|\x1D|\x1F|\x16|\x0F|\x11|\x1E|\x03(?:[0-9]{1,2}(?:,[0-9]{1,2})?)?|\x04(?:[0-9a-f]{6}(?:,[0-9a-f]{6})?)?/gi;
|
|
5
|
-
function cleanIrcMessage(message) {
|
|
2
|
+
export function cleanIrcMessage(message) {
|
|
6
3
|
return message.replace(matchFormatting, "").trim();
|
|
7
4
|
}
|
|
8
|
-
|
|
9
|
-
exports.condensedTypes = new Set([
|
|
5
|
+
export const condensedTypes = new Set([
|
|
10
6
|
"away",
|
|
11
7
|
"back",
|
|
12
8
|
"chghost",
|
|
13
9
|
"join",
|
|
14
10
|
"kick",
|
|
11
|
+
"mass_event",
|
|
15
12
|
"mode",
|
|
16
13
|
"nick",
|
|
17
14
|
"part",
|
package/dist/shared/linkify.js
CHANGED
|
@@ -1,12 +1,6 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
};
|
|
5
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
exports.findLinksWithSchema = exports.findLinks = void 0;
|
|
7
|
-
const linkify_it_1 = __importDefault(require("linkify-it"));
|
|
8
|
-
const tlds_1 = __importDefault(require("tlds"));
|
|
9
|
-
const linkify = (0, linkify_it_1.default)().tlds(tlds_1.default).tlds("onion", true);
|
|
1
|
+
import LinkifyIt from "linkify-it";
|
|
2
|
+
import tlds from "tlds/index.json" with { type: "json" };
|
|
3
|
+
const linkify = LinkifyIt().tlds(tlds).tlds("onion", true);
|
|
10
4
|
// Known schemes to detect in text
|
|
11
5
|
const commonSchemes = [
|
|
12
6
|
"sftp",
|
|
@@ -50,28 +44,27 @@ linkify.add("web+", {
|
|
|
50
44
|
// We take the validation logic from linkify and just add our own
|
|
51
45
|
// normalizer.
|
|
52
46
|
linkify.add("//", {
|
|
53
|
-
validate: linkify
|
|
47
|
+
validate: linkify
|
|
48
|
+
.__schemas__["//"].validate,
|
|
54
49
|
normalize(match) {
|
|
55
50
|
match.schema = ""; // this counts as not having a schema
|
|
56
51
|
match.url = "http:" + match.url;
|
|
57
52
|
},
|
|
58
53
|
});
|
|
59
|
-
function findLinks(text) {
|
|
54
|
+
export function findLinks(text) {
|
|
60
55
|
const matches = linkify.match(text);
|
|
61
56
|
if (!matches) {
|
|
62
57
|
return [];
|
|
63
58
|
}
|
|
64
59
|
return matches.map(makeLinkPart);
|
|
65
60
|
}
|
|
66
|
-
|
|
67
|
-
function findLinksWithSchema(text) {
|
|
61
|
+
export function findLinksWithSchema(text) {
|
|
68
62
|
const matches = linkify.match(text);
|
|
69
63
|
if (!matches) {
|
|
70
64
|
return [];
|
|
71
65
|
}
|
|
72
66
|
return matches.filter((url) => !!url.schema).map(makeLinkPart);
|
|
73
67
|
}
|
|
74
|
-
exports.findLinksWithSchema = findLinksWithSchema;
|
|
75
68
|
function makeLinkPart(url) {
|
|
76
69
|
return {
|
|
77
70
|
start: url.index,
|
|
@@ -1,22 +1,19 @@
|
|
|
1
|
-
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.ChanState = exports.SpecialChanType = exports.ChanType = void 0;
|
|
4
|
-
var ChanType;
|
|
1
|
+
export var ChanType;
|
|
5
2
|
(function (ChanType) {
|
|
6
3
|
ChanType["CHANNEL"] = "channel";
|
|
7
4
|
ChanType["LOBBY"] = "lobby";
|
|
8
5
|
ChanType["QUERY"] = "query";
|
|
9
6
|
ChanType["SPECIAL"] = "special";
|
|
10
|
-
})(ChanType || (
|
|
11
|
-
var SpecialChanType;
|
|
7
|
+
})(ChanType || (ChanType = {}));
|
|
8
|
+
export var SpecialChanType;
|
|
12
9
|
(function (SpecialChanType) {
|
|
13
10
|
SpecialChanType["BANLIST"] = "list_bans";
|
|
14
11
|
SpecialChanType["INVITELIST"] = "list_invites";
|
|
15
12
|
SpecialChanType["CHANNELLIST"] = "list_channels";
|
|
16
13
|
SpecialChanType["IGNORELIST"] = "list_ignored";
|
|
17
|
-
})(SpecialChanType || (
|
|
18
|
-
var ChanState;
|
|
14
|
+
})(SpecialChanType || (SpecialChanType = {}));
|
|
15
|
+
export var ChanState;
|
|
19
16
|
(function (ChanState) {
|
|
20
17
|
ChanState[ChanState["PARTED"] = 0] = "PARTED";
|
|
21
18
|
ChanState[ChanState["JOINED"] = 1] = "JOINED";
|
|
22
|
-
})(ChanState || (
|
|
19
|
+
})(ChanState || (ChanState = {}));
|
|
@@ -1,2 +1 @@
|
|
|
1
|
-
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
1
|
+
export {};
|
|
@@ -1,2 +1 @@
|
|
|
1
|
-
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
1
|
+
export {};
|
|
@@ -1,2 +1 @@
|
|
|
1
|
-
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
1
|
+
export {};
|
package/dist/shared/types/msg.js
CHANGED
|
@@ -1,7 +1,4 @@
|
|
|
1
|
-
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.MessageType = void 0;
|
|
4
|
-
var MessageType;
|
|
1
|
+
export var MessageType;
|
|
5
2
|
(function (MessageType) {
|
|
6
3
|
MessageType["UNHANDLED"] = "unhandled";
|
|
7
4
|
MessageType["ACTION"] = "action";
|
|
@@ -31,4 +28,5 @@ var MessageType;
|
|
|
31
28
|
MessageType["RAW"] = "raw";
|
|
32
29
|
MessageType["PLUGIN"] = "plugin";
|
|
33
30
|
MessageType["WALLOPS"] = "wallops";
|
|
34
|
-
|
|
31
|
+
MessageType["MASS_EVENT"] = "mass_event";
|
|
32
|
+
})(MessageType || (MessageType = {}));
|
|
@@ -1,2 +1 @@
|
|
|
1
|
-
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
1
|
+
export {};
|
|
@@ -1,2 +1 @@
|
|
|
1
|
-
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
1
|
+
export {};
|
|
@@ -1,2 +1 @@
|
|
|
1
|
-
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
1
|
+
export {};
|
package/index.js
CHANGED
|
@@ -1,19 +1,23 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
import {existsSync} from "node:fs";
|
|
4
|
+
import {resolve} from "node:path";
|
|
5
|
+
import {fileURLToPath} from "node:url";
|
|
6
|
+
import semver from "semver";
|
|
7
|
+
import pkg from "./package.json" with {type: "json"};
|
|
8
|
+
|
|
9
|
+
const __filename = fileURLToPath(import.meta.url);
|
|
10
|
+
const __dirname = resolve(__filename, "..");
|
|
4
11
|
|
|
5
12
|
process.chdir(__dirname);
|
|
6
13
|
|
|
7
|
-
|
|
8
|
-
// Doing this check as soon as possible allows us to
|
|
9
|
-
// avoid ES6 parser errors or other issues
|
|
10
|
-
const pkg = require("./package.json");
|
|
14
|
+
const requiredNodeVersion = pkg.engines?.node ?? "";
|
|
11
15
|
|
|
12
|
-
if (!
|
|
16
|
+
if (!semver.satisfies(process.version, requiredNodeVersion)) {
|
|
13
17
|
/* eslint-disable no-console */
|
|
14
18
|
console.error(
|
|
15
19
|
"The Lounge requires Node.js " +
|
|
16
|
-
|
|
20
|
+
requiredNodeVersion +
|
|
17
21
|
" (current version: " +
|
|
18
22
|
process.version +
|
|
19
23
|
")"
|
|
@@ -25,10 +29,10 @@ if (!require("semver").satisfies(process.version, pkg.engines.node)) {
|
|
|
25
29
|
process.exit(1);
|
|
26
30
|
}
|
|
27
31
|
|
|
28
|
-
const
|
|
32
|
+
const distEntry = resolve(__dirname, "./dist/server/index.js");
|
|
29
33
|
|
|
30
|
-
if (
|
|
31
|
-
|
|
34
|
+
if (existsSync(distEntry)) {
|
|
35
|
+
await import("./dist/server/index.js");
|
|
32
36
|
} else {
|
|
33
37
|
console.error(
|
|
34
38
|
"Files in ./dist/server/ not found. Please run `yarn build` before trying to run `node index.js`."
|
package/package.json
CHANGED
|
@@ -1,11 +1,10 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@lordbex/thelounge",
|
|
3
3
|
"description": "The self-hosted Web IRC client",
|
|
4
|
-
"version": "4.
|
|
4
|
+
"version": "4.5.0-blowfish-pre",
|
|
5
|
+
"type": "module",
|
|
5
6
|
"preferGlobal": true,
|
|
6
|
-
"bin":
|
|
7
|
-
"thelounge": "index.js"
|
|
8
|
-
},
|
|
7
|
+
"bin": "index.js",
|
|
9
8
|
"repository": {
|
|
10
9
|
"type": "git",
|
|
11
10
|
"url": "https://github.com/LordBex/thelounge.git"
|
|
@@ -13,21 +12,20 @@
|
|
|
13
12
|
"homepage": "https://thelounge.chat/",
|
|
14
13
|
"scripts": {
|
|
15
14
|
"build:client": "webpack",
|
|
16
|
-
"build:server": "tsc
|
|
15
|
+
"build:server": "tsc --build server/tsconfig.json",
|
|
17
16
|
"build": "run-p --aggregate-output build:client build:server",
|
|
18
|
-
"coverage": "run-s test
|
|
19
|
-
"dev": "cross-env NODE_ENV=development
|
|
17
|
+
"coverage": "run-s test:mocha test:nospec && nyc --nycrc-path=test/.nycrc-report.json report",
|
|
18
|
+
"dev": "cross-env NODE_ENV=development tsx server/index.ts start --dev",
|
|
20
19
|
"format:prettier": "prettier --write \"**/*.*\"",
|
|
21
20
|
"generate:config:doc": "ts-node scripts/generate-config-doc.js",
|
|
22
|
-
"lint:check-eslint": "eslint-config-prettier .eslintrc.cjs",
|
|
23
21
|
"lint:eslint": "eslint . --report-unused-disable-directives --color",
|
|
24
22
|
"lint:prettier": "prettier --list-different \"**/*.*\"",
|
|
25
23
|
"lint:stylelint": "stylelint --color \"client/**/*.css\"",
|
|
26
|
-
"lint": "run-p --aggregate-output --continue-on-error lint
|
|
24
|
+
"lint": "run-p --aggregate-output --continue-on-error lint:eslint lint:prettier lint:stylelint",
|
|
27
25
|
"start": "node index start",
|
|
28
|
-
"test": "run-p --aggregate-output --continue-on-error lint
|
|
29
|
-
"test:mocha": "webpack --mode=development && cross-env NODE_ENV=test
|
|
30
|
-
"test:nospec": "webpack --mode=development && cross-env NODE_ENV=test
|
|
26
|
+
"test": "run-p --aggregate-output --continue-on-error lint:eslint lint:prettier lint:stylelint test:mocha",
|
|
27
|
+
"test:mocha": "webpack --mode=development && cross-env NODE_ENV=test tsx node_modules/.bin/mocha --config=test/.mocharc.yml 'test/**/*.ts'",
|
|
28
|
+
"test:nospec": "webpack --mode=development && cross-env NODE_ENV=test tsx node_modules/.bin/mocha --config=test/.mocharc.yml",
|
|
31
29
|
"watch": "webpack --watch",
|
|
32
30
|
"githooks-install": "git config core.hooksPath scripts/git-hooks"
|
|
33
31
|
},
|
|
@@ -44,7 +42,7 @@
|
|
|
44
42
|
],
|
|
45
43
|
"license": "MIT",
|
|
46
44
|
"engines": {
|
|
47
|
-
"node": ">=
|
|
45
|
+
"node": ">=20.0.0"
|
|
48
46
|
},
|
|
49
47
|
"files": [
|
|
50
48
|
"./.thelounge_home",
|
|
@@ -56,120 +54,124 @@
|
|
|
56
54
|
"./public/**"
|
|
57
55
|
],
|
|
58
56
|
"dependencies": {
|
|
59
|
-
"@fastify/busboy": "
|
|
60
|
-
"bcryptjs": "
|
|
61
|
-
"chalk": "
|
|
62
|
-
"cheerio": "1.
|
|
63
|
-
"commander": "
|
|
57
|
+
"@fastify/busboy": "3.2.0",
|
|
58
|
+
"bcryptjs": "3.0.3",
|
|
59
|
+
"chalk": "5.6.2",
|
|
60
|
+
"cheerio": "1.1.2",
|
|
61
|
+
"commander": "14.0.2",
|
|
64
62
|
"content-disposition": "0.5.4",
|
|
65
|
-
"express": "
|
|
66
|
-
"file-type": "
|
|
67
|
-
"filenamify": "
|
|
68
|
-
"got": "11.8.6",
|
|
63
|
+
"express": "5.1.0",
|
|
64
|
+
"file-type": "21.1.0",
|
|
65
|
+
"filenamify": "7.0.1",
|
|
69
66
|
"irc-framework": "4.14.0",
|
|
70
|
-
"
|
|
71
|
-
"
|
|
72
|
-
"linkify-it": "3.0.3",
|
|
67
|
+
"ldapts": "8.0.9",
|
|
68
|
+
"linkify-it": "5.0.0",
|
|
73
69
|
"lodash": "4.17.21",
|
|
74
|
-
"mime-types": "
|
|
70
|
+
"mime-types": "3.0.1",
|
|
75
71
|
"node-forge": "1.3.1",
|
|
76
|
-
"package-json": "
|
|
77
|
-
"read": "
|
|
78
|
-
"read-chunk": "
|
|
79
|
-
"semver": "7.
|
|
80
|
-
"socket.io": "4.
|
|
81
|
-
"tlds": "1.
|
|
82
|
-
"ua-parser-js": "
|
|
83
|
-
"
|
|
84
|
-
"
|
|
85
|
-
"
|
|
72
|
+
"package-json": "10.0.1",
|
|
73
|
+
"read": "5.0.1",
|
|
74
|
+
"read-chunk": "5.0.0",
|
|
75
|
+
"semver": "7.7.3",
|
|
76
|
+
"socket.io": "4.8.1",
|
|
77
|
+
"tlds": "1.261.0",
|
|
78
|
+
"ua-parser-js": "2.0.6",
|
|
79
|
+
"undici": "7.16.0",
|
|
80
|
+
"uuid": "13.0.0",
|
|
81
|
+
"web-push": "3.6.7"
|
|
86
82
|
},
|
|
87
83
|
"optionalDependencies": {
|
|
88
|
-
"sqlite3": "
|
|
84
|
+
"better-sqlite3": "12.4.1"
|
|
89
85
|
},
|
|
90
86
|
"devDependencies": {
|
|
91
|
-
"@babel/core": "7.
|
|
92
|
-
"@babel/plugin-transform-runtime": "7.
|
|
93
|
-
"@babel/preset-env": "7.
|
|
87
|
+
"@babel/core": "7.28.5",
|
|
88
|
+
"@babel/plugin-transform-runtime": "7.28.5",
|
|
89
|
+
"@babel/preset-env": "7.28.5",
|
|
94
90
|
"@fortawesome/fontawesome-free": "5.15.4",
|
|
95
91
|
"@istanbuljs/nyc-config-typescript": "1.0.2",
|
|
96
|
-
"@
|
|
92
|
+
"@stylistic/stylelint-plugin": "^4.0.0",
|
|
93
|
+
"@textcomplete/core": "0.1.13",
|
|
97
94
|
"@textcomplete/textarea": "0.1.13",
|
|
98
95
|
"@types/bcryptjs": "2.4.6",
|
|
99
|
-
"@types/
|
|
96
|
+
"@types/better-sqlite3": "7.6.11",
|
|
97
|
+
"@types/chai": "5.2.3",
|
|
100
98
|
"@types/cheerio": "0.22.35",
|
|
101
99
|
"@types/content-disposition": "0.5.8",
|
|
102
|
-
"@types/express": "
|
|
103
|
-
"@types/is-utf8": "0.2.3",
|
|
104
|
-
"@types/ldapjs": "2.2.5",
|
|
100
|
+
"@types/express": "5.0.5",
|
|
105
101
|
"@types/linkify-it": "3.0.5",
|
|
106
|
-
"@types/lodash": "4.
|
|
107
|
-
"@types/mime-types": "
|
|
108
|
-
"@types/mocha": "
|
|
102
|
+
"@types/lodash": "4.17.20",
|
|
103
|
+
"@types/mime-types": "3.0.1",
|
|
104
|
+
"@types/mocha": "^10.0.10",
|
|
109
105
|
"@types/mousetrap": "1.6.15",
|
|
110
|
-
"@types/node": "
|
|
106
|
+
"@types/node": "24.10.1",
|
|
111
107
|
"@types/read": "0.0.32",
|
|
112
|
-
"@types/semver": "7.
|
|
108
|
+
"@types/semver": "7.7.1",
|
|
109
|
+
"@types/sinon": "^20.0.0",
|
|
113
110
|
"@types/sortablejs": "1.15.8",
|
|
114
|
-
"@types/sqlite3": "3.1.11",
|
|
115
111
|
"@types/ua-parser-js": "0.7.39",
|
|
116
112
|
"@types/uuid": "8.3.4",
|
|
117
|
-
"@types/web-push": "3.
|
|
113
|
+
"@types/web-push": "3.6.4",
|
|
118
114
|
"@types/webpack-env": "1.16.4",
|
|
119
115
|
"@types/webpack-hot-middleware": "2.25.6",
|
|
120
116
|
"@types/ws": "8.5.12",
|
|
121
|
-
"@
|
|
122
|
-
"@typescript-eslint/
|
|
123
|
-
"@
|
|
117
|
+
"@types/wtfnode": "^0",
|
|
118
|
+
"@typescript-eslint/eslint-plugin": "8.46.4",
|
|
119
|
+
"@typescript-eslint/parser": "8.46.4",
|
|
120
|
+
"@vue/runtime-dom": "3.5.24",
|
|
124
121
|
"@vue/test-utils": "2.4.6",
|
|
125
|
-
"babel-loader": "
|
|
122
|
+
"babel-loader": "10.0.0",
|
|
126
123
|
"babel-plugin-istanbul": "6.1.1",
|
|
127
124
|
"babel-preset-typescript-vue3": "2.0.17",
|
|
128
|
-
"chai": "
|
|
129
|
-
"copy-webpack-plugin": "
|
|
125
|
+
"chai": "6.2.1",
|
|
126
|
+
"copy-webpack-plugin": "13.0.1",
|
|
130
127
|
"cross-env": "7.0.3",
|
|
131
|
-
"css-loader": "
|
|
132
|
-
"cssnano": "
|
|
128
|
+
"css-loader": "7.1.2",
|
|
129
|
+
"cssnano": "7.1.2",
|
|
133
130
|
"dayjs": "1.10.8",
|
|
134
131
|
"emoji-regex": "10.2.1",
|
|
135
|
-
"eslint": "
|
|
136
|
-
"eslint-config-prettier": "
|
|
137
|
-
"eslint-
|
|
138
|
-
"
|
|
139
|
-
"fork-ts-checker-webpack-plugin": "7.2.13",
|
|
132
|
+
"eslint": "9.39.1",
|
|
133
|
+
"eslint-config-prettier": "10.1.8",
|
|
134
|
+
"eslint-plugin-vue": "10.5.1",
|
|
135
|
+
"fork-ts-checker-webpack-plugin": "9.1.0",
|
|
140
136
|
"fuzzy": "0.1.3",
|
|
141
|
-
"
|
|
142
|
-
"
|
|
137
|
+
"globals": "16.5.0",
|
|
138
|
+
"mini-css-extract-plugin": "2.9.4",
|
|
139
|
+
"mocha": "^11.7.5",
|
|
143
140
|
"mousetrap": "1.6.5",
|
|
144
141
|
"normalize.css": "8.0.1",
|
|
145
142
|
"npm-run-all": "4.1.5",
|
|
146
|
-
"nyc": "
|
|
147
|
-
"postcss": "8.
|
|
148
|
-
"postcss-import": "
|
|
149
|
-
"postcss-loader": "
|
|
150
|
-
"postcss-preset-env": "
|
|
151
|
-
"prettier": "
|
|
152
|
-
"pretty-quick": "
|
|
143
|
+
"nyc": "17.1.0",
|
|
144
|
+
"postcss": "8.5.6",
|
|
145
|
+
"postcss-import": "16.1.1",
|
|
146
|
+
"postcss-loader": "8.2.0",
|
|
147
|
+
"postcss-preset-env": "10.4.0",
|
|
148
|
+
"prettier": "3.6.2",
|
|
149
|
+
"pretty-quick": "4.2.2",
|
|
153
150
|
"primer-tooltips": "2.0.0",
|
|
154
|
-
"sinon": "
|
|
155
|
-
"socket.io-client": "4.
|
|
151
|
+
"sinon": "21.0.0",
|
|
152
|
+
"socket.io-client": "4.8.1",
|
|
156
153
|
"sortablejs": "1.15.2",
|
|
157
|
-
"stylelint": "
|
|
158
|
-
"stylelint-config-standard": "
|
|
159
|
-
"ts-loader": "9.
|
|
160
|
-
"ts-node": "10.
|
|
154
|
+
"stylelint": "16.25.0",
|
|
155
|
+
"stylelint-config-standard": "36.0.1",
|
|
156
|
+
"ts-loader": "9.5.4",
|
|
157
|
+
"ts-node": "10.9.2",
|
|
161
158
|
"ts-sinon": "2.0.2",
|
|
162
|
-
"
|
|
159
|
+
"tsx": "^4.20.6",
|
|
160
|
+
"typescript": "5.9.3",
|
|
163
161
|
"undate": "0.3.0",
|
|
164
|
-
"vue": "3.
|
|
165
|
-
"vue-eslint-parser": "
|
|
166
|
-
"vue-loader": "17.
|
|
167
|
-
"vue-router": "4.
|
|
168
|
-
"vuex": "4.0
|
|
169
|
-
"webpack": "5.
|
|
170
|
-
"webpack-cli": "
|
|
171
|
-
"webpack-dev-middleware": "
|
|
172
|
-
"webpack-hot-middleware": "2.
|
|
162
|
+
"vue": "3.5.24",
|
|
163
|
+
"vue-eslint-parser": "10.2.0",
|
|
164
|
+
"vue-loader": "17.4.2",
|
|
165
|
+
"vue-router": "4.6.3",
|
|
166
|
+
"vuex": "4.1.0",
|
|
167
|
+
"webpack": "5.102.1",
|
|
168
|
+
"webpack-cli": "6.0.1",
|
|
169
|
+
"webpack-dev-middleware": "7.4.2",
|
|
170
|
+
"webpack-hot-middleware": "2.26.1",
|
|
171
|
+
"wtfnode": "^0.10.1"
|
|
172
|
+
},
|
|
173
|
+
"resolutions": {
|
|
174
|
+
"js-yaml": "^4.1.1"
|
|
173
175
|
},
|
|
174
|
-
"packageManager": "yarn@
|
|
176
|
+
"packageManager": "yarn@4.11.0"
|
|
175
177
|
}
|