Compare commits
No commits in common. "5cdfaa801968dfcac868a5eff5d8680203b04b3a" and "815fe046365c83879d89b06b8f7f12d106c0c76b" have entirely different histories.
5cdfaa8019
...
815fe04636
7
.github/workflows/build.yml
vendored
7
.github/workflows/build.yml
vendored
@ -12,7 +12,9 @@ jobs:
|
||||
strategy:
|
||||
matrix:
|
||||
include:
|
||||
# EOL: April 2025
|
||||
# EOL: April 2024
|
||||
- os: ubuntu-latest
|
||||
node_version: 16.x
|
||||
- os: macOS-latest
|
||||
node_version: 18.x
|
||||
- os: windows-latest
|
||||
@ -23,9 +25,6 @@ jobs:
|
||||
# EOL: April 2026
|
||||
- os: ubuntu-latest
|
||||
node_version: 20.x
|
||||
# EOL: April/June 2024
|
||||
- os: ubuntu-latest
|
||||
node_version: 21.x
|
||||
|
||||
runs-on: ${{ matrix.os }}
|
||||
|
||||
|
@ -110,23 +110,26 @@ router.beforeEach((to, from, next) => {
|
||||
next();
|
||||
});
|
||||
|
||||
router.beforeEach((to, from) => {
|
||||
router.beforeEach((to, from, next) => {
|
||||
// Disallow navigating to non-existing routes
|
||||
if (!to.matched.length) {
|
||||
return false;
|
||||
next(false);
|
||||
return;
|
||||
}
|
||||
|
||||
// Disallow navigating to invalid channels
|
||||
if (to.name === "RoutedChat" && !store.getters.findChannel(Number(to.params.id))) {
|
||||
return false;
|
||||
next(false);
|
||||
return;
|
||||
}
|
||||
|
||||
// Disallow navigating to invalid networks
|
||||
if (to.name === "NetworkEdit" && !store.getters.findNetwork(String(to.params.uuid))) {
|
||||
return false;
|
||||
next(false);
|
||||
return;
|
||||
}
|
||||
|
||||
return true;
|
||||
next();
|
||||
});
|
||||
|
||||
router.afterEach((to) => {
|
||||
|
@ -24,9 +24,8 @@
|
||||
"lint:stylelint": "stylelint --color \"client/**/*.css\"",
|
||||
"lint": "run-p --aggregate-output --continue-on-error lint:*",
|
||||
"start": "node index start",
|
||||
"test": "run-p --aggregate-output --continue-on-error lint:* test:mocha",
|
||||
"test:mocha": "webpack --mode=development && cross-env NODE_ENV=test TS_NODE_PROJECT='./test/tsconfig.json' mocha --config=test/.mocharc.yml 'test/**/*.ts'",
|
||||
"test:nospec": "webpack --mode=development && cross-env NODE_ENV=test TS_NODE_PROJECT='./test/tsconfig.json' mocha --config=test/.mocharc.yml",
|
||||
"test": "run-p --aggregate-output --continue-on-error lint:* test:*",
|
||||
"test:mocha": "cross-env NODE_ENV=test webpack --mode=development && cross-env NODE_ENV=test TS_NODE_PROJECT='./test/tsconfig.json' nyc --nycrc-path=test/.nycrc-mocha.json mocha --require ts-node/register --colors --config=test/.mocharc.yml",
|
||||
"watch": "webpack --watch"
|
||||
},
|
||||
"keywords": [
|
||||
@ -41,7 +40,7 @@
|
||||
],
|
||||
"license": "MIT",
|
||||
"engines": {
|
||||
"node": ">=18.0.0"
|
||||
"node": ">=16.0.0"
|
||||
},
|
||||
"files": [
|
||||
"./.thelounge_home",
|
||||
|
@ -18,7 +18,6 @@ import TextFileMessageStorage from "./plugins/messageStorage/text";
|
||||
import Network, {IgnoreListItem, NetworkConfig, NetworkWithIrcFramework} from "./models/network";
|
||||
import ClientManager from "./clientManager";
|
||||
import {MessageStorage, SearchQuery, SearchResponse} from "./plugins/messageStorage/types";
|
||||
import { StorageCleaner } from "./storageCleaner";
|
||||
|
||||
type OrderItem = Chan["id"] | Network["uuid"];
|
||||
type Order = OrderItem[];
|
||||
@ -139,13 +138,6 @@ class Client {
|
||||
if (!Config.values.public && client.config.log) {
|
||||
if (Config.values.messageStorage.includes("sqlite")) {
|
||||
client.messageProvider = new SqliteMessageStorage(client.name);
|
||||
if (Config.values.storagePolicy.enabled) {
|
||||
log.info(
|
||||
`Activating storage cleaner. Policy: ${Config.values.storagePolicy.deletionPolicy}. MaxAge: ${Config.values.storagePolicy.maxAgeDays} days`
|
||||
);
|
||||
const cleaner = new StorageCleaner(client.messageProvider);
|
||||
cleaner.start();
|
||||
}
|
||||
client.messageStorage.push(client.messageProvider);
|
||||
}
|
||||
|
||||
|
@ -38,7 +38,7 @@ type Rollback = {
|
||||
stmts: string[];
|
||||
};
|
||||
|
||||
export const currentSchemaVersion = 1703322560448; // use `new Date().getTime()`
|
||||
export const currentSchemaVersion = 1679743888000; // use `new Date().getTime()`
|
||||
|
||||
// Desired schema, adapt to the newest version and add migrations to the array below
|
||||
const schema = [
|
||||
@ -57,7 +57,6 @@ const schema = [
|
||||
)`,
|
||||
"CREATE INDEX network_channel ON messages (network, channel)",
|
||||
"CREATE INDEX time ON messages (time)",
|
||||
"CREATE INDEX msg_type_idx on messages (type)",
|
||||
];
|
||||
|
||||
// the migrations will be executed in an exclusive transaction as a whole
|
||||
@ -91,10 +90,6 @@ export const migrations: Migration[] = [
|
||||
)`,
|
||||
],
|
||||
},
|
||||
{
|
||||
version: 1703322560448,
|
||||
stmts: ["CREATE INDEX msg_type_idx on messages (type)"]
|
||||
}
|
||||
];
|
||||
|
||||
// down migrations need to restore the state of the prior version.
|
||||
@ -108,10 +103,6 @@ export const rollbacks: Rollback[] = [
|
||||
version: 1679743888000,
|
||||
stmts: [], // here we can't drop the tables, as we use them in the code, so just leave those in
|
||||
},
|
||||
{
|
||||
version: 1703322560448,
|
||||
stmts: ["drop INDEX msg_type_idx"]
|
||||
}
|
||||
];
|
||||
|
||||
class Deferred {
|
||||
|
@ -2,6 +2,8 @@ color: true
|
||||
check-leaks: true
|
||||
recursive: true
|
||||
reporter: dot
|
||||
interactive: false
|
||||
spec: "test/**/*.ts"
|
||||
ignore: "test/client/**"
|
||||
extension: ["ts", "js"]
|
||||
require:
|
||||
|
Loading…
Reference in New Issue
Block a user