Compare commits
5 Commits
d07f02f4a2
...
v4.1.1
| Author | SHA1 | Date | |
|---|---|---|---|
| 3c34a98e67 | |||
| cb28872652 | |||
| a8c057245a | |||
| d328414186 | |||
| 5b44841cbf |
@@ -1,3 +1,4 @@
|
|||||||
volume/
|
volume/
|
||||||
config/
|
config/
|
||||||
|
distribution/
|
||||||
node_modules
|
node_modules
|
||||||
90
.github/workflows/build-app-image.yml
vendored
Normal file
90
.github/workflows/build-app-image.yml
vendored
Normal file
@@ -0,0 +1,90 @@
|
|||||||
|
name: App Image CI
|
||||||
|
|
||||||
|
on:
|
||||||
|
push:
|
||||||
|
branches:
|
||||||
|
- master
|
||||||
|
tags:
|
||||||
|
- 'v*'
|
||||||
|
pull_request:
|
||||||
|
branches:
|
||||||
|
- master
|
||||||
|
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
build_app_image:
|
||||||
|
name: Build app image
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
env:
|
||||||
|
GH_REGISTRY: ghcr.io
|
||||||
|
IMAGE_NAME: ${{ github.repository }}
|
||||||
|
REPOSITORY: ${{ github.event.repository.name }}
|
||||||
|
permissions:
|
||||||
|
contents: read
|
||||||
|
packages: write
|
||||||
|
|
||||||
|
steps:
|
||||||
|
- name: Checkout
|
||||||
|
uses: actions/checkout@v4
|
||||||
|
|
||||||
|
- name: Set up Docker Buildx
|
||||||
|
id: buildx
|
||||||
|
uses: docker/setup-buildx-action@v3
|
||||||
|
with:
|
||||||
|
install: true
|
||||||
|
|
||||||
|
- name: Login to GitHub Container Registry
|
||||||
|
uses: docker/login-action@v3
|
||||||
|
with:
|
||||||
|
registry: ${{ env.GH_REGISTRY }}
|
||||||
|
username: ${{ github.repository_owner }}
|
||||||
|
password: ${{ secrets.GITHUB_TOKEN }}
|
||||||
|
|
||||||
|
- name: Extract metadata for release Docker image
|
||||||
|
if: startsWith(github.ref, 'refs/tags/v')
|
||||||
|
id: meta
|
||||||
|
uses: docker/metadata-action@v5
|
||||||
|
with:
|
||||||
|
images: |
|
||||||
|
${{ env.GH_REGISTRY }}/${{ env.IMAGE_NAME }}
|
||||||
|
tags: |
|
||||||
|
type=raw,value=latest
|
||||||
|
type=semver,pattern={{version}}
|
||||||
|
type=semver,pattern={{major}}.{{minor}}
|
||||||
|
type=semver,pattern={{major}}
|
||||||
|
|
||||||
|
- name: Extract metadata for develop Docker image
|
||||||
|
if: "!startsWith(github.ref, 'refs/tags/v')"
|
||||||
|
id: meta-develop
|
||||||
|
uses: docker/metadata-action@v5
|
||||||
|
with:
|
||||||
|
images: |
|
||||||
|
${{ env.GH_REGISTRY }}/${{ env.IMAGE_NAME }}
|
||||||
|
tags: |
|
||||||
|
type=ref,event=branch
|
||||||
|
type=ref,event=pr
|
||||||
|
|
||||||
|
- name: Build and push release Docker image
|
||||||
|
if: startsWith(github.ref, 'refs/tags/v')
|
||||||
|
uses: docker/build-push-action@v6
|
||||||
|
with:
|
||||||
|
target: deploy
|
||||||
|
push: true
|
||||||
|
tags: ${{ steps.meta.outputs.tags }}
|
||||||
|
labels: ${{ steps.meta.outputs.labels }}
|
||||||
|
|
||||||
|
platforms: linux/amd64
|
||||||
|
cache-from: type=gha,scope=${{ github.workflow }}
|
||||||
|
cache-to: type=gha,mode=max,scope=${{ github.workflow }}
|
||||||
|
|
||||||
|
- name: Build and push develop Docker image
|
||||||
|
if: "!startsWith(github.ref, 'refs/tags/v')"
|
||||||
|
uses: docker/build-push-action@v6
|
||||||
|
with:
|
||||||
|
target: deploy
|
||||||
|
push: true
|
||||||
|
tags: ${{ steps.meta-develop.outputs.tags }}
|
||||||
|
labels: ${{ steps.meta-develop.outputs.labels }}
|
||||||
|
platforms: linux/amd64
|
||||||
|
cache-from: type=gha,scope=${{ github.workflow }}
|
||||||
|
cache-to: type=gha,mode=max,scope=${{ github.workflow }}
|
||||||
3
.gitignore
vendored
3
.gitignore
vendored
@@ -108,4 +108,5 @@ docker-cache/
|
|||||||
assets/css/
|
assets/css/
|
||||||
assets/js/
|
assets/js/
|
||||||
assets/webp/
|
assets/webp/
|
||||||
config/
|
config/
|
||||||
|
distribution/
|
||||||
|
|||||||
@@ -1,23 +0,0 @@
|
|||||||
image: docker:latest
|
|
||||||
services:
|
|
||||||
- docker:dind
|
|
||||||
|
|
||||||
variables:
|
|
||||||
DOCKER_DRIVER: overlay
|
|
||||||
|
|
||||||
stages:
|
|
||||||
- build
|
|
||||||
- deploy
|
|
||||||
|
|
||||||
artix-packy-pusher:
|
|
||||||
stage: build
|
|
||||||
script:
|
|
||||||
- docker build --pull --no-cache -t "$CI_REGISTRY_IMAGE" .
|
|
||||||
|
|
||||||
deploy:
|
|
||||||
stage: deploy
|
|
||||||
only:
|
|
||||||
- master
|
|
||||||
script:
|
|
||||||
- docker login -u $CI_REGISTRY_USER -p $CI_REGISTRY_PASSWORD $CI_REGISTRY
|
|
||||||
- docker push "$CI_REGISTRY_IMAGE"
|
|
||||||
@@ -6,7 +6,7 @@ FROM baseimg AS build-env
|
|||||||
|
|
||||||
WORKDIR /usr/notifier
|
WORKDIR /usr/notifier
|
||||||
|
|
||||||
RUN pacman -Sy --noconfirm nodejs npm
|
RUN pacman -Sy --noconfirm nodejs npm typescript
|
||||||
|
|
||||||
COPY package*.json ./
|
COPY package*.json ./
|
||||||
|
|
||||||
@@ -14,7 +14,8 @@ RUN npm install
|
|||||||
|
|
||||||
COPY . .
|
COPY . .
|
||||||
|
|
||||||
RUN npm run-script build && \
|
RUN tsc && \
|
||||||
|
npm run-script build && \
|
||||||
npm ci --only=production
|
npm ci --only=production
|
||||||
|
|
||||||
|
|
||||||
@@ -46,6 +47,5 @@ ENV ARTIX_MIRROR="https://mirror.sanin.dev/artix-linux/%s/os/x86_64/"
|
|||||||
ENV ARCH_MIRROR="https://mirror.sanin.dev/arch-linux/%s/os/x86_64/"
|
ENV ARCH_MIRROR="https://mirror.sanin.dev/arch-linux/%s/os/x86_64/"
|
||||||
ENV ARTIX_REPOS="system-goblins,world-goblins,galaxy-goblins,lib32-goblins,system-gremlins,world-gremlins,galaxy-gremlins,lib32-gremlins,system,world,galaxy,lib32"
|
ENV ARTIX_REPOS="system-goblins,world-goblins,galaxy-goblins,lib32-goblins,system-gremlins,world-gremlins,galaxy-gremlins,lib32-gremlins,system,world,galaxy,lib32"
|
||||||
ENV ARCH_REPOS="core-staging,extra-staging,multilib-staging,core-testing,extra-testing,multilib-testing,core,extra,multilib"
|
ENV ARCH_REPOS="core-staging,extra-staging,multilib-staging,core-testing,extra-testing,multilib-testing,core,extra,multilib"
|
||||||
ENV GITEA_TOKEN="CHANGEME"
|
|
||||||
|
|
||||||
CMD [ "node", "index.js"]
|
CMD [ "node", "distribution/index.mjs"]
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
# artix-packy-notifier
|
# artix-checkupdates-web
|
||||||
|
|
||||||
Notification system and web frontend for Artix packages with pending operations. Notifications can be sent via
|
Notification system and web frontend for Artix packages with pending operations. Notifications can be sent via
|
||||||
[Apprise](https://github.com/caronc/apprise/wiki#notification-services) or IRC. Web interface shows all packages with pending operations
|
[Apprise](https://github.com/caronc/apprise/wiki#notification-services) or IRC. Web interface shows all packages with pending operations
|
||||||
@@ -33,12 +33,13 @@ If the channel is intended only for the bot to broadcast, consider setting the c
|
|||||||
|
|
||||||
```
|
```
|
||||||
npm install
|
npm install
|
||||||
node index.js
|
npm exec tsc
|
||||||
|
node distribution/index.mjs
|
||||||
```
|
```
|
||||||
|
|
||||||
## Docker Setup
|
## Docker Setup
|
||||||
|
|
||||||
Image : `registry.gitlab.com/sanin.dev/artix-packy-notifier`
|
Image : `ghcr.io/corysanin/artix-checkupdates-web:latest`
|
||||||
|
|
||||||
mount a folder to `/usr/notifier/config`.
|
mount a folder to `/usr/notifier/config`.
|
||||||
|
|
||||||
|
|||||||
@@ -1,31 +1,29 @@
|
|||||||
/**
|
import fs from 'fs';
|
||||||
* Writing this myself because gulp has a billion garbage dependencies
|
import path from 'path';
|
||||||
* and webpack sucks poop through a straw. Everyone is stupid.
|
import child_process from 'child_process';
|
||||||
*/
|
import uglifyjs from "uglify-js";
|
||||||
const fsp = require('fs').promises;
|
import * as sass from 'sass';
|
||||||
const path = require('path');
|
import * as csso from 'csso';
|
||||||
const spawn = require('child_process').spawn;
|
|
||||||
const sass = require('sass');
|
|
||||||
const csso = require('csso');
|
|
||||||
const uglifyjs = require("uglify-js");
|
|
||||||
|
|
||||||
|
const spawn = child_process.spawn;
|
||||||
|
const fsp = fs.promises;
|
||||||
const STYLESDIR = 'styles';
|
const STYLESDIR = 'styles';
|
||||||
const SCRIPTSDIR = 'scripts';
|
const SCRIPTSDIR = 'scripts';
|
||||||
const IMAGESDIR = path.join('assets', 'images');
|
const IMAGESDIR = path.join('assets', 'images');
|
||||||
const STYLEOUTDIR = process.env.STYLEOUTDIR || path.join(__dirname, 'assets', 'css');
|
const STYLEOUTDIR = process.env.STYLEOUTDIR || path.join('assets', 'css');
|
||||||
const SCRIPTSOUTDIR = process.env.SCRIPTSOUTDIR || path.join(__dirname, 'assets', 'js');
|
const SCRIPTSOUTDIR = process.env.SCRIPTSOUTDIR || path.join('assets', 'js');
|
||||||
const IMAGESOUTDIR = process.env.IMAGESOUTDIR || path.join(__dirname, 'assets', 'webp');
|
const IMAGESOUTDIR = process.env.IMAGESOUTDIR || path.join('assets', 'webp');
|
||||||
const STYLEOUTFILE = process.env.STYLEOUTFILE || 'styles.css';
|
const STYLEOUTFILE = process.env.STYLEOUTFILE || 'styles.css';
|
||||||
const SQUASH = new RegExp('^[0-9]+-');
|
const SQUASH = new RegExp('^[0-9]+-');
|
||||||
|
|
||||||
async function emptyDir(dir) {
|
async function emptyDir(dir: string) {
|
||||||
await Promise.all((await fsp.readdir(dir, { withFileTypes: true })).map(f => path.join(dir, f.name)).map(p => fsp.rm(p, {
|
await Promise.all((await fsp.readdir(dir, { withFileTypes: true })).map(f => path.join(dir, f.name)).map(p => fsp.rm(p, {
|
||||||
recursive: true,
|
recursive: true,
|
||||||
force: true
|
force: true
|
||||||
})));
|
})));
|
||||||
}
|
}
|
||||||
|
|
||||||
async function mkdir(dir) {
|
async function mkdir(dir: string | string[]) {
|
||||||
if (typeof dir === 'string') {
|
if (typeof dir === 'string') {
|
||||||
await fsp.mkdir(dir, { recursive: true });
|
await fsp.mkdir(dir, { recursive: true });
|
||||||
}
|
}
|
||||||
@@ -37,8 +35,8 @@ async function mkdir(dir) {
|
|||||||
// Process styles
|
// Process styles
|
||||||
async function styles() {
|
async function styles() {
|
||||||
await mkdir([STYLEOUTDIR, STYLESDIR]);
|
await mkdir([STYLEOUTDIR, STYLESDIR]);
|
||||||
await await emptyDir(STYLEOUTDIR);
|
await emptyDir(STYLEOUTDIR);
|
||||||
let styles = [];
|
let styles: string[] = [];
|
||||||
let files = await fsp.readdir(STYLESDIR);
|
let files = await fsp.readdir(STYLESDIR);
|
||||||
await Promise.all(files.map(f => new Promise(async (res, reject) => {
|
await Promise.all(files.map(f => new Promise(async (res, reject) => {
|
||||||
let p = path.join(STYLESDIR, f);
|
let p = path.join(STYLESDIR, f);
|
||||||
@@ -110,7 +108,7 @@ async function images(dir = '') {
|
|||||||
clearTimeout(timeout);
|
clearTimeout(timeout);
|
||||||
if (code === 0) {
|
if (code === 0) {
|
||||||
console.log(`Wrote ${outfile}`);
|
console.log(`Wrote ${outfile}`);
|
||||||
res();
|
res(null);
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
reject(code);
|
reject(code);
|
||||||
@@ -124,6 +122,10 @@ async function images(dir = '') {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function isAbortError(err: unknown): boolean {
|
||||||
|
return typeof err === 'object' && err !== null && 'name' in err && err.name === 'AbortError';
|
||||||
|
}
|
||||||
|
|
||||||
(async function () {
|
(async function () {
|
||||||
await Promise.all([styles(), scripts(), images()]);
|
await Promise.all([styles(), scripts(), images()]);
|
||||||
if (process.argv.indexOf('--watch') >= 0) {
|
if (process.argv.indexOf('--watch') >= 0) {
|
||||||
@@ -134,7 +136,7 @@ async function images(dir = '') {
|
|||||||
for await (const _ of watcher)
|
for await (const _ of watcher)
|
||||||
await styles();
|
await styles();
|
||||||
} catch (err) {
|
} catch (err) {
|
||||||
if (err.name === 'AbortError')
|
if (isAbortError(err))
|
||||||
return;
|
return;
|
||||||
throw err;
|
throw err;
|
||||||
}
|
}
|
||||||
@@ -146,7 +148,7 @@ async function images(dir = '') {
|
|||||||
for await (const _ of watcher)
|
for await (const _ of watcher)
|
||||||
await scripts();
|
await scripts();
|
||||||
} catch (err) {
|
} catch (err) {
|
||||||
if (err.name === 'AbortError')
|
if (isAbortError(err))
|
||||||
return;
|
return;
|
||||||
throw err;
|
throw err;
|
||||||
}
|
}
|
||||||
@@ -160,7 +162,7 @@ async function images(dir = '') {
|
|||||||
for await (const _ of watcher)
|
for await (const _ of watcher)
|
||||||
await images();
|
await images();
|
||||||
} catch (err) {
|
} catch (err) {
|
||||||
if (err.name === 'AbortError')
|
if (isAbortError(err))
|
||||||
return;
|
return;
|
||||||
throw err;
|
throw err;
|
||||||
}
|
}
|
||||||
33
index.js
33
index.js
@@ -1,33 +0,0 @@
|
|||||||
const path = require('path');
|
|
||||||
const fs = require('fs');
|
|
||||||
const json5 = require('json5');
|
|
||||||
|
|
||||||
fs.readFile(process.env.CONFIG || path.join(__dirname, 'config', 'config.json'), (err, data) => {
|
|
||||||
if (err) {
|
|
||||||
console.error(err);
|
|
||||||
}
|
|
||||||
else {
|
|
||||||
let config = json5.parse(data);
|
|
||||||
let arg = process.env.COMPONENT || (process.execArgv && process.execArgv[0]);
|
|
||||||
|
|
||||||
if (arg === 'daemon') {
|
|
||||||
const Daemon = require('./daemon');
|
|
||||||
const daemon = new Daemon(config);
|
|
||||||
process.on('SIGTERM', daemon.close);
|
|
||||||
}
|
|
||||||
else if (arg === 'ircbot') {
|
|
||||||
const IRCBot = require('./ircbot');
|
|
||||||
const bot = new IRCBot(config);
|
|
||||||
bot.connect();
|
|
||||||
process.on('SIGTERM', bot.close);
|
|
||||||
}
|
|
||||||
else if (arg === 'web') {
|
|
||||||
const Web = require('./web');
|
|
||||||
const web = new Web(config);
|
|
||||||
process.on('SIGTERM', web.close);
|
|
||||||
}
|
|
||||||
else {
|
|
||||||
console.error('Please pass the component you wish to run.');
|
|
||||||
}
|
|
||||||
}
|
|
||||||
});
|
|
||||||
484
package-lock.json
generated
484
package-lock.json
generated
@@ -1,29 +1,36 @@
|
|||||||
{
|
{
|
||||||
"name": "artix-packy-notifier",
|
"name": "artix-checkupdates-web",
|
||||||
"version": "4.0.7",
|
"version": "4.1.1",
|
||||||
"lockfileVersion": 2,
|
"lockfileVersion": 2,
|
||||||
"requires": true,
|
"requires": true,
|
||||||
"packages": {
|
"packages": {
|
||||||
"": {
|
"": {
|
||||||
"name": "artix-packy-notifier",
|
"name": "artix-checkupdates-web",
|
||||||
"version": "4.0.7",
|
"version": "4.1.1",
|
||||||
"license": "MIT",
|
"license": "MIT",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"better-sqlite3": "11.7.2",
|
"artix-checkupdates": "1.0.2",
|
||||||
|
"better-sqlite3": "11.9.1",
|
||||||
"dayjs": "1.11.13",
|
"dayjs": "1.11.13",
|
||||||
"ejs": "3.1.10",
|
"ejs": "3.1.10",
|
||||||
"express": "4.21.2",
|
"express": "4.21.2",
|
||||||
|
"express-useragent": "1.0.15",
|
||||||
"irc-framework": "4.14.0",
|
"irc-framework": "4.14.0",
|
||||||
"json5": "2.2.3",
|
"json5": "2.2.3",
|
||||||
|
"ky": "1.7.5",
|
||||||
"node-cron": "3.0.3",
|
"node-cron": "3.0.3",
|
||||||
"phin": "3.7.1",
|
|
||||||
"prom-client": "15.1.3",
|
"prom-client": "15.1.3",
|
||||||
"sharp": "0.33.5"
|
"sharp": "0.33.5"
|
||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"csso": "5.0.5",
|
"@sindresorhus/tsconfig": "7.0.0",
|
||||||
"sass": "1.83.1",
|
"@types/better-sqlite3": "^7.6.12",
|
||||||
"uglify-js": "3.19.3"
|
"@types/express": "^5.0.0",
|
||||||
|
"@types/express-useragent": "1.0.5",
|
||||||
|
"@types/node": "22.10.7",
|
||||||
|
"@types/node-cron": "3.0.11",
|
||||||
|
"forking-build-shit": "0.0.2",
|
||||||
|
"typescript": "5.7.3"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"node_modules/@emnapi/runtime": {
|
"node_modules/@emnapi/runtime": {
|
||||||
@@ -706,6 +713,154 @@
|
|||||||
"node": ">=0.10"
|
"node": ">=0.10"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
"node_modules/@sindresorhus/tsconfig": {
|
||||||
|
"version": "7.0.0",
|
||||||
|
"resolved": "https://registry.npmjs.org/@sindresorhus/tsconfig/-/tsconfig-7.0.0.tgz",
|
||||||
|
"integrity": "sha512-i5K04hLAP44Af16zmDjG07E1NHuDgCM07SJAT4gY0LZSRrWYzwt4qkLem6TIbIVh0k51RkN2bF+lP+lM5eC9fw==",
|
||||||
|
"dev": true,
|
||||||
|
"license": "MIT",
|
||||||
|
"engines": {
|
||||||
|
"node": ">=18"
|
||||||
|
},
|
||||||
|
"funding": {
|
||||||
|
"url": "https://github.com/sponsors/sindresorhus"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"node_modules/@types/better-sqlite3": {
|
||||||
|
"version": "7.6.12",
|
||||||
|
"resolved": "https://registry.npmjs.org/@types/better-sqlite3/-/better-sqlite3-7.6.12.tgz",
|
||||||
|
"integrity": "sha512-fnQmj8lELIj7BSrZQAdBMHEHX8OZLYIHXqAKT1O7tDfLxaINzf00PMjw22r3N/xXh0w/sGHlO6SVaCQ2mj78lg==",
|
||||||
|
"dev": true,
|
||||||
|
"license": "MIT",
|
||||||
|
"dependencies": {
|
||||||
|
"@types/node": "*"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"node_modules/@types/body-parser": {
|
||||||
|
"version": "1.19.5",
|
||||||
|
"resolved": "https://registry.npmjs.org/@types/body-parser/-/body-parser-1.19.5.tgz",
|
||||||
|
"integrity": "sha512-fB3Zu92ucau0iQ0JMCFQE7b/dv8Ot07NI3KaZIkIUNXq82k4eBAqUaneXfleGY9JWskeS9y+u0nXMyspcuQrCg==",
|
||||||
|
"dev": true,
|
||||||
|
"license": "MIT",
|
||||||
|
"dependencies": {
|
||||||
|
"@types/connect": "*",
|
||||||
|
"@types/node": "*"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"node_modules/@types/connect": {
|
||||||
|
"version": "3.4.38",
|
||||||
|
"resolved": "https://registry.npmjs.org/@types/connect/-/connect-3.4.38.tgz",
|
||||||
|
"integrity": "sha512-K6uROf1LD88uDQqJCktA4yzL1YYAK6NgfsI0v/mTgyPKWsX1CnJ0XPSDhViejru1GcRkLWb8RlzFYJRqGUbaug==",
|
||||||
|
"dev": true,
|
||||||
|
"license": "MIT",
|
||||||
|
"dependencies": {
|
||||||
|
"@types/node": "*"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"node_modules/@types/express": {
|
||||||
|
"version": "5.0.0",
|
||||||
|
"resolved": "https://registry.npmjs.org/@types/express/-/express-5.0.0.tgz",
|
||||||
|
"integrity": "sha512-DvZriSMehGHL1ZNLzi6MidnsDhUZM/x2pRdDIKdwbUNqqwHxMlRdkxtn6/EPKyqKpHqTl/4nRZsRNLpZxZRpPQ==",
|
||||||
|
"dev": true,
|
||||||
|
"license": "MIT",
|
||||||
|
"dependencies": {
|
||||||
|
"@types/body-parser": "*",
|
||||||
|
"@types/express-serve-static-core": "^5.0.0",
|
||||||
|
"@types/qs": "*",
|
||||||
|
"@types/serve-static": "*"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"node_modules/@types/express-serve-static-core": {
|
||||||
|
"version": "5.0.5",
|
||||||
|
"resolved": "https://registry.npmjs.org/@types/express-serve-static-core/-/express-serve-static-core-5.0.5.tgz",
|
||||||
|
"integrity": "sha512-GLZPrd9ckqEBFMcVM/qRFAP0Hg3qiVEojgEFsx/N/zKXsBzbGF6z5FBDpZ0+Xhp1xr+qRZYjfGr1cWHB9oFHSA==",
|
||||||
|
"dev": true,
|
||||||
|
"license": "MIT",
|
||||||
|
"dependencies": {
|
||||||
|
"@types/node": "*",
|
||||||
|
"@types/qs": "*",
|
||||||
|
"@types/range-parser": "*",
|
||||||
|
"@types/send": "*"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"node_modules/@types/express-useragent": {
|
||||||
|
"version": "1.0.5",
|
||||||
|
"resolved": "https://registry.npmjs.org/@types/express-useragent/-/express-useragent-1.0.5.tgz",
|
||||||
|
"integrity": "sha512-G1zPW6jDj7oGJvMvB8UCIAWznCOafcksYzOg8LINfYmvrXlSGJ6nsJ7O7GlmYMjrgGYvobYaI8IhRCkAKslPJA==",
|
||||||
|
"dev": true,
|
||||||
|
"license": "MIT",
|
||||||
|
"dependencies": {
|
||||||
|
"@types/express": "*"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"node_modules/@types/http-errors": {
|
||||||
|
"version": "2.0.4",
|
||||||
|
"resolved": "https://registry.npmjs.org/@types/http-errors/-/http-errors-2.0.4.tgz",
|
||||||
|
"integrity": "sha512-D0CFMMtydbJAegzOyHjtiKPLlvnm3iTZyZRSZoLq2mRhDdmLfIWOCYPfQJ4cu2erKghU++QvjcUjp/5h7hESpA==",
|
||||||
|
"dev": true,
|
||||||
|
"license": "MIT"
|
||||||
|
},
|
||||||
|
"node_modules/@types/mime": {
|
||||||
|
"version": "1.3.5",
|
||||||
|
"resolved": "https://registry.npmjs.org/@types/mime/-/mime-1.3.5.tgz",
|
||||||
|
"integrity": "sha512-/pyBZWSLD2n0dcHE3hq8s8ZvcETHtEuF+3E7XVt0Ig2nvsVQXdghHVcEkIWjy9A0wKfTn97a/PSDYohKIlnP/w==",
|
||||||
|
"dev": true,
|
||||||
|
"license": "MIT"
|
||||||
|
},
|
||||||
|
"node_modules/@types/node": {
|
||||||
|
"version": "22.10.7",
|
||||||
|
"resolved": "https://registry.npmjs.org/@types/node/-/node-22.10.7.tgz",
|
||||||
|
"integrity": "sha512-V09KvXxFiutGp6B7XkpaDXlNadZxrzajcY50EuoLIpQ6WWYCSvf19lVIazzfIzQvhUN2HjX12spLojTnhuKlGg==",
|
||||||
|
"dev": true,
|
||||||
|
"license": "MIT",
|
||||||
|
"dependencies": {
|
||||||
|
"undici-types": "~6.20.0"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"node_modules/@types/node-cron": {
|
||||||
|
"version": "3.0.11",
|
||||||
|
"resolved": "https://registry.npmjs.org/@types/node-cron/-/node-cron-3.0.11.tgz",
|
||||||
|
"integrity": "sha512-0ikrnug3/IyneSHqCBeslAhlK2aBfYek1fGo4bP4QnZPmiqSGRK+Oy7ZMisLWkesffJvQ1cqAcBnJC+8+nxIAg==",
|
||||||
|
"dev": true,
|
||||||
|
"license": "MIT"
|
||||||
|
},
|
||||||
|
"node_modules/@types/qs": {
|
||||||
|
"version": "6.9.18",
|
||||||
|
"resolved": "https://registry.npmjs.org/@types/qs/-/qs-6.9.18.tgz",
|
||||||
|
"integrity": "sha512-kK7dgTYDyGqS+e2Q4aK9X3D7q234CIZ1Bv0q/7Z5IwRDoADNU81xXJK/YVyLbLTZCoIwUoDoffFeF+p/eIklAA==",
|
||||||
|
"dev": true,
|
||||||
|
"license": "MIT"
|
||||||
|
},
|
||||||
|
"node_modules/@types/range-parser": {
|
||||||
|
"version": "1.2.7",
|
||||||
|
"resolved": "https://registry.npmjs.org/@types/range-parser/-/range-parser-1.2.7.tgz",
|
||||||
|
"integrity": "sha512-hKormJbkJqzQGhziax5PItDUTMAM9uE2XXQmM37dyd4hVM+5aVl7oVxMVUiVQn2oCQFN/LKCZdvSM0pFRqbSmQ==",
|
||||||
|
"dev": true,
|
||||||
|
"license": "MIT"
|
||||||
|
},
|
||||||
|
"node_modules/@types/send": {
|
||||||
|
"version": "0.17.4",
|
||||||
|
"resolved": "https://registry.npmjs.org/@types/send/-/send-0.17.4.tgz",
|
||||||
|
"integrity": "sha512-x2EM6TJOybec7c52BX0ZspPodMsQUd5L6PRwOunVyVUhXiBSKf3AezDL8Dgvgt5o0UfKNfuA0eMLr2wLT4AiBA==",
|
||||||
|
"dev": true,
|
||||||
|
"license": "MIT",
|
||||||
|
"dependencies": {
|
||||||
|
"@types/mime": "^1",
|
||||||
|
"@types/node": "*"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"node_modules/@types/serve-static": {
|
||||||
|
"version": "1.15.7",
|
||||||
|
"resolved": "https://registry.npmjs.org/@types/serve-static/-/serve-static-1.15.7.tgz",
|
||||||
|
"integrity": "sha512-W8Ym+h8nhuRwaKPaDw34QUkwsGi6Rc4yYqvKFo5rm2FUEhCFbzVWrxXUxuKK8TASjWsysJY0nsmNCGhCOIsrOw==",
|
||||||
|
"dev": true,
|
||||||
|
"license": "MIT",
|
||||||
|
"dependencies": {
|
||||||
|
"@types/http-errors": "*",
|
||||||
|
"@types/node": "*",
|
||||||
|
"@types/send": "*"
|
||||||
|
}
|
||||||
|
},
|
||||||
"node_modules/accepts": {
|
"node_modules/accepts": {
|
||||||
"version": "1.3.8",
|
"version": "1.3.8",
|
||||||
"resolved": "https://registry.npmjs.org/accepts/-/accepts-1.3.8.tgz",
|
"resolved": "https://registry.npmjs.org/accepts/-/accepts-1.3.8.tgz",
|
||||||
@@ -737,6 +892,12 @@
|
|||||||
"resolved": "https://registry.npmjs.org/array-flatten/-/array-flatten-1.1.1.tgz",
|
"resolved": "https://registry.npmjs.org/array-flatten/-/array-flatten-1.1.1.tgz",
|
||||||
"integrity": "sha512-PCVAQswWemu6UdxsDFFX/+gVeYqKAod3D3UVm91jHwynguOwAvYPhx8nNlM++NqRcK6CxxpUafjmhIdKiHibqg=="
|
"integrity": "sha512-PCVAQswWemu6UdxsDFFX/+gVeYqKAod3D3UVm91jHwynguOwAvYPhx8nNlM++NqRcK6CxxpUafjmhIdKiHibqg=="
|
||||||
},
|
},
|
||||||
|
"node_modules/artix-checkupdates": {
|
||||||
|
"version": "1.0.2",
|
||||||
|
"resolved": "https://registry.npmjs.org/artix-checkupdates/-/artix-checkupdates-1.0.2.tgz",
|
||||||
|
"integrity": "sha512-VTLeMVysGeZ3QiLtEyWoVM8D57YyeYhYQoL3vcW9b0dZE+zhE4di80PYEFGeQzIBcCStcBFnI1uSBoAEHMVHAQ==",
|
||||||
|
"license": "MIT"
|
||||||
|
},
|
||||||
"node_modules/async": {
|
"node_modules/async": {
|
||||||
"version": "3.2.5",
|
"version": "3.2.5",
|
||||||
"resolved": "https://registry.npmjs.org/async/-/async-3.2.5.tgz",
|
"resolved": "https://registry.npmjs.org/async/-/async-3.2.5.tgz",
|
||||||
@@ -778,9 +939,9 @@
|
|||||||
]
|
]
|
||||||
},
|
},
|
||||||
"node_modules/better-sqlite3": {
|
"node_modules/better-sqlite3": {
|
||||||
"version": "11.7.2",
|
"version": "11.9.1",
|
||||||
"resolved": "https://registry.npmjs.org/better-sqlite3/-/better-sqlite3-11.7.2.tgz",
|
"resolved": "https://registry.npmjs.org/better-sqlite3/-/better-sqlite3-11.9.1.tgz",
|
||||||
"integrity": "sha512-10a57cHVDmfNQS4jrZ9AH2t+2ekzYh5Rhbcnb4ytpmYweoLdogDmyTt5D+hLiY9b44Mx9foowb/4iXBTO2yP3Q==",
|
"integrity": "sha512-Ba0KR+Fzxh2jDRhdg6TSH0SJGzb8C0aBY4hR8w8madIdIzzC6Y1+kx5qR6eS1Z+Gy20h6ZU28aeyg0z1VIrShQ==",
|
||||||
"hasInstallScript": true,
|
"hasInstallScript": true,
|
||||||
"license": "MIT",
|
"license": "MIT",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
@@ -908,14 +1069,6 @@
|
|||||||
"url": "https://github.com/sponsors/ljharb"
|
"url": "https://github.com/sponsors/ljharb"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"node_modules/centra": {
|
|
||||||
"version": "2.7.0",
|
|
||||||
"resolved": "https://registry.npmjs.org/centra/-/centra-2.7.0.tgz",
|
|
||||||
"integrity": "sha512-PbFMgMSrmgx6uxCdm57RUos9Tc3fclMvhLSATYN39XsDV29B89zZ3KA89jmY0vwSGazyU+uerqwa6t+KaodPcg==",
|
|
||||||
"dependencies": {
|
|
||||||
"follow-redirects": "^1.15.6"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"node_modules/chalk": {
|
"node_modules/chalk": {
|
||||||
"version": "4.1.2",
|
"version": "4.1.2",
|
||||||
"resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.2.tgz",
|
"resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.2.tgz",
|
||||||
@@ -1274,6 +1427,15 @@
|
|||||||
"url": "https://opencollective.com/express"
|
"url": "https://opencollective.com/express"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
"node_modules/express-useragent": {
|
||||||
|
"version": "1.0.15",
|
||||||
|
"resolved": "https://registry.npmjs.org/express-useragent/-/express-useragent-1.0.15.tgz",
|
||||||
|
"integrity": "sha512-eq5xMiYCYwFPoekffMjvEIk+NWdlQY9Y38OsTyl13IvA728vKT+q/CSERYWzcw93HGBJcIqMIsZC5CZGARPVdg==",
|
||||||
|
"license": "MIT",
|
||||||
|
"engines": {
|
||||||
|
"node": ">=4.5"
|
||||||
|
}
|
||||||
|
},
|
||||||
"node_modules/fast-text-encoding": {
|
"node_modules/fast-text-encoding": {
|
||||||
"version": "1.0.6",
|
"version": "1.0.6",
|
||||||
"resolved": "https://registry.npmjs.org/fast-text-encoding/-/fast-text-encoding-1.0.6.tgz",
|
"resolved": "https://registry.npmjs.org/fast-text-encoding/-/fast-text-encoding-1.0.6.tgz",
|
||||||
@@ -1343,25 +1505,6 @@
|
|||||||
"node": ">= 0.8"
|
"node": ">= 0.8"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"node_modules/follow-redirects": {
|
|
||||||
"version": "1.15.6",
|
|
||||||
"resolved": "https://registry.npmjs.org/follow-redirects/-/follow-redirects-1.15.6.tgz",
|
|
||||||
"integrity": "sha512-wWN62YITEaOpSK584EZXJafH1AGpO8RVgElfkuXbTOrPX4fIfOyEpW/CsiNd8JdYrAoOvafRTOEnvsO++qCqFA==",
|
|
||||||
"funding": [
|
|
||||||
{
|
|
||||||
"type": "individual",
|
|
||||||
"url": "https://github.com/sponsors/RubenVerborgh"
|
|
||||||
}
|
|
||||||
],
|
|
||||||
"engines": {
|
|
||||||
"node": ">=4.0"
|
|
||||||
},
|
|
||||||
"peerDependenciesMeta": {
|
|
||||||
"debug": {
|
|
||||||
"optional": true
|
|
||||||
}
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"node_modules/for-each": {
|
"node_modules/for-each": {
|
||||||
"version": "0.3.3",
|
"version": "0.3.3",
|
||||||
"resolved": "https://registry.npmjs.org/for-each/-/for-each-0.3.3.tgz",
|
"resolved": "https://registry.npmjs.org/for-each/-/for-each-0.3.3.tgz",
|
||||||
@@ -1370,6 +1513,21 @@
|
|||||||
"is-callable": "^1.1.3"
|
"is-callable": "^1.1.3"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
"node_modules/forking-build-shit": {
|
||||||
|
"version": "0.0.2",
|
||||||
|
"resolved": "https://registry.npmjs.org/forking-build-shit/-/forking-build-shit-0.0.2.tgz",
|
||||||
|
"integrity": "sha512-1qpXIK3nX8ZPTbwojsqxjTp5qDITX24MkKaX/8p6mMkIAQiVul1nhdYCAFLpnpnLon87Ru1exlJKhkvIKT7b+A==",
|
||||||
|
"dev": true,
|
||||||
|
"license": "MIT",
|
||||||
|
"dependencies": {
|
||||||
|
"csso": "5.0.5",
|
||||||
|
"sass": "1.86.0",
|
||||||
|
"uglify-js": "3.19.3"
|
||||||
|
},
|
||||||
|
"bin": {
|
||||||
|
"build-shit": "bin/build-shit.js"
|
||||||
|
}
|
||||||
|
},
|
||||||
"node_modules/forwarded": {
|
"node_modules/forwarded": {
|
||||||
"version": "0.2.0",
|
"version": "0.2.0",
|
||||||
"resolved": "https://registry.npmjs.org/forwarded/-/forwarded-0.2.0.tgz",
|
"resolved": "https://registry.npmjs.org/forwarded/-/forwarded-0.2.0.tgz",
|
||||||
@@ -1781,6 +1939,18 @@
|
|||||||
"node": ">=6"
|
"node": ">=6"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
"node_modules/ky": {
|
||||||
|
"version": "1.7.5",
|
||||||
|
"resolved": "https://registry.npmjs.org/ky/-/ky-1.7.5.tgz",
|
||||||
|
"integrity": "sha512-HzhziW6sc5m0pwi5M196+7cEBtbt0lCYi67wNsiwMUmz833wloE0gbzJPWKs1gliFKQb34huItDQX97LyOdPdA==",
|
||||||
|
"license": "MIT",
|
||||||
|
"engines": {
|
||||||
|
"node": ">=18"
|
||||||
|
},
|
||||||
|
"funding": {
|
||||||
|
"url": "https://github.com/sindresorhus/ky?sponsor=1"
|
||||||
|
}
|
||||||
|
},
|
||||||
"node_modules/lodash": {
|
"node_modules/lodash": {
|
||||||
"version": "4.17.21",
|
"version": "4.17.21",
|
||||||
"resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.21.tgz",
|
"resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.21.tgz",
|
||||||
@@ -2000,17 +2170,6 @@
|
|||||||
"integrity": "sha512-RA1GjUVMnvYFxuqovrEqZoxxW5NUZqbwKtYz/Tt7nXerk0LbLblQmrsgdeOxV5SFHf0UDggjS/bSeOZwt1pmEQ==",
|
"integrity": "sha512-RA1GjUVMnvYFxuqovrEqZoxxW5NUZqbwKtYz/Tt7nXerk0LbLblQmrsgdeOxV5SFHf0UDggjS/bSeOZwt1pmEQ==",
|
||||||
"license": "MIT"
|
"license": "MIT"
|
||||||
},
|
},
|
||||||
"node_modules/phin": {
|
|
||||||
"version": "3.7.1",
|
|
||||||
"resolved": "https://registry.npmjs.org/phin/-/phin-3.7.1.tgz",
|
|
||||||
"integrity": "sha512-GEazpTWwTZaEQ9RhL7Nyz0WwqilbqgLahDM3D0hxWwmVDI52nXEybHqiN6/elwpkJBhcuj+WbBu+QfT0uhPGfQ==",
|
|
||||||
"dependencies": {
|
|
||||||
"centra": "^2.7.0"
|
|
||||||
},
|
|
||||||
"engines": {
|
|
||||||
"node": ">= 8"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"node_modules/picomatch": {
|
"node_modules/picomatch": {
|
||||||
"version": "2.3.1",
|
"version": "2.3.1",
|
||||||
"resolved": "https://registry.npmjs.org/picomatch/-/picomatch-2.3.1.tgz",
|
"resolved": "https://registry.npmjs.org/picomatch/-/picomatch-2.3.1.tgz",
|
||||||
@@ -2195,9 +2354,9 @@
|
|||||||
"integrity": "sha512-YZo3K82SD7Riyi0E1EQPojLz7kpepnSQI9IyPbHHg1XXXevb5dJI7tpyN2ADxGcQbHG7vcyRHk0cbwqcQriUtg=="
|
"integrity": "sha512-YZo3K82SD7Riyi0E1EQPojLz7kpepnSQI9IyPbHHg1XXXevb5dJI7tpyN2ADxGcQbHG7vcyRHk0cbwqcQriUtg=="
|
||||||
},
|
},
|
||||||
"node_modules/sass": {
|
"node_modules/sass": {
|
||||||
"version": "1.83.1",
|
"version": "1.86.0",
|
||||||
"resolved": "https://registry.npmjs.org/sass/-/sass-1.83.1.tgz",
|
"resolved": "https://registry.npmjs.org/sass/-/sass-1.86.0.tgz",
|
||||||
"integrity": "sha512-EVJbDaEs4Rr3F0glJzFSOvtg2/oy2V/YrGFPqPY24UqcLDWcI9ZY5sN+qyO3c/QCZwzgfirvhXvINiJCE/OLcA==",
|
"integrity": "sha512-zV8vGUld/+mP4KbMLJMX7TyGCuUp7hnkOScgCMsWuHtns8CWBoz+vmEhoGMXsaJrbUP8gj+F1dLvVe79sK8UdA==",
|
||||||
"dev": true,
|
"dev": true,
|
||||||
"license": "MIT",
|
"license": "MIT",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
@@ -2583,6 +2742,20 @@
|
|||||||
"node": ">= 0.6"
|
"node": ">= 0.6"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
"node_modules/typescript": {
|
||||||
|
"version": "5.7.3",
|
||||||
|
"resolved": "https://registry.npmjs.org/typescript/-/typescript-5.7.3.tgz",
|
||||||
|
"integrity": "sha512-84MVSjMEHP+FQRPy3pX9sTVV/INIex71s9TL2Gm5FG/WG1SqXeKyZ0k7/blY/4FdOzI12CBy1vGc4og/eus0fw==",
|
||||||
|
"dev": true,
|
||||||
|
"license": "Apache-2.0",
|
||||||
|
"bin": {
|
||||||
|
"tsc": "bin/tsc",
|
||||||
|
"tsserver": "bin/tsserver"
|
||||||
|
},
|
||||||
|
"engines": {
|
||||||
|
"node": ">=14.17"
|
||||||
|
}
|
||||||
|
},
|
||||||
"node_modules/uglify-js": {
|
"node_modules/uglify-js": {
|
||||||
"version": "3.19.3",
|
"version": "3.19.3",
|
||||||
"resolved": "https://registry.npmjs.org/uglify-js/-/uglify-js-3.19.3.tgz",
|
"resolved": "https://registry.npmjs.org/uglify-js/-/uglify-js-3.19.3.tgz",
|
||||||
@@ -2596,6 +2769,13 @@
|
|||||||
"node": ">=0.8.0"
|
"node": ">=0.8.0"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
"node_modules/undici-types": {
|
||||||
|
"version": "6.20.0",
|
||||||
|
"resolved": "https://registry.npmjs.org/undici-types/-/undici-types-6.20.0.tgz",
|
||||||
|
"integrity": "sha512-Ny6QZ2Nju20vw1SRHe3d9jVu6gJ+4e3+MMpqu7pqE5HT6WsTSlce++GQmK5UXS8mzV8DSYHrQH+Xrf2jVcuKNg==",
|
||||||
|
"dev": true,
|
||||||
|
"license": "MIT"
|
||||||
|
},
|
||||||
"node_modules/unpipe": {
|
"node_modules/unpipe": {
|
||||||
"version": "1.0.0",
|
"version": "1.0.0",
|
||||||
"resolved": "https://registry.npmjs.org/unpipe/-/unpipe-1.0.0.tgz",
|
"resolved": "https://registry.npmjs.org/unpipe/-/unpipe-1.0.0.tgz",
|
||||||
@@ -2944,6 +3124,133 @@
|
|||||||
"dev": true,
|
"dev": true,
|
||||||
"optional": true
|
"optional": true
|
||||||
},
|
},
|
||||||
|
"@sindresorhus/tsconfig": {
|
||||||
|
"version": "7.0.0",
|
||||||
|
"resolved": "https://registry.npmjs.org/@sindresorhus/tsconfig/-/tsconfig-7.0.0.tgz",
|
||||||
|
"integrity": "sha512-i5K04hLAP44Af16zmDjG07E1NHuDgCM07SJAT4gY0LZSRrWYzwt4qkLem6TIbIVh0k51RkN2bF+lP+lM5eC9fw==",
|
||||||
|
"dev": true
|
||||||
|
},
|
||||||
|
"@types/better-sqlite3": {
|
||||||
|
"version": "7.6.12",
|
||||||
|
"resolved": "https://registry.npmjs.org/@types/better-sqlite3/-/better-sqlite3-7.6.12.tgz",
|
||||||
|
"integrity": "sha512-fnQmj8lELIj7BSrZQAdBMHEHX8OZLYIHXqAKT1O7tDfLxaINzf00PMjw22r3N/xXh0w/sGHlO6SVaCQ2mj78lg==",
|
||||||
|
"dev": true,
|
||||||
|
"requires": {
|
||||||
|
"@types/node": "*"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"@types/body-parser": {
|
||||||
|
"version": "1.19.5",
|
||||||
|
"resolved": "https://registry.npmjs.org/@types/body-parser/-/body-parser-1.19.5.tgz",
|
||||||
|
"integrity": "sha512-fB3Zu92ucau0iQ0JMCFQE7b/dv8Ot07NI3KaZIkIUNXq82k4eBAqUaneXfleGY9JWskeS9y+u0nXMyspcuQrCg==",
|
||||||
|
"dev": true,
|
||||||
|
"requires": {
|
||||||
|
"@types/connect": "*",
|
||||||
|
"@types/node": "*"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"@types/connect": {
|
||||||
|
"version": "3.4.38",
|
||||||
|
"resolved": "https://registry.npmjs.org/@types/connect/-/connect-3.4.38.tgz",
|
||||||
|
"integrity": "sha512-K6uROf1LD88uDQqJCktA4yzL1YYAK6NgfsI0v/mTgyPKWsX1CnJ0XPSDhViejru1GcRkLWb8RlzFYJRqGUbaug==",
|
||||||
|
"dev": true,
|
||||||
|
"requires": {
|
||||||
|
"@types/node": "*"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"@types/express": {
|
||||||
|
"version": "5.0.0",
|
||||||
|
"resolved": "https://registry.npmjs.org/@types/express/-/express-5.0.0.tgz",
|
||||||
|
"integrity": "sha512-DvZriSMehGHL1ZNLzi6MidnsDhUZM/x2pRdDIKdwbUNqqwHxMlRdkxtn6/EPKyqKpHqTl/4nRZsRNLpZxZRpPQ==",
|
||||||
|
"dev": true,
|
||||||
|
"requires": {
|
||||||
|
"@types/body-parser": "*",
|
||||||
|
"@types/express-serve-static-core": "^5.0.0",
|
||||||
|
"@types/qs": "*",
|
||||||
|
"@types/serve-static": "*"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"@types/express-serve-static-core": {
|
||||||
|
"version": "5.0.5",
|
||||||
|
"resolved": "https://registry.npmjs.org/@types/express-serve-static-core/-/express-serve-static-core-5.0.5.tgz",
|
||||||
|
"integrity": "sha512-GLZPrd9ckqEBFMcVM/qRFAP0Hg3qiVEojgEFsx/N/zKXsBzbGF6z5FBDpZ0+Xhp1xr+qRZYjfGr1cWHB9oFHSA==",
|
||||||
|
"dev": true,
|
||||||
|
"requires": {
|
||||||
|
"@types/node": "*",
|
||||||
|
"@types/qs": "*",
|
||||||
|
"@types/range-parser": "*",
|
||||||
|
"@types/send": "*"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"@types/express-useragent": {
|
||||||
|
"version": "1.0.5",
|
||||||
|
"resolved": "https://registry.npmjs.org/@types/express-useragent/-/express-useragent-1.0.5.tgz",
|
||||||
|
"integrity": "sha512-G1zPW6jDj7oGJvMvB8UCIAWznCOafcksYzOg8LINfYmvrXlSGJ6nsJ7O7GlmYMjrgGYvobYaI8IhRCkAKslPJA==",
|
||||||
|
"dev": true,
|
||||||
|
"requires": {
|
||||||
|
"@types/express": "*"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"@types/http-errors": {
|
||||||
|
"version": "2.0.4",
|
||||||
|
"resolved": "https://registry.npmjs.org/@types/http-errors/-/http-errors-2.0.4.tgz",
|
||||||
|
"integrity": "sha512-D0CFMMtydbJAegzOyHjtiKPLlvnm3iTZyZRSZoLq2mRhDdmLfIWOCYPfQJ4cu2erKghU++QvjcUjp/5h7hESpA==",
|
||||||
|
"dev": true
|
||||||
|
},
|
||||||
|
"@types/mime": {
|
||||||
|
"version": "1.3.5",
|
||||||
|
"resolved": "https://registry.npmjs.org/@types/mime/-/mime-1.3.5.tgz",
|
||||||
|
"integrity": "sha512-/pyBZWSLD2n0dcHE3hq8s8ZvcETHtEuF+3E7XVt0Ig2nvsVQXdghHVcEkIWjy9A0wKfTn97a/PSDYohKIlnP/w==",
|
||||||
|
"dev": true
|
||||||
|
},
|
||||||
|
"@types/node": {
|
||||||
|
"version": "22.10.7",
|
||||||
|
"resolved": "https://registry.npmjs.org/@types/node/-/node-22.10.7.tgz",
|
||||||
|
"integrity": "sha512-V09KvXxFiutGp6B7XkpaDXlNadZxrzajcY50EuoLIpQ6WWYCSvf19lVIazzfIzQvhUN2HjX12spLojTnhuKlGg==",
|
||||||
|
"dev": true,
|
||||||
|
"requires": {
|
||||||
|
"undici-types": "~6.20.0"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"@types/node-cron": {
|
||||||
|
"version": "3.0.11",
|
||||||
|
"resolved": "https://registry.npmjs.org/@types/node-cron/-/node-cron-3.0.11.tgz",
|
||||||
|
"integrity": "sha512-0ikrnug3/IyneSHqCBeslAhlK2aBfYek1fGo4bP4QnZPmiqSGRK+Oy7ZMisLWkesffJvQ1cqAcBnJC+8+nxIAg==",
|
||||||
|
"dev": true
|
||||||
|
},
|
||||||
|
"@types/qs": {
|
||||||
|
"version": "6.9.18",
|
||||||
|
"resolved": "https://registry.npmjs.org/@types/qs/-/qs-6.9.18.tgz",
|
||||||
|
"integrity": "sha512-kK7dgTYDyGqS+e2Q4aK9X3D7q234CIZ1Bv0q/7Z5IwRDoADNU81xXJK/YVyLbLTZCoIwUoDoffFeF+p/eIklAA==",
|
||||||
|
"dev": true
|
||||||
|
},
|
||||||
|
"@types/range-parser": {
|
||||||
|
"version": "1.2.7",
|
||||||
|
"resolved": "https://registry.npmjs.org/@types/range-parser/-/range-parser-1.2.7.tgz",
|
||||||
|
"integrity": "sha512-hKormJbkJqzQGhziax5PItDUTMAM9uE2XXQmM37dyd4hVM+5aVl7oVxMVUiVQn2oCQFN/LKCZdvSM0pFRqbSmQ==",
|
||||||
|
"dev": true
|
||||||
|
},
|
||||||
|
"@types/send": {
|
||||||
|
"version": "0.17.4",
|
||||||
|
"resolved": "https://registry.npmjs.org/@types/send/-/send-0.17.4.tgz",
|
||||||
|
"integrity": "sha512-x2EM6TJOybec7c52BX0ZspPodMsQUd5L6PRwOunVyVUhXiBSKf3AezDL8Dgvgt5o0UfKNfuA0eMLr2wLT4AiBA==",
|
||||||
|
"dev": true,
|
||||||
|
"requires": {
|
||||||
|
"@types/mime": "^1",
|
||||||
|
"@types/node": "*"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"@types/serve-static": {
|
||||||
|
"version": "1.15.7",
|
||||||
|
"resolved": "https://registry.npmjs.org/@types/serve-static/-/serve-static-1.15.7.tgz",
|
||||||
|
"integrity": "sha512-W8Ym+h8nhuRwaKPaDw34QUkwsGi6Rc4yYqvKFo5rm2FUEhCFbzVWrxXUxuKK8TASjWsysJY0nsmNCGhCOIsrOw==",
|
||||||
|
"dev": true,
|
||||||
|
"requires": {
|
||||||
|
"@types/http-errors": "*",
|
||||||
|
"@types/node": "*",
|
||||||
|
"@types/send": "*"
|
||||||
|
}
|
||||||
|
},
|
||||||
"accepts": {
|
"accepts": {
|
||||||
"version": "1.3.8",
|
"version": "1.3.8",
|
||||||
"resolved": "https://registry.npmjs.org/accepts/-/accepts-1.3.8.tgz",
|
"resolved": "https://registry.npmjs.org/accepts/-/accepts-1.3.8.tgz",
|
||||||
@@ -2966,6 +3273,11 @@
|
|||||||
"resolved": "https://registry.npmjs.org/array-flatten/-/array-flatten-1.1.1.tgz",
|
"resolved": "https://registry.npmjs.org/array-flatten/-/array-flatten-1.1.1.tgz",
|
||||||
"integrity": "sha512-PCVAQswWemu6UdxsDFFX/+gVeYqKAod3D3UVm91jHwynguOwAvYPhx8nNlM++NqRcK6CxxpUafjmhIdKiHibqg=="
|
"integrity": "sha512-PCVAQswWemu6UdxsDFFX/+gVeYqKAod3D3UVm91jHwynguOwAvYPhx8nNlM++NqRcK6CxxpUafjmhIdKiHibqg=="
|
||||||
},
|
},
|
||||||
|
"artix-checkupdates": {
|
||||||
|
"version": "1.0.2",
|
||||||
|
"resolved": "https://registry.npmjs.org/artix-checkupdates/-/artix-checkupdates-1.0.2.tgz",
|
||||||
|
"integrity": "sha512-VTLeMVysGeZ3QiLtEyWoVM8D57YyeYhYQoL3vcW9b0dZE+zhE4di80PYEFGeQzIBcCStcBFnI1uSBoAEHMVHAQ=="
|
||||||
|
},
|
||||||
"async": {
|
"async": {
|
||||||
"version": "3.2.5",
|
"version": "3.2.5",
|
||||||
"resolved": "https://registry.npmjs.org/async/-/async-3.2.5.tgz",
|
"resolved": "https://registry.npmjs.org/async/-/async-3.2.5.tgz",
|
||||||
@@ -2987,9 +3299,9 @@
|
|||||||
"integrity": "sha512-AKpaYlHn8t4SVbOHCy+b5+KKgvR4vrsD8vbvrbiQJps7fKDTkjkDry6ji0rUJjC0kzbNePLwzxq8iypo41qeWA=="
|
"integrity": "sha512-AKpaYlHn8t4SVbOHCy+b5+KKgvR4vrsD8vbvrbiQJps7fKDTkjkDry6ji0rUJjC0kzbNePLwzxq8iypo41qeWA=="
|
||||||
},
|
},
|
||||||
"better-sqlite3": {
|
"better-sqlite3": {
|
||||||
"version": "11.7.2",
|
"version": "11.9.1",
|
||||||
"resolved": "https://registry.npmjs.org/better-sqlite3/-/better-sqlite3-11.7.2.tgz",
|
"resolved": "https://registry.npmjs.org/better-sqlite3/-/better-sqlite3-11.9.1.tgz",
|
||||||
"integrity": "sha512-10a57cHVDmfNQS4jrZ9AH2t+2ekzYh5Rhbcnb4ytpmYweoLdogDmyTt5D+hLiY9b44Mx9foowb/4iXBTO2yP3Q==",
|
"integrity": "sha512-Ba0KR+Fzxh2jDRhdg6TSH0SJGzb8C0aBY4hR8w8madIdIzzC6Y1+kx5qR6eS1Z+Gy20h6ZU28aeyg0z1VIrShQ==",
|
||||||
"requires": {
|
"requires": {
|
||||||
"bindings": "^1.5.0",
|
"bindings": "^1.5.0",
|
||||||
"prebuild-install": "^7.1.1"
|
"prebuild-install": "^7.1.1"
|
||||||
@@ -3082,14 +3394,6 @@
|
|||||||
"set-function-length": "^1.2.1"
|
"set-function-length": "^1.2.1"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"centra": {
|
|
||||||
"version": "2.7.0",
|
|
||||||
"resolved": "https://registry.npmjs.org/centra/-/centra-2.7.0.tgz",
|
|
||||||
"integrity": "sha512-PbFMgMSrmgx6uxCdm57RUos9Tc3fclMvhLSATYN39XsDV29B89zZ3KA89jmY0vwSGazyU+uerqwa6t+KaodPcg==",
|
|
||||||
"requires": {
|
|
||||||
"follow-redirects": "^1.15.6"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"chalk": {
|
"chalk": {
|
||||||
"version": "4.1.2",
|
"version": "4.1.2",
|
||||||
"resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.2.tgz",
|
"resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.2.tgz",
|
||||||
@@ -3345,6 +3649,11 @@
|
|||||||
"vary": "~1.1.2"
|
"vary": "~1.1.2"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
"express-useragent": {
|
||||||
|
"version": "1.0.15",
|
||||||
|
"resolved": "https://registry.npmjs.org/express-useragent/-/express-useragent-1.0.15.tgz",
|
||||||
|
"integrity": "sha512-eq5xMiYCYwFPoekffMjvEIk+NWdlQY9Y38OsTyl13IvA728vKT+q/CSERYWzcw93HGBJcIqMIsZC5CZGARPVdg=="
|
||||||
|
},
|
||||||
"fast-text-encoding": {
|
"fast-text-encoding": {
|
||||||
"version": "1.0.6",
|
"version": "1.0.6",
|
||||||
"resolved": "https://registry.npmjs.org/fast-text-encoding/-/fast-text-encoding-1.0.6.tgz",
|
"resolved": "https://registry.npmjs.org/fast-text-encoding/-/fast-text-encoding-1.0.6.tgz",
|
||||||
@@ -3405,11 +3714,6 @@
|
|||||||
"unpipe": "~1.0.0"
|
"unpipe": "~1.0.0"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"follow-redirects": {
|
|
||||||
"version": "1.15.6",
|
|
||||||
"resolved": "https://registry.npmjs.org/follow-redirects/-/follow-redirects-1.15.6.tgz",
|
|
||||||
"integrity": "sha512-wWN62YITEaOpSK584EZXJafH1AGpO8RVgElfkuXbTOrPX4fIfOyEpW/CsiNd8JdYrAoOvafRTOEnvsO++qCqFA=="
|
|
||||||
},
|
|
||||||
"for-each": {
|
"for-each": {
|
||||||
"version": "0.3.3",
|
"version": "0.3.3",
|
||||||
"resolved": "https://registry.npmjs.org/for-each/-/for-each-0.3.3.tgz",
|
"resolved": "https://registry.npmjs.org/for-each/-/for-each-0.3.3.tgz",
|
||||||
@@ -3418,6 +3722,17 @@
|
|||||||
"is-callable": "^1.1.3"
|
"is-callable": "^1.1.3"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
"forking-build-shit": {
|
||||||
|
"version": "0.0.2",
|
||||||
|
"resolved": "https://registry.npmjs.org/forking-build-shit/-/forking-build-shit-0.0.2.tgz",
|
||||||
|
"integrity": "sha512-1qpXIK3nX8ZPTbwojsqxjTp5qDITX24MkKaX/8p6mMkIAQiVul1nhdYCAFLpnpnLon87Ru1exlJKhkvIKT7b+A==",
|
||||||
|
"dev": true,
|
||||||
|
"requires": {
|
||||||
|
"csso": "5.0.5",
|
||||||
|
"sass": "1.86.0",
|
||||||
|
"uglify-js": "3.19.3"
|
||||||
|
}
|
||||||
|
},
|
||||||
"forwarded": {
|
"forwarded": {
|
||||||
"version": "0.2.0",
|
"version": "0.2.0",
|
||||||
"resolved": "https://registry.npmjs.org/forwarded/-/forwarded-0.2.0.tgz",
|
"resolved": "https://registry.npmjs.org/forwarded/-/forwarded-0.2.0.tgz",
|
||||||
@@ -3688,6 +4003,11 @@
|
|||||||
"resolved": "https://registry.npmjs.org/json5/-/json5-2.2.3.tgz",
|
"resolved": "https://registry.npmjs.org/json5/-/json5-2.2.3.tgz",
|
||||||
"integrity": "sha512-XmOWe7eyHYH14cLdVPoyg+GOH3rYX++KpzrylJwSW98t3Nk+U8XOl8FWKOgwtzdb8lXGf6zYwDUzeHMWfxasyg=="
|
"integrity": "sha512-XmOWe7eyHYH14cLdVPoyg+GOH3rYX++KpzrylJwSW98t3Nk+U8XOl8FWKOgwtzdb8lXGf6zYwDUzeHMWfxasyg=="
|
||||||
},
|
},
|
||||||
|
"ky": {
|
||||||
|
"version": "1.7.5",
|
||||||
|
"resolved": "https://registry.npmjs.org/ky/-/ky-1.7.5.tgz",
|
||||||
|
"integrity": "sha512-HzhziW6sc5m0pwi5M196+7cEBtbt0lCYi67wNsiwMUmz833wloE0gbzJPWKs1gliFKQb34huItDQX97LyOdPdA=="
|
||||||
|
},
|
||||||
"lodash": {
|
"lodash": {
|
||||||
"version": "4.17.21",
|
"version": "4.17.21",
|
||||||
"resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.21.tgz",
|
"resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.21.tgz",
|
||||||
@@ -3840,14 +4160,6 @@
|
|||||||
"resolved": "https://registry.npmjs.org/path-to-regexp/-/path-to-regexp-0.1.12.tgz",
|
"resolved": "https://registry.npmjs.org/path-to-regexp/-/path-to-regexp-0.1.12.tgz",
|
||||||
"integrity": "sha512-RA1GjUVMnvYFxuqovrEqZoxxW5NUZqbwKtYz/Tt7nXerk0LbLblQmrsgdeOxV5SFHf0UDggjS/bSeOZwt1pmEQ=="
|
"integrity": "sha512-RA1GjUVMnvYFxuqovrEqZoxxW5NUZqbwKtYz/Tt7nXerk0LbLblQmrsgdeOxV5SFHf0UDggjS/bSeOZwt1pmEQ=="
|
||||||
},
|
},
|
||||||
"phin": {
|
|
||||||
"version": "3.7.1",
|
|
||||||
"resolved": "https://registry.npmjs.org/phin/-/phin-3.7.1.tgz",
|
|
||||||
"integrity": "sha512-GEazpTWwTZaEQ9RhL7Nyz0WwqilbqgLahDM3D0hxWwmVDI52nXEybHqiN6/elwpkJBhcuj+WbBu+QfT0uhPGfQ==",
|
|
||||||
"requires": {
|
|
||||||
"centra": "^2.7.0"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"picomatch": {
|
"picomatch": {
|
||||||
"version": "2.3.1",
|
"version": "2.3.1",
|
||||||
"resolved": "https://registry.npmjs.org/picomatch/-/picomatch-2.3.1.tgz",
|
"resolved": "https://registry.npmjs.org/picomatch/-/picomatch-2.3.1.tgz",
|
||||||
@@ -3968,9 +4280,9 @@
|
|||||||
"integrity": "sha512-YZo3K82SD7Riyi0E1EQPojLz7kpepnSQI9IyPbHHg1XXXevb5dJI7tpyN2ADxGcQbHG7vcyRHk0cbwqcQriUtg=="
|
"integrity": "sha512-YZo3K82SD7Riyi0E1EQPojLz7kpepnSQI9IyPbHHg1XXXevb5dJI7tpyN2ADxGcQbHG7vcyRHk0cbwqcQriUtg=="
|
||||||
},
|
},
|
||||||
"sass": {
|
"sass": {
|
||||||
"version": "1.83.1",
|
"version": "1.86.0",
|
||||||
"resolved": "https://registry.npmjs.org/sass/-/sass-1.83.1.tgz",
|
"resolved": "https://registry.npmjs.org/sass/-/sass-1.86.0.tgz",
|
||||||
"integrity": "sha512-EVJbDaEs4Rr3F0glJzFSOvtg2/oy2V/YrGFPqPY24UqcLDWcI9ZY5sN+qyO3c/QCZwzgfirvhXvINiJCE/OLcA==",
|
"integrity": "sha512-zV8vGUld/+mP4KbMLJMX7TyGCuUp7hnkOScgCMsWuHtns8CWBoz+vmEhoGMXsaJrbUP8gj+F1dLvVe79sK8UdA==",
|
||||||
"dev": true,
|
"dev": true,
|
||||||
"requires": {
|
"requires": {
|
||||||
"@parcel/watcher": "^2.4.1",
|
"@parcel/watcher": "^2.4.1",
|
||||||
@@ -4237,12 +4549,24 @@
|
|||||||
"mime-types": "~2.1.24"
|
"mime-types": "~2.1.24"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
"typescript": {
|
||||||
|
"version": "5.7.3",
|
||||||
|
"resolved": "https://registry.npmjs.org/typescript/-/typescript-5.7.3.tgz",
|
||||||
|
"integrity": "sha512-84MVSjMEHP+FQRPy3pX9sTVV/INIex71s9TL2Gm5FG/WG1SqXeKyZ0k7/blY/4FdOzI12CBy1vGc4og/eus0fw==",
|
||||||
|
"dev": true
|
||||||
|
},
|
||||||
"uglify-js": {
|
"uglify-js": {
|
||||||
"version": "3.19.3",
|
"version": "3.19.3",
|
||||||
"resolved": "https://registry.npmjs.org/uglify-js/-/uglify-js-3.19.3.tgz",
|
"resolved": "https://registry.npmjs.org/uglify-js/-/uglify-js-3.19.3.tgz",
|
||||||
"integrity": "sha512-v3Xu+yuwBXisp6QYTcH4UbH+xYJXqnq2m/LtQVWKWzYc1iehYnLixoQDN9FH6/j9/oybfd6W9Ghwkl8+UMKTKQ==",
|
"integrity": "sha512-v3Xu+yuwBXisp6QYTcH4UbH+xYJXqnq2m/LtQVWKWzYc1iehYnLixoQDN9FH6/j9/oybfd6W9Ghwkl8+UMKTKQ==",
|
||||||
"dev": true
|
"dev": true
|
||||||
},
|
},
|
||||||
|
"undici-types": {
|
||||||
|
"version": "6.20.0",
|
||||||
|
"resolved": "https://registry.npmjs.org/undici-types/-/undici-types-6.20.0.tgz",
|
||||||
|
"integrity": "sha512-Ny6QZ2Nju20vw1SRHe3d9jVu6gJ+4e3+MMpqu7pqE5HT6WsTSlce++GQmK5UXS8mzV8DSYHrQH+Xrf2jVcuKNg==",
|
||||||
|
"dev": true
|
||||||
|
},
|
||||||
"unpipe": {
|
"unpipe": {
|
||||||
"version": "1.0.0",
|
"version": "1.0.0",
|
||||||
"resolved": "https://registry.npmjs.org/unpipe/-/unpipe-1.0.0.tgz",
|
"resolved": "https://registry.npmjs.org/unpipe/-/unpipe-1.0.0.tgz",
|
||||||
|
|||||||
40
package.json
40
package.json
@@ -1,42 +1,56 @@
|
|||||||
{
|
{
|
||||||
"name": "artix-packy-notifier",
|
"name": "artix-checkupdates-web",
|
||||||
"version": "4.0.7",
|
"version": "4.1.1",
|
||||||
"description": "Determine packages that need attention",
|
"description": "Determine packages that need attention",
|
||||||
"main": "index.js",
|
"main": "./distribution/index.js",
|
||||||
|
"type": "module",
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"build": "node build.js",
|
"build": "npx build-shit",
|
||||||
"watch": "node build.js --watch"
|
"watch": "npx build-shit --watch"
|
||||||
},
|
},
|
||||||
"repository": {
|
"repository": {
|
||||||
"type": "git",
|
"type": "git",
|
||||||
"url": "git+ssh://git@gitlab.com/sanin.dev/artix-packy-notifier.git"
|
"url": "git+ssh://git@github.com:CorySanin/artix-checkupdates-web.git"
|
||||||
},
|
},
|
||||||
"keywords": [
|
"keywords": [
|
||||||
"artix",
|
"artix",
|
||||||
"linux",
|
"linux",
|
||||||
"packages"
|
"packages"
|
||||||
],
|
],
|
||||||
|
"files": [
|
||||||
|
"distribution",
|
||||||
|
"assets",
|
||||||
|
"views",
|
||||||
|
"userbar"
|
||||||
|
],
|
||||||
"author": "Cory Sanin",
|
"author": "Cory Sanin",
|
||||||
"license": "MIT",
|
"license": "MIT",
|
||||||
"bugs": {
|
"bugs": {
|
||||||
"url": "https://gitlab.com/sanin.dev/artix-packy-notifier/issues"
|
"url": "https://github.com/CorySanin/artix-checkupdates-web/issues"
|
||||||
},
|
},
|
||||||
"homepage": "https://gitlab.com/sanin.dev/artix-packy-notifier#readme",
|
"homepage": "https://github.com/CorySanin/artix-checkupdates-web#readme",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"better-sqlite3": "11.7.2",
|
"artix-checkupdates": "1.0.2",
|
||||||
|
"better-sqlite3": "11.9.1",
|
||||||
"dayjs": "1.11.13",
|
"dayjs": "1.11.13",
|
||||||
"ejs": "3.1.10",
|
"ejs": "3.1.10",
|
||||||
"express": "4.21.2",
|
"express": "4.21.2",
|
||||||
|
"express-useragent": "1.0.15",
|
||||||
"irc-framework": "4.14.0",
|
"irc-framework": "4.14.0",
|
||||||
"json5": "2.2.3",
|
"json5": "2.2.3",
|
||||||
|
"ky": "1.7.5",
|
||||||
"node-cron": "3.0.3",
|
"node-cron": "3.0.3",
|
||||||
"phin": "3.7.1",
|
|
||||||
"prom-client": "15.1.3",
|
"prom-client": "15.1.3",
|
||||||
"sharp": "0.33.5"
|
"sharp": "0.33.5"
|
||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"csso": "5.0.5",
|
"@sindresorhus/tsconfig": "7.0.0",
|
||||||
"sass": "1.83.1",
|
"@types/better-sqlite3": "^7.6.12",
|
||||||
"uglify-js": "3.19.3"
|
"@types/express": "^5.0.0",
|
||||||
|
"@types/express-useragent": "1.0.5",
|
||||||
|
"@types/node": "22.10.7",
|
||||||
|
"@types/node-cron": "3.0.11",
|
||||||
|
"forking-build-shit": "0.0.2",
|
||||||
|
"typescript": "5.7.3"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
35
src/config.d.ts
vendored
Normal file
35
src/config.d.ts
vendored
Normal file
@@ -0,0 +1,35 @@
|
|||||||
|
import { } from "node:os";
|
||||||
|
|
||||||
|
export type IRCFrameworkConfig = {
|
||||||
|
host: string;
|
||||||
|
port: number;
|
||||||
|
nick: string;
|
||||||
|
}
|
||||||
|
|
||||||
|
export type AuxiliaryIRCConfig = {
|
||||||
|
channel?: string;
|
||||||
|
channel_key: string;
|
||||||
|
}
|
||||||
|
|
||||||
|
export type Maintainer = {
|
||||||
|
name: string;
|
||||||
|
channels?: string[];
|
||||||
|
ircName?: string;
|
||||||
|
}
|
||||||
|
|
||||||
|
export type MaintainerArrayElement = (string | Maintainer);
|
||||||
|
|
||||||
|
export type Config = {
|
||||||
|
webhostname: string;
|
||||||
|
apprise: string;
|
||||||
|
maintainers: MaintainerArrayElement[];
|
||||||
|
cron?: string;
|
||||||
|
syncfreq: number;
|
||||||
|
db?: string;
|
||||||
|
port?: number;
|
||||||
|
privateport?: number;
|
||||||
|
savePath?: string;
|
||||||
|
irchostname?: string;
|
||||||
|
'irc-framework'?: IRCFrameworkConfig;
|
||||||
|
ircClient?: AuxiliaryIRCConfig;
|
||||||
|
}
|
||||||
@@ -1,42 +1,60 @@
|
|||||||
const path = require('path');
|
import { Checkupdates } from 'artix-checkupdates';
|
||||||
const fs = require('fs');
|
import { DB } from './db.mjs';
|
||||||
const os = require('os');
|
import { spawn } from 'child_process';
|
||||||
const spawn = require('child_process').spawn;
|
import ky from 'ky';
|
||||||
const cron = require('node-cron');
|
import * as path from 'path';
|
||||||
const dayjs = require('dayjs');
|
import * as fsp from 'node:fs/promises';
|
||||||
const express = require('express');
|
import * as cron from 'node-cron';
|
||||||
const phin = require('phin');
|
import dayjs from 'dayjs';
|
||||||
const DB = require('./db');
|
import express from 'express';
|
||||||
const fsp = fs.promises;
|
import type http from "http";
|
||||||
|
import type { Express } from "express";
|
||||||
|
import type { Config, MaintainerArrayElement } from './config.js';
|
||||||
|
import type { Category, PackageDBEntry } from './db.mjs';
|
||||||
|
|
||||||
const TIMEOUT = 180000;
|
const TIMEOUT = 180000;
|
||||||
const ORPHAN = {
|
const ORPHAN = {
|
||||||
"name": "orphan",
|
"name": "orphan",
|
||||||
"ircName": "orphaned"
|
"ircName": "orphaned"
|
||||||
};
|
};
|
||||||
const EXTRASPACE = new RegExp('\\s+', 'g');
|
|
||||||
const CHECKUPDATESCACHE = path.join(os.homedir(), '.cache', 'artix-checkupdates');
|
|
||||||
const NICETYPES = {
|
const NICETYPES = {
|
||||||
move: 'move',
|
move: 'move',
|
||||||
udate: 'update'
|
udate: 'update'
|
||||||
|
};
|
||||||
|
|
||||||
|
type SaveData = {
|
||||||
|
'last-sync': string | null;
|
||||||
|
move: string[];
|
||||||
|
update: string[];
|
||||||
|
}
|
||||||
|
|
||||||
|
type AppriseConf = {
|
||||||
|
api: string;
|
||||||
|
urls: string[];
|
||||||
|
}
|
||||||
|
|
||||||
|
function notStupidParseInt(v: string | undefined): number {
|
||||||
|
return v === undefined ? NaN : parseInt(v);
|
||||||
}
|
}
|
||||||
const NAMECOMPLIANCE = [
|
|
||||||
p => p.replace(/([a-zA-Z0-9]+)\+([a-zA-Z]+)/g, '$1-$2'),
|
|
||||||
p => p.replace(/\+/g, "plus"),
|
|
||||||
p => p.replace(/[^a-zA-Z0-9_\-\.]/g, "-"),
|
|
||||||
p => p.replace(/[_\-]{2,}/g, "-")
|
|
||||||
]
|
|
||||||
|
|
||||||
class Daemon {
|
class Daemon {
|
||||||
|
private _config: Config;
|
||||||
|
private _savePath: string;
|
||||||
|
private _locked: boolean;
|
||||||
|
private _saveData: SaveData;
|
||||||
|
private _db: DB;
|
||||||
|
private _cronjob: cron.ScheduledTask;
|
||||||
|
private _webserver: http.Server;
|
||||||
|
|
||||||
constructor(config) {
|
constructor(config: Config) {
|
||||||
const app = express();
|
const PROJECT_ROOT = path.resolve(import.meta.dirname, '..');
|
||||||
const port = process.env.PRIVATEPORT || config.privateport || 8081;
|
const app: Express = express();
|
||||||
|
const port = process.env['PRIVATEPORT'] || config.privateport || 8081;
|
||||||
this._config = config;
|
this._config = config;
|
||||||
this._savePath = process.env.SAVEPATH || config.savePath || path.join(__dirname, 'config', 'data.json');
|
this._savePath = process.env['SAVEPATH'] || config.savePath || path.join(PROJECT_ROOT, 'config', 'data.json');
|
||||||
console.log('Written by Cory Sanin for Artix Linux');
|
console.log('Written by Cory Sanin for Artix Linux');
|
||||||
this._locked = false;
|
this._locked = false;
|
||||||
const db = this._db = new DB(process.env.DBPATH || config.db || path.join(__dirname, 'config', 'packages.db'));
|
const db = this._db = new DB(process.env['DBPATH'] || config.db || path.join(PROJECT_ROOT, 'config', 'packages.db'));
|
||||||
this._saveData = {
|
this._saveData = {
|
||||||
'last-sync': null,
|
'last-sync': null,
|
||||||
move: [],
|
move: [],
|
||||||
@@ -45,7 +63,7 @@ class Daemon {
|
|||||||
|
|
||||||
app.set('trust proxy', 1);
|
app.set('trust proxy', 1);
|
||||||
|
|
||||||
app.get('/healthcheck', (req, res) => {
|
app.get('/healthcheck', (_, res) => {
|
||||||
res.send('Healthy');
|
res.send('Healthy');
|
||||||
});
|
});
|
||||||
|
|
||||||
@@ -54,22 +72,21 @@ class Daemon {
|
|||||||
// resetting flags in case of improper shutdown
|
// resetting flags in case of improper shutdown
|
||||||
db.restoreFlags();
|
db.restoreFlags();
|
||||||
|
|
||||||
this._cronjob = cron.schedule(process.env.CRON || config.cron || '*/30 * * * *', () => {
|
this._cronjob = cron.schedule(process.env['CRON'] || config.cron || '*/30 * * * *', () => {
|
||||||
this.main(this._config);
|
this.main(this._config);
|
||||||
});
|
});
|
||||||
|
|
||||||
this._webserver = app.listen(port);
|
this._webserver = app.listen(port);
|
||||||
}
|
}
|
||||||
|
|
||||||
main = async (config) => {
|
main = async (config: Config) => {
|
||||||
const db = this._db;
|
|
||||||
if (this._locked) {
|
if (this._locked) {
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
this._locked = true;
|
this._locked = true;
|
||||||
console.log('Starting scheduled task');
|
console.log('Starting scheduled task');
|
||||||
let now = dayjs();
|
let now = dayjs();
|
||||||
if (!('last-sync' in this._saveData) || !this._saveData['last-sync'] || dayjs(this._saveData['last-sync']).isBefore(now.subtract(process.env.SYNCFREQ || config.syncfreq || 2, 'days'))) {
|
if (!('last-sync' in this._saveData) || !this._saveData['last-sync'] || dayjs(this._saveData['last-sync']).isBefore(now.subtract(notStupidParseInt(process.env['SYNCFREQ']) || config.syncfreq || 2, 'days'))) {
|
||||||
await this.updateMaintainers(config);
|
await this.updateMaintainers(config);
|
||||||
this._saveData['last-sync'] = now.toJSON();
|
this._saveData['last-sync'] = now.toJSON();
|
||||||
await this.writeSaveData();
|
await this.writeSaveData();
|
||||||
@@ -80,30 +97,21 @@ class Daemon {
|
|||||||
console.log('Task complete.');
|
console.log('Task complete.');
|
||||||
}
|
}
|
||||||
|
|
||||||
cleanUpLockfiles = async () => {
|
updateMaintainers = async (config: Config) => {
|
||||||
try {
|
|
||||||
await fsp.rm(CHECKUPDATESCACHE, { recursive: true, force: true });
|
|
||||||
}
|
|
||||||
catch (ex) {
|
|
||||||
console.error('Failed to remove the artix-checkupdates cache directory:', ex);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
updateMaintainers = async (config) => {
|
|
||||||
const db = this._db;
|
const db = this._db;
|
||||||
console.log('Syncing packages...');
|
console.log('Syncing packages...');
|
||||||
const lastseen = (new Date()).getTime();
|
const lastseen = (new Date()).getTime();
|
||||||
const maintainers = [...(config.maintainers || []), ORPHAN];
|
const maintainers = [...(config.maintainers || []), ORPHAN];
|
||||||
for (let i = 0; i < maintainers.length; i++) {
|
for (let i = 0; i < maintainers.length; i++) {
|
||||||
let maintainer = maintainers[i];
|
let maintainer = maintainers[i] as MaintainerArrayElement;
|
||||||
if (typeof maintainer === 'object') {
|
if (typeof maintainer === 'object') {
|
||||||
maintainer = maintainer.name;
|
maintainer = maintainer.name;
|
||||||
}
|
}
|
||||||
console.log(`Syncing ${maintainer}...`);
|
console.log(`Syncing ${maintainer}...`);
|
||||||
try {
|
try {
|
||||||
const packages = await this.getMaintainersPackages(maintainer);
|
const packages: string[] = await this.getMaintainersPackages(maintainer);
|
||||||
for (let j = 0; j < packages.length; j++) {
|
for (let j = 0; j < packages.length; j++) {
|
||||||
db.updatePackage(packages[j], maintainer, lastseen);
|
db.updatePackage(packages[j] as string, maintainer, lastseen);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
catch (err) {
|
catch (err) {
|
||||||
@@ -116,56 +124,25 @@ class Daemon {
|
|||||||
console.log(`Package sync complete`);
|
console.log(`Package sync complete`);
|
||||||
}
|
}
|
||||||
|
|
||||||
checkupdates = async (config) => {
|
checkupdates = async (config: Config) => {
|
||||||
const db = this._db;
|
const check = new Checkupdates();
|
||||||
|
|
||||||
try {
|
try {
|
||||||
await this.handleUpdates(config, this._saveData.move = await this.execCheckUpdates(['-m']), 'move');
|
await this.handleUpdates(config, this._saveData.move = (await check.fetchMovable()).map(p => p.basename), 'move');
|
||||||
await this.handleUpdates(config, this._saveData.update = await this.execCheckUpdates(['-u']), 'udate');
|
await this.handleUpdates(config, this._saveData.update = (await check.fetchUpgradable()).map(p => p.basename), 'udate');
|
||||||
}
|
}
|
||||||
catch (ex) {
|
catch (ex) {
|
||||||
console.error('Failed to check for updates:', ex);
|
console.error('Failed to check for updates:', ex);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
execCheckUpdates = (flags) => {
|
getMaintainersPackages = (maintainer: string): Promise<string[]> => {
|
||||||
return new Promise((resolve, reject) => {
|
|
||||||
let process = spawn('artix-checkupdates', flags);
|
|
||||||
let timeout = setTimeout(async () => {
|
|
||||||
process.kill() && await this.cleanUpLockfiles();
|
|
||||||
reject('Timed out');
|
|
||||||
}, TIMEOUT);
|
|
||||||
let outputstr = '';
|
|
||||||
let errorOutput = '';
|
|
||||||
process.stdout.on('data', data => {
|
|
||||||
outputstr += data.toString();
|
|
||||||
});
|
|
||||||
process.stderr.on('data', err => {
|
|
||||||
const errstr = err.toString();
|
|
||||||
errorOutput += `${errstr}, `;
|
|
||||||
console.error(errstr);
|
|
||||||
});
|
|
||||||
process.on('exit', async (code) => {
|
|
||||||
if (code === 0 && errorOutput.length === 0) {
|
|
||||||
clearTimeout(timeout);
|
|
||||||
resolve(this.parseCheckUpdatesOutput(outputstr));
|
|
||||||
}
|
|
||||||
else {
|
|
||||||
errorOutput.includes('unable to lock database') && this.cleanUpLockfiles();
|
|
||||||
reject((code && `exited with ${code}`) || errorOutput);
|
|
||||||
}
|
|
||||||
});
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
getMaintainersPackages = (maintainer) => {
|
|
||||||
return new Promise((resolve, reject) => {
|
return new Promise((resolve, reject) => {
|
||||||
let process = spawn('artixpkg', ['admin', 'query', maintainer === ORPHAN.name ? '-t' : '-m', maintainer]);
|
let process = spawn('artixpkg', ['admin', 'query', maintainer === ORPHAN.name ? '-t' : '-m', maintainer]);
|
||||||
let timeout = setTimeout(() => {
|
let timeout = setTimeout(() => {
|
||||||
reject('Timed out');
|
reject('Timed out');
|
||||||
process.kill();
|
process.kill();
|
||||||
}, TIMEOUT);
|
}, TIMEOUT);
|
||||||
let packagelist = [];
|
let packagelist: string[] = [];
|
||||||
process.stdout.on('data', data => {
|
process.stdout.on('data', data => {
|
||||||
packagelist = packagelist.concat(data.toString().trim().split('\n'));
|
packagelist = packagelist.concat(data.toString().trim().split('\n'));
|
||||||
});
|
});
|
||||||
@@ -184,29 +161,16 @@ class Daemon {
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
parseCheckUpdatesOutput = (output) => {
|
handleUpdates = async (config: Config, packs: string[], type: Category) => {
|
||||||
let packages = [];
|
|
||||||
const lines = output.split('\n');
|
|
||||||
lines.forEach(l => {
|
|
||||||
// "package" is "reserved"
|
|
||||||
const reservethis = l.trim().replace(EXTRASPACE, ' ');
|
|
||||||
if (reservethis.length > 0 && reservethis.indexOf('Package basename') < 0) {
|
|
||||||
packages.push(NAMECOMPLIANCE.reduce((s, fn) => fn(s), reservethis.split(' ', 2)[0]));
|
|
||||||
}
|
|
||||||
});
|
|
||||||
return packages;
|
|
||||||
}
|
|
||||||
|
|
||||||
handleUpdates = async (config, packs, type) => {
|
|
||||||
const db = this._db;
|
const db = this._db;
|
||||||
packs.forEach(v => {
|
packs.forEach(v => {
|
||||||
let p = db.getPackage(v);
|
let p = db.getPackage(v);
|
||||||
p && db.updateFlag(v, type, p[type] > 0 ? 2 : 4);
|
p && db.updateFlag(v, type, p[type] > 0 ? 2 : 4);
|
||||||
});
|
});
|
||||||
const maintainers = [...config.maintainers, ORPHAN];
|
const maintainers: MaintainerArrayElement[] = [...config.maintainers, ORPHAN];
|
||||||
for (let i = 0; i < maintainers.length; i++) {
|
for (let i = 0; i < maintainers.length; i++) {
|
||||||
const m = maintainers[i];
|
const m = maintainers[i] as MaintainerArrayElement;
|
||||||
const mname = typeof m === 'object' ? m.name : m;
|
const mname: string = typeof m === 'object' ? m.name : m;
|
||||||
const ircName = typeof m === 'object' ? (m.ircName || mname) : m;
|
const ircName = typeof m === 'object' ? (m.ircName || mname) : m;
|
||||||
const packages = db.getNewByMaintainer(mname, type);
|
const packages = db.getNewByMaintainer(mname, type);
|
||||||
if (typeof m === 'object' && m.channels) {
|
if (typeof m === 'object' && m.channels) {
|
||||||
@@ -222,18 +186,16 @@ class Daemon {
|
|||||||
db.restoreFlags(type);
|
db.restoreFlags(type);
|
||||||
}
|
}
|
||||||
|
|
||||||
notify = async (apprise, packarr, type) => {
|
notify = async (apprise: AppriseConf, packarr: PackageDBEntry[], type: string) => {
|
||||||
if (!(packarr && packarr.length && apprise && apprise.api && apprise.urls)) {
|
if (!(packarr && packarr.length && apprise && apprise.api && apprise.urls)) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
const packagesStr = packarr.map(p => p.package).join('\n');
|
const packagesStr = packarr.map(p => p.package).join('\n');
|
||||||
for (let i = 0; i < 25; i++) {
|
for (let i = 0; i < 25; i++) {
|
||||||
try {
|
try {
|
||||||
return await phin({
|
return await ky.post(`${apprise.api}/notify/`, {
|
||||||
url: `${apprise.api}/notify/`,
|
json: {
|
||||||
method: 'POST',
|
title: `${packarr[0]?.maintainer}: packages ready to ${type}`,
|
||||||
data: {
|
|
||||||
title: `${packarr[0].maintainer}: packages ready to ${type}`,
|
|
||||||
body: packagesStr,
|
body: packagesStr,
|
||||||
urls: apprise.urls.join(',')
|
urls: apprise.urls.join(',')
|
||||||
}
|
}
|
||||||
@@ -247,19 +209,17 @@ class Daemon {
|
|||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
ircNotify = async (packarr, maintainer, type) => {
|
ircNotify = async (packarr: PackageDBEntry[], maintainer: string, type: string) => {
|
||||||
const config = this._config;
|
const config = this._config;
|
||||||
if (!(packarr && packarr.length && config['irc-framework'])) {
|
if (!(packarr && packarr.length && config['irc-framework'])) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
const hostname = process.env.IRCHOSTNAME || config.irchostname || 'http://artix-notifier-irc:8081';
|
const hostname = process.env['IRCHOSTNAME'] || config.irchostname || 'http://artix-notifier-irc:8081';
|
||||||
const packagesStr = packarr.map(p => p.package).join('\n');
|
const packagesStr = packarr.map(p => p.package).join('\n');
|
||||||
for (let i = 0; i < 25; i++) {
|
for (let i = 0; i < 25; i++) {
|
||||||
try {
|
try {
|
||||||
return await phin({
|
return await ky.post(`${hostname}/api/1.0/notifications`, {
|
||||||
url: `${hostname}/api/1.0/notifications`,
|
json: {
|
||||||
method: 'POST',
|
|
||||||
data: {
|
|
||||||
message: `${maintainer}: packages ready to ${type}\n${packagesStr}\n-------- EOF --------`
|
message: `${maintainer}: packages ready to ${type}\n${packagesStr}\n-------- EOF --------`
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
@@ -274,7 +234,7 @@ class Daemon {
|
|||||||
|
|
||||||
readSaveData = async () => {
|
readSaveData = async () => {
|
||||||
try {
|
try {
|
||||||
this._saveData = JSON.parse(await fsp.readFile(this._savePath));
|
this._saveData = JSON.parse((await fsp.readFile(this._savePath)).toString());
|
||||||
}
|
}
|
||||||
catch {
|
catch {
|
||||||
console.error(`Failed to read existing save data at ${this._savePath}`);
|
console.error(`Failed to read existing save data at ${this._savePath}`);
|
||||||
@@ -283,13 +243,10 @@ class Daemon {
|
|||||||
|
|
||||||
writeSaveData = async () => {
|
writeSaveData = async () => {
|
||||||
const config = this._config;
|
const config = this._config;
|
||||||
const hostname = process.env.WEBHOSTNAME || config.webhostname || 'http://artix-notifier-web:8081';
|
const hostname = process.env['WEBHOSTNAME'] || config.webhostname || 'http://artix-notifier-web:8081';
|
||||||
try {
|
try {
|
||||||
await fsp.writeFile(this._savePath, JSON.stringify(this._saveData));
|
await fsp.writeFile(this._savePath, JSON.stringify(this._saveData));
|
||||||
phin({
|
ky.put(`${hostname}/api/1.0/data`);
|
||||||
url: `${hostname}/api/1.0/data`,
|
|
||||||
method: 'PUT'
|
|
||||||
});
|
|
||||||
}
|
}
|
||||||
catch {
|
catch {
|
||||||
console.error(`Failed to write save data to ${this._savePath}`);
|
console.error(`Failed to write save data to ${this._savePath}`);
|
||||||
@@ -306,4 +263,6 @@ class Daemon {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
module.exports = Daemon;
|
export default Daemon;
|
||||||
|
export { Daemon };
|
||||||
|
export type { SaveData };
|
||||||
@@ -1,9 +1,50 @@
|
|||||||
const sqlite = require('better-sqlite3');
|
import Database from 'better-sqlite3';
|
||||||
|
|
||||||
const TABLE = 'packages';
|
const TABLE = 'packages';
|
||||||
|
|
||||||
|
type Category = 'move' | 'udate';
|
||||||
|
|
||||||
|
interface CommonOperations {
|
||||||
|
GET: Database.Statement;
|
||||||
|
GETNEWBYMAINTAINER: Database.Statement;
|
||||||
|
UPDATE: Database.Statement;
|
||||||
|
INCREMENT: Database.Statement;
|
||||||
|
DECREMENT: Database.Statement;
|
||||||
|
FIXFLAG: Database.Statement;
|
||||||
|
GETPACKAGESBYMAINTAINER: Database.Statement;
|
||||||
|
GETPACKAGECOUNTBYMAINTAINER: Database.Statement;
|
||||||
|
}
|
||||||
|
|
||||||
|
interface DatabaseOperations {
|
||||||
|
GETPACKAGE: Database.Statement;
|
||||||
|
ADDPACKAGE: Database.Statement;
|
||||||
|
GETPACKAGES: Database.Statement;
|
||||||
|
GETPACKAGESSTARTWITH: Database.Statement;
|
||||||
|
UPDATEMAINTAINER: Database.Statement;
|
||||||
|
GETMAINTAINERPACKAGECOUNT: Database.Statement;
|
||||||
|
REMOVEOLDPACKAGE: Database.Statement;
|
||||||
|
move: CommonOperations;
|
||||||
|
udate: CommonOperations;
|
||||||
|
}
|
||||||
|
|
||||||
|
interface PackageDBEntry {
|
||||||
|
package: string;
|
||||||
|
maintainer: string;
|
||||||
|
move: number;
|
||||||
|
udate: number;
|
||||||
|
lastseen: Date;
|
||||||
|
}
|
||||||
|
|
||||||
|
interface CountResult {
|
||||||
|
count: number;
|
||||||
|
}
|
||||||
|
|
||||||
class DB {
|
class DB {
|
||||||
constructor(file) {
|
private _db: Database.Database;
|
||||||
this._db = new sqlite(file);
|
private _queries: DatabaseOperations;
|
||||||
|
|
||||||
|
constructor(file: string | Buffer) {
|
||||||
|
this._db = new Database(file);
|
||||||
const db = this._db;
|
const db = this._db;
|
||||||
db.pragma('journal_mode = WAL');
|
db.pragma('journal_mode = WAL');
|
||||||
|
|
||||||
@@ -42,23 +83,27 @@ class DB {
|
|||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
restoreFlags() {
|
restoreFlags(type: Category | null = null) {
|
||||||
this._queries.move.FIXFLAG.run();
|
if (type !== 'udate') {
|
||||||
this._queries.udate.FIXFLAG.run();
|
this._queries.move.FIXFLAG.run();
|
||||||
|
}
|
||||||
|
if (type !== 'move') {
|
||||||
|
this._queries.udate.FIXFLAG.run();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
getPackage(pack) {
|
getPackage(pack: string): PackageDBEntry {
|
||||||
return this._queries.GETPACKAGE.get({
|
return this._queries.GETPACKAGE.get({
|
||||||
package: pack
|
package: pack
|
||||||
});
|
}) as PackageDBEntry;
|
||||||
}
|
}
|
||||||
|
|
||||||
getPackages(startsWith = null) {
|
getPackages(startsWith: string | null = null): string[] {
|
||||||
return ((!!startsWith) ? this._queries.GETPACKAGESSTARTWITH.all({ startsWith }) :
|
return ((!!startsWith) ? this._queries.GETPACKAGESSTARTWITH.all({ startsWith }) :
|
||||||
this._queries.GETPACKAGES.all()).map(p => p.package);
|
this._queries.GETPACKAGES.all()).map(p => (p as PackageDBEntry).package);
|
||||||
}
|
}
|
||||||
|
|
||||||
updatePackage(pack, maintainer, lastseen) {
|
updatePackage(pack: string, maintainer: string, lastseen: number): Database.RunResult {
|
||||||
return this._queries[this.getPackage(pack) ? 'UPDATEMAINTAINER' : 'ADDPACKAGE'].run({
|
return this._queries[this.getPackage(pack) ? 'UPDATEMAINTAINER' : 'ADDPACKAGE'].run({
|
||||||
package: pack,
|
package: pack,
|
||||||
maintainer,
|
maintainer,
|
||||||
@@ -66,19 +111,19 @@ class DB {
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
incrementFlag(pack, type) {
|
incrementFlag(pack: string, type: Category): boolean {
|
||||||
this._queries[type].INCREMENT.run({
|
this._queries[type].INCREMENT.run({
|
||||||
package: pack
|
package: pack
|
||||||
});
|
});
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
decrementFlags(type) {
|
decrementFlags(type: Category): boolean {
|
||||||
this._queries[type].DECREMENT.run();
|
this._queries[type].DECREMENT.run();
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
updateFlag(pack, type, bool) {
|
updateFlag(pack: string, type: Category, bool: number): boolean {
|
||||||
this._queries[type].UPDATE.run({
|
this._queries[type].UPDATE.run({
|
||||||
package: pack,
|
package: pack,
|
||||||
bool
|
bool
|
||||||
@@ -86,41 +131,43 @@ class DB {
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
getFlag(type, bool = true) {
|
getFlag(type: Category, bool: boolean = true): PackageDBEntry[] {
|
||||||
return this._queries[type].GET.all({
|
return this._queries[type].GET.all({
|
||||||
bool
|
bool
|
||||||
});
|
}) as PackageDBEntry[];
|
||||||
}
|
}
|
||||||
|
|
||||||
getNewByMaintainer(maintainer, type) {
|
getNewByMaintainer(maintainer: string, type: Category): PackageDBEntry[] {
|
||||||
return this._queries[type].GETNEWBYMAINTAINER.all({
|
return this._queries[type].GETNEWBYMAINTAINER.all({
|
||||||
maintainer
|
maintainer
|
||||||
});
|
}) as PackageDBEntry[];
|
||||||
}
|
}
|
||||||
|
|
||||||
getPackagesByMaintainer(maintainer, type) {
|
getPackagesByMaintainer(maintainer: string, type: Category): PackageDBEntry[] {
|
||||||
return this._queries[type].GETPACKAGESBYMAINTAINER.all({
|
return this._queries[type].GETPACKAGESBYMAINTAINER.all({
|
||||||
maintainer
|
maintainer
|
||||||
});
|
}) as PackageDBEntry[];
|
||||||
}
|
}
|
||||||
|
|
||||||
getPackageCountByMaintainer(maintainer, type) {
|
getPackageCountByMaintainer(maintainer: string, type: Category): number {
|
||||||
return this._queries[type].GETPACKAGECOUNTBYMAINTAINER.get({
|
return (this._queries[type].GETPACKAGECOUNTBYMAINTAINER.get({
|
||||||
maintainer
|
maintainer
|
||||||
}).count;
|
}) as CountResult).count;
|
||||||
}
|
}
|
||||||
|
|
||||||
cleanOldPackages(lastseen) {
|
cleanOldPackages(lastseen: number): Database.RunResult {
|
||||||
return this._queries.REMOVEOLDPACKAGE.run({
|
return this._queries.REMOVEOLDPACKAGE.run({
|
||||||
lastseen
|
lastseen
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
getMaintainerPackageCount(maintainer) {
|
getMaintainerPackageCount(maintainer: string): number {
|
||||||
return this._queries.GETMAINTAINERPACKAGECOUNT.get({
|
return (this._queries.GETMAINTAINERPACKAGECOUNT.get({
|
||||||
maintainer
|
maintainer
|
||||||
}).count;
|
}) as CountResult).count;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
module.exports = DB;
|
export default DB;
|
||||||
|
export { DB };
|
||||||
|
export type { PackageDBEntry, Category };
|
||||||
29
src/index.mts
Normal file
29
src/index.mts
Normal file
@@ -0,0 +1,29 @@
|
|||||||
|
import * as path from 'path';
|
||||||
|
import * as fsp from 'node:fs/promises';
|
||||||
|
import JSON5 from 'json5';
|
||||||
|
import { IRCBot } from './ircBot.mjs';
|
||||||
|
import { Daemon } from './daemon.mjs';
|
||||||
|
import { Web } from './web.mjs';
|
||||||
|
|
||||||
|
const PROJECT_ROOT = path.resolve(import.meta.dirname, '..');
|
||||||
|
const data = await fsp.readFile(process.env['CONFIG'] || path.join(PROJECT_ROOT, 'config', 'config.json'));
|
||||||
|
|
||||||
|
let config = JSON5.parse(data.toString());
|
||||||
|
let arg = process.env['COMPONENT'] || (process.execArgv && process.execArgv[0]);
|
||||||
|
|
||||||
|
if (arg === 'daemon') {
|
||||||
|
const daemon = new Daemon(config);
|
||||||
|
process.on('SIGTERM', daemon.close);
|
||||||
|
}
|
||||||
|
else if (arg === 'ircbot') {
|
||||||
|
const bot = new IRCBot(config);
|
||||||
|
bot.connect();
|
||||||
|
process.on('SIGTERM', bot.close);
|
||||||
|
}
|
||||||
|
else if (arg === 'web') {
|
||||||
|
const web = new Web(config);
|
||||||
|
process.on('SIGTERM', web.close);
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
console.error('Please pass the component you wish to run.');
|
||||||
|
}
|
||||||
@@ -1,21 +1,31 @@
|
|||||||
const IRC = require('irc-framework');
|
import express from 'express';
|
||||||
const express = require('express');
|
import type { Config, AuxiliaryIRCConfig } from './config.js';
|
||||||
|
import type http from "http";
|
||||||
|
// @ts-ignore
|
||||||
|
import IRC from 'irc-framework';
|
||||||
|
|
||||||
class IRCBot {
|
class IRCBot {
|
||||||
|
private _aux: AuxiliaryIRCConfig | undefined;
|
||||||
|
private _channel: string | undefined;
|
||||||
|
private _bot: any;
|
||||||
|
private _enabled: boolean;
|
||||||
|
private _messageQueue: string[];
|
||||||
|
private _webserver: http.Server | undefined;
|
||||||
|
|
||||||
constructor(config) {
|
|
||||||
|
constructor(config: Config) {
|
||||||
const options = config['irc-framework'];
|
const options = config['irc-framework'];
|
||||||
const aux = this._aux = config.ircClient || {};
|
const aux = this._aux = config.ircClient || undefined;
|
||||||
const app = express();
|
const app = express();
|
||||||
const port = process.env.PRIVATEPORT || config.privateport || 8081;
|
const port = process.env['PRIVATEPORT'] || config.privateport || 8081;
|
||||||
this._channel = aux.channel;
|
this._channel = aux?.channel;
|
||||||
this._messageQueue = [];
|
this._messageQueue = [];
|
||||||
this._enabled = !!options;
|
this._enabled = !!options;
|
||||||
|
|
||||||
app.set('trust proxy', 1);
|
app.set('trust proxy', 1);
|
||||||
app.use(express.json());
|
app.use(express.json());
|
||||||
|
|
||||||
app.get('/healthcheck', (req, res) => {
|
app.get('/healthcheck', (_, res) => {
|
||||||
if (this._bot && this._bot.connected) {
|
if (this._bot && this._bot.connected) {
|
||||||
res.send('healthy');
|
res.send('healthy');
|
||||||
}
|
}
|
||||||
@@ -44,22 +54,22 @@ class IRCBot {
|
|||||||
if (options) {
|
if (options) {
|
||||||
const bot = this._bot = new IRC.Client(options);
|
const bot = this._bot = new IRC.Client(options);
|
||||||
|
|
||||||
bot.on('sasl failed', d => console.error(d));
|
bot.on('sasl failed', (d: Error) => console.error(d));
|
||||||
|
|
||||||
bot.on('notice', d => console.log(`irc:notice: ${d.message}`));
|
bot.on('notice', (d: Error) => console.log(`irc:notice: ${d.message}`));
|
||||||
|
|
||||||
bot.on('action', d => console.log(`irc:action: ${d.message}`));
|
bot.on('action', (d: Error) => console.log(`irc:action: ${d.message}`));
|
||||||
|
|
||||||
setInterval(() => this.processMessageQueue(), 2000);
|
setInterval(() => this.processMessageQueue(), 2000);
|
||||||
|
|
||||||
this._webserver = app.listen(port, () => console.log(`artix-packy-notifier-irc running on port ${port}`));
|
this._webserver = app.listen(port, () => console.log(`artix-checkupdates-notifier-irc running on port ${port}`));
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
console.log('"ircClient" not provided in config. IRC notifications will not be delivered.');
|
console.log('"ircClient" not provided in config. IRC notifications will not be delivered.');
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
connect() {
|
connect(): Promise<void> {
|
||||||
return new Promise((resolve, reject) => {
|
return new Promise((resolve, reject) => {
|
||||||
if (this._enabled) {
|
if (this._enabled) {
|
||||||
const bot = this._bot;
|
const bot = this._bot;
|
||||||
@@ -67,7 +77,7 @@ class IRCBot {
|
|||||||
const callback = () => {
|
const callback = () => {
|
||||||
clearTimeout(timeout);
|
clearTimeout(timeout);
|
||||||
console.log(`IRC bot ${bot.user.nick} connected.`);
|
console.log(`IRC bot ${bot.user.nick} connected.`);
|
||||||
bot.join(this._aux.channel, this._aux.channel_key);
|
bot.join(this._aux?.channel, this._aux?.channel_key);
|
||||||
bot.removeListener('registered', callback);
|
bot.removeListener('registered', callback);
|
||||||
resolve();
|
resolve();
|
||||||
};
|
};
|
||||||
@@ -83,7 +93,7 @@ class IRCBot {
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
sendMessage(str) {
|
sendMessage(str: string) {
|
||||||
(this._enabled ? str.split('\n') : []).forEach(line => {
|
(this._enabled ? str.split('\n') : []).forEach(line => {
|
||||||
this._messageQueue.push(line);
|
this._messageQueue.push(line);
|
||||||
});
|
});
|
||||||
@@ -105,4 +115,5 @@ class IRCBot {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
module.exports = IRCBot;
|
export default IRCBot;
|
||||||
|
export { IRCBot };
|
||||||
@@ -1,40 +1,60 @@
|
|||||||
const express = require('express');
|
import fs from 'fs';
|
||||||
const prom = require('prom-client');
|
import * as fsp from 'node:fs/promises';
|
||||||
const sharp = require('sharp');
|
import { DB } from './db.mjs';
|
||||||
const fs = require('fs');
|
import express from 'express';
|
||||||
const path = require('path');
|
import exuseragent from 'express-useragent';
|
||||||
const DB = require('./db');
|
import prom from 'prom-client';
|
||||||
const fsp = fs.promises;
|
import sharp from 'sharp';
|
||||||
|
import * as path from 'path';
|
||||||
|
import type http from "http";
|
||||||
|
import type { Request, Response } from "express";
|
||||||
|
import type { Details } from "express-useragent";
|
||||||
|
import type { Config } from './config.js';
|
||||||
|
import type { PackageDBEntry } from './db.mjs';
|
||||||
|
import type { SaveData } from './daemon.mjs';
|
||||||
|
|
||||||
const PROJECT_ROOT = __dirname;
|
const PROJECT_ROOT = path.resolve(import.meta.dirname, '..');
|
||||||
const VIEWOPTIONS = {
|
const VIEWOPTIONS = {
|
||||||
outputFunctionName: 'echo'
|
outputFunctionName: 'echo'
|
||||||
};
|
};
|
||||||
|
|
||||||
function inliner(file) {
|
type Action = "Move" | "Update";
|
||||||
|
|
||||||
|
type WebPackageObject = {
|
||||||
|
package: string;
|
||||||
|
action: Action;
|
||||||
|
url: string;
|
||||||
|
}
|
||||||
|
|
||||||
|
type ParseablePackage = string | PackageDBEntry;
|
||||||
|
|
||||||
|
function inliner(file: string) {
|
||||||
return fs.readFileSync(path.join(PROJECT_ROOT, file));
|
return fs.readFileSync(path.join(PROJECT_ROOT, file));
|
||||||
}
|
}
|
||||||
|
|
||||||
function packageUrl(p) {
|
function parsePackage(p: ParseablePackage): string {
|
||||||
const packagename = typeof p === 'string' ? p : p.package;
|
return typeof p === 'string' ? p : p.package;
|
||||||
return `https://gitea.artixlinux.org/packages/${packagename}`;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
function prepPackages(arr, action) {
|
function packageUrl(p: ParseablePackage) {
|
||||||
|
return `https://gitea.artixlinux.org/packages/${parsePackage(p)}`;
|
||||||
|
}
|
||||||
|
|
||||||
|
function prepPackages(arr: ParseablePackage[], action: Action): WebPackageObject[] {
|
||||||
return arr.map(m => {
|
return arr.map(m => {
|
||||||
return {
|
return {
|
||||||
package: m,
|
package: parsePackage(m),
|
||||||
action,
|
action,
|
||||||
url: packageUrl(m)
|
url: packageUrl(m)
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
async function createOutlinedText(string, meta, gravity = 'west') {
|
async function createOutlinedText(string: string, meta: sharp.Metadata, gravity: sharp.Gravity = 'west') {
|
||||||
const txt = sharp({
|
const txt = sharp({
|
||||||
create: {
|
create: {
|
||||||
width: meta.width,
|
width: meta.width || 0,
|
||||||
height: meta.height,
|
height: meta.height || 0,
|
||||||
channels: 4,
|
channels: 4,
|
||||||
background: { r: 0, g: 0, b: 0, alpha: 0 }
|
background: { r: 0, g: 0, b: 0, alpha: 0 }
|
||||||
}
|
}
|
||||||
@@ -45,7 +65,7 @@ async function createOutlinedText(string, meta, gravity = 'west') {
|
|||||||
text: string,
|
text: string,
|
||||||
font: 'Visitor TT2 BRK',
|
font: 'Visitor TT2 BRK',
|
||||||
fontfile: path.join(PROJECT_ROOT, 'userbar', 'visitor', 'visitor2.ttf'),
|
fontfile: path.join(PROJECT_ROOT, 'userbar', 'visitor', 'visitor2.ttf'),
|
||||||
width: meta.width,
|
width: meta.width || 0,
|
||||||
dpi: 109,
|
dpi: 109,
|
||||||
rgba: true
|
rgba: true
|
||||||
}
|
}
|
||||||
@@ -90,16 +110,20 @@ async function createOutlinedText(string, meta, gravity = 'west') {
|
|||||||
}
|
}
|
||||||
|
|
||||||
class Web {
|
class Web {
|
||||||
constructor(options) {
|
private _webserver: http.Server;
|
||||||
const db = new DB(process.env.DBPATH || options.db || path.join(__dirname, 'config', 'packages.db'));
|
private _privateserver: http.Server;
|
||||||
|
|
||||||
|
constructor(options: Config) {
|
||||||
|
const db = new DB(process.env['DBPATH'] || options.db || path.join(PROJECT_ROOT, 'config', 'packages.db'));
|
||||||
const app = express();
|
const app = express();
|
||||||
const privateapp = express();
|
const privateapp = express();
|
||||||
const port = process.env.PORT || options.port || 8080;
|
const port = process.env['PORT'] || options.port || 8080;
|
||||||
const privateport = process.env.PRIVATEPORT || options.privateport || 8081;
|
const privateport = process.env['PRIVATEPORT'] || options.privateport || 8081;
|
||||||
const METRICPREFIX = process.env.METRICPREFIX || 'artixpackages_';
|
const METRICPREFIX = process.env['METRICPREFIX'] || 'artixpackages_';
|
||||||
const maintainers = this._maintainers = (options.maintainers || []).map(m => typeof m === 'object' ? m.name : m).sort();
|
const maintainers = (options.maintainers || []).map(m => typeof m === 'object' ? m.name : m).sort();
|
||||||
const savePath = process.env.SAVEPATH || options.savePath || path.join(__dirname, 'config', 'data.json');
|
const savePath = process.env['SAVEPATH'] || options.savePath || path.join(PROJECT_ROOT, 'config', 'data.json');
|
||||||
let saveData = {
|
let saveData: SaveData = {
|
||||||
|
'last-sync': null,
|
||||||
move: [],
|
move: [],
|
||||||
update: []
|
update: []
|
||||||
};
|
};
|
||||||
@@ -108,8 +132,14 @@ class Web {
|
|||||||
app.set('view engine', 'ejs');
|
app.set('view engine', 'ejs');
|
||||||
app.set('view options', VIEWOPTIONS);
|
app.set('view options', VIEWOPTIONS);
|
||||||
|
|
||||||
function sendError(req, res, status, description) {
|
app.use(exuseragent.express());
|
||||||
|
|
||||||
|
function sendError(req: Request, res: Response, status: number, description: string) {
|
||||||
console.log(`${status} (${description}): ${req.url} requested by ${req.ip} "${req.headers['user-agent']}"`);
|
console.log(`${status} (${description}): ${req.url} requested by ${req.ip} "${req.headers['user-agent']}"`);
|
||||||
|
if ((req.useragent as Details).browser === 'curl') {
|
||||||
|
res.send('404: not found\n');
|
||||||
|
return;
|
||||||
|
}
|
||||||
res.render('error',
|
res.render('error',
|
||||||
{
|
{
|
||||||
inliner,
|
inliner,
|
||||||
@@ -133,16 +163,26 @@ class Web {
|
|||||||
}
|
}
|
||||||
|
|
||||||
async function readSave() {
|
async function readSave() {
|
||||||
saveData = JSON.parse(await fsp.readFile(savePath));
|
saveData = JSON.parse((await fsp.readFile(savePath)).toString());
|
||||||
|
}
|
||||||
|
|
||||||
|
function renderForCurl(packages: WebPackageObject[]) {
|
||||||
|
const colHeader = 'Package basename';
|
||||||
|
const tabSize = packages.reduce((acc, cur) => Math.max(acc, cur.package?.length || 0), colHeader.length) + 4;
|
||||||
|
return `${colHeader.padEnd(tabSize, ' ')}Action\n${packages.map(p => `${p.package?.padEnd(tabSize, ' ')}${p.action}`).join('\n')}\n`;
|
||||||
}
|
}
|
||||||
|
|
||||||
app.get('/healthcheck', async (_, res) => {
|
app.get('/healthcheck', async (_, res) => {
|
||||||
res.send('Healthy');
|
res.send('Healthy');
|
||||||
});
|
});
|
||||||
|
|
||||||
app.get('/', async (_, res) => {
|
app.get('/', async (req, res) => {
|
||||||
let packages = prepPackages(saveData.move, 'Move');
|
let packages = prepPackages(saveData.move, 'Move');
|
||||||
packages = packages.concat(prepPackages(saveData.update, 'Update'));
|
packages = packages.concat(prepPackages(saveData.update, 'Update'));
|
||||||
|
if ((req.useragent as Details).browser === 'curl') {
|
||||||
|
res.send(renderForCurl(packages));
|
||||||
|
return;
|
||||||
|
}
|
||||||
res.render('index',
|
res.render('index',
|
||||||
{
|
{
|
||||||
inliner,
|
inliner,
|
||||||
@@ -171,6 +211,10 @@ class Web {
|
|||||||
let packages = prepPackages(db.getPackagesByMaintainer(maintainer, 'move'), 'Move');
|
let packages = prepPackages(db.getPackagesByMaintainer(maintainer, 'move'), 'Move');
|
||||||
packages = packages.concat(prepPackages(db.getPackagesByMaintainer(maintainer, 'udate'), 'Update'));
|
packages = packages.concat(prepPackages(db.getPackagesByMaintainer(maintainer, 'udate'), 'Update'));
|
||||||
if (packagesOwned > 0) {
|
if (packagesOwned > 0) {
|
||||||
|
if ((req.useragent as Details).browser === 'curl') {
|
||||||
|
res.send(`${maintainer}'s pending actions\n\n${renderForCurl(packages)}`);
|
||||||
|
return;
|
||||||
|
}
|
||||||
res.render('maintainer',
|
res.render('maintainer',
|
||||||
{
|
{
|
||||||
inliner,
|
inliner,
|
||||||
@@ -203,7 +247,7 @@ class Web {
|
|||||||
const packagesOwned = db.getMaintainerPackageCount(maintainer);
|
const packagesOwned = db.getMaintainerPackageCount(maintainer);
|
||||||
if (packagesOwned > 0) {
|
if (packagesOwned > 0) {
|
||||||
const img = sharp(path.join(PROJECT_ROOT, 'userbar', 'userbar.png'));
|
const img = sharp(path.join(PROJECT_ROOT, 'userbar', 'userbar.png'));
|
||||||
const meta = await img.metadata();
|
const meta: sharp.Metadata = await img.metadata();
|
||||||
|
|
||||||
const layers = [
|
const layers = [
|
||||||
{
|
{
|
||||||
@@ -249,7 +293,7 @@ class Web {
|
|||||||
|
|
||||||
app.get('/api/1.0/packages', (req, res) => {
|
app.get('/api/1.0/packages', (req, res) => {
|
||||||
const acceptHeader = req.headers.accept;
|
const acceptHeader = req.headers.accept;
|
||||||
const startsWith = req.query.startswith;
|
const startsWith = req.query['startswith'] as string;
|
||||||
const packages = db.getPackages(startsWith);
|
const packages = db.getPackages(startsWith);
|
||||||
res.set('Cache-Control', 'public, max-age=360');
|
res.set('Cache-Control', 'public, max-age=360');
|
||||||
if (acceptHeader && acceptHeader.includes('application/json')) {
|
if (acceptHeader && acceptHeader.includes('application/json')) {
|
||||||
@@ -262,14 +306,14 @@ class Web {
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
privateapp.put('/api/1.0/data', (req, res) => {
|
privateapp.put('/api/1.0/data', (_, res) => {
|
||||||
try {
|
try {
|
||||||
readSave();
|
readSave();
|
||||||
res.json({
|
res.json({
|
||||||
success: true
|
success: true
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
catch(ex) {
|
catch (ex) {
|
||||||
console.error(ex);
|
console.error(ex);
|
||||||
res.status(500).json({
|
res.status(500).json({
|
||||||
success: false,
|
success: false,
|
||||||
@@ -325,7 +369,7 @@ class Web {
|
|||||||
res.end(await register.metrics());
|
res.end(await register.metrics());
|
||||||
}
|
}
|
||||||
catch (ex) {
|
catch (ex) {
|
||||||
console.error(err);
|
console.error(ex);
|
||||||
res.status(500).send('something went wrong.');
|
res.status(500).send('something went wrong.');
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
@@ -340,7 +384,7 @@ class Web {
|
|||||||
|
|
||||||
readSave();
|
readSave();
|
||||||
|
|
||||||
this._webserver = app.listen(port, () => console.log(`artix-packy-notifier-web running on port ${port}`));
|
this._webserver = app.listen(port, () => console.log(`artix-checkupdates-web running on port ${port}`));
|
||||||
this._privateserver = privateapp.listen(privateport);
|
this._privateserver = privateapp.listen(privateport);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -350,4 +394,5 @@ class Web {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
module.exports = Web;
|
export default Web;
|
||||||
|
export { Web };
|
||||||
12
tsconfig.dist.json
Normal file
12
tsconfig.dist.json
Normal file
@@ -0,0 +1,12 @@
|
|||||||
|
{
|
||||||
|
"extends": "./tsconfig",
|
||||||
|
"compilerOptions": {
|
||||||
|
"sourceMap": true,
|
||||||
|
"inlineSources": true,
|
||||||
|
"rootDir": "./src",
|
||||||
|
"outDir": "./distribution"
|
||||||
|
},
|
||||||
|
"include": [
|
||||||
|
"src"
|
||||||
|
]
|
||||||
|
}
|
||||||
10
tsconfig.json
Normal file
10
tsconfig.json
Normal file
@@ -0,0 +1,10 @@
|
|||||||
|
{
|
||||||
|
"extends": "@sindresorhus/tsconfig",
|
||||||
|
"compilerOptions": {
|
||||||
|
"exactOptionalPropertyTypes": true,
|
||||||
|
"esModuleInterop": true
|
||||||
|
},
|
||||||
|
"include": [
|
||||||
|
"src"
|
||||||
|
]
|
||||||
|
}
|
||||||
@@ -3,7 +3,7 @@
|
|||||||
<ul>
|
<ul>
|
||||||
<li>© <%= (new Date()).getFullYear() %> Artix Linux</li>
|
<li>© <%= (new Date()).getFullYear() %> Artix Linux</li>
|
||||||
<li>Developed by Cory Sanin</li>
|
<li>Developed by Cory Sanin</li>
|
||||||
<li><a href="https://gitea.artixlinux.org/corysanin/artix-packy-notifier">Source</a></li>
|
<li><a href="https://github.com/CorySanin/artix-checkupdates-web">Source</a></li>
|
||||||
</ul>
|
</ul>
|
||||||
</footer>
|
</footer>
|
||||||
</div>
|
</div>
|
||||||
@@ -24,7 +24,7 @@
|
|||||||
</tr>
|
</tr>
|
||||||
<% packages && packages.forEach(p => { %>
|
<% packages && packages.forEach(p => { %>
|
||||||
<tr>
|
<tr>
|
||||||
<td><a href="<%= p.url %>"><%= p.package.package %></a></td>
|
<td><a href="<%= p.url %>"><%= p.package %></a></td>
|
||||||
<td><%= p.action %></td>
|
<td><%= p.action %></td>
|
||||||
</tr>
|
</tr>
|
||||||
<% }); %>
|
<% }); %>
|
||||||
|
|||||||
Reference in New Issue
Block a user