Compare commits
24 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| d803a58ab8 | |||
| 7bd8bf4d85 | |||
| a7e72f273f | |||
| b926b303c5 | |||
| d14ccdf939 | |||
| 259f439101 | |||
| 1f454fa656 | |||
| 18c0e27da4 | |||
| d34b41b899 | |||
| 9fe86c4114 | |||
| 3b5ff4cf41 | |||
| 7b51f818d7 | |||
| 5a16695338 | |||
| a5c77c1440 | |||
| a6d35036f3 | |||
| abceb07c1a | |||
| 2c71563efc | |||
| f39ce0977f | |||
| 45ebb7d9cf | |||
| fe49302eca | |||
| 77441fe7ed | |||
| b20bbf40fc | |||
| 24d7b37583 | |||
| 5e95f22245 |
@@ -5,7 +5,7 @@ on:
|
||||
branches: [ master ]
|
||||
push:
|
||||
branches: [ master ]
|
||||
paths: [ docker/*, docker/scripts/* ]
|
||||
paths: [ docker/** ]
|
||||
pull_request:
|
||||
branches: [ master ]
|
||||
paths: [ docker/* ]
|
||||
|
||||
@@ -4,6 +4,12 @@
|
||||
"password": "correcthorse"
|
||||
},
|
||||
"web": {
|
||||
"port": 8080
|
||||
"port": 8080,
|
||||
"oidc": {
|
||||
"server": "https://gitea.artixlinux.org/",
|
||||
"clientId": "fakefake-fake-fake-fake-fakefakefake",
|
||||
"clientSecret": "thisisnotarealsecret",
|
||||
"appBaseUrl": "http://localhost:8080"
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,12 +1,16 @@
|
||||
FROM archlinux/archlinux:base-devel
|
||||
|
||||
COPY scripts/entrypoint.sh /scripts/entrypoint.sh
|
||||
COPY scripts/pacman.conf.arch/* /scripts/pacman.conf/
|
||||
COPY scripts/pacman.conf.arch/pacman.conf.pl /scripts/pacman.conf.pl
|
||||
|
||||
ARG MIRROR=https://mirror.sanin.dev/arch-linux/\$repo/os/\$arch
|
||||
ARG BUILDMIRROR=https://mirror.sanin.dev/arch-linux/\$repo/os/\$arch
|
||||
|
||||
RUN sed -i "1iServer = $MIRROR" /etc/pacman.d/mirrorlist && \
|
||||
RUN cp /etc/pacman.d/mirrorlist /etc/pacman.d/mirrorlist.bak && \
|
||||
sed -i "1iServer = $BUILDMIRROR" /etc/pacman.d/mirrorlist && \
|
||||
pacman -Syu --noconfirm git clang sudo devtools vim bash-completion && \
|
||||
pacman -Scc --noconfirm && \
|
||||
rm -rf /var/lib/pacman/sync /var/cache/pacman/pkg && \
|
||||
mv /etc/pacman.d/mirrorlist.bak /etc/pacman.d/mirrorlist && \
|
||||
git config --global init.defaultBranch "master" && \
|
||||
chmod +x /scripts/* && \
|
||||
useradd -m user && \
|
||||
|
||||
@@ -1,12 +1,16 @@
|
||||
FROM artixlinux/artixlinux:base-devel
|
||||
|
||||
COPY scripts/entrypoint.sh /scripts/entrypoint.sh
|
||||
COPY scripts/pacman.conf.artix/* /scripts/pacman.conf/
|
||||
COPY scripts/pacman.conf.artix/pacman.conf.pl /scripts/pacman.conf.pl
|
||||
|
||||
ARG MIRROR=https://mirror.sanin.dev/artix-linux/\$repo/os/\$arch
|
||||
ARG BUILDMIRROR=https://mirror.sanin.dev/artix-linux/\$repo/os/\$arch
|
||||
|
||||
RUN sed -i "1iServer = $MIRROR" /etc/pacman.d/mirrorlist && \
|
||||
RUN cp /etc/pacman.d/mirrorlist /etc/pacman.d/mirrorlist.bak && \
|
||||
sed -i "1iServer = $BUILDMIRROR" /etc/pacman.d/mirrorlist && \
|
||||
pacman -Syu --noconfirm git clang sudo vim glibc openssh bash-completion && \
|
||||
pacman -Scc --noconfirm && \
|
||||
rm -rf /var/lib/pacman/sync /var/cache/pacman/pkg && \
|
||||
mv /etc/pacman.d/mirrorlist.bak /etc/pacman.d/mirrorlist && \
|
||||
git config --global init.defaultBranch "master" && \
|
||||
chmod +x /scripts/* && \
|
||||
useradd -m user && \
|
||||
|
||||
@@ -1,15 +1,19 @@
|
||||
#!/bin/sh
|
||||
|
||||
if [ -n "$DEP" ] && [ "$DEP" != "stable" ]
|
||||
/scripts/pacman.conf.pl | sudo tee "/etc/pacman.conf" > /dev/null
|
||||
|
||||
if [ -n "$MIRROR" ]
|
||||
then
|
||||
sudo cp "/scripts/pacman.conf/pacman.$DEP.conf" "/etc/pacman.conf" && \
|
||||
sudo pacman -Syu --noconfirm --noprogressbar
|
||||
sudo sed -i "1iServer = $MIRROR" /etc/pacman.d/mirrorlist
|
||||
fi
|
||||
|
||||
|
||||
if [ -z "$REPO" ]
|
||||
then
|
||||
/bin/bash
|
||||
exit $?;
|
||||
else
|
||||
sudo pacman -Syu --noconfirm --noprogressbar
|
||||
fi
|
||||
|
||||
checkoutCommit() {
|
||||
@@ -27,6 +31,21 @@ applyPatch() {
|
||||
fi
|
||||
}
|
||||
|
||||
postEntrypoint() {
|
||||
if [ -n "$POST" ] && [ -x "./post-entrypoint.sh" ] ; then
|
||||
echo "EXECUTING POSTENTRY"
|
||||
./post-entrypoint.sh
|
||||
fi
|
||||
}
|
||||
|
||||
doBuild() {
|
||||
if [ -n "$POST" ] && [ -x "./post-entrypoint.sh" ] ; then
|
||||
makepkg -smf --noconfirm --noprogressbar --skippgpcheck
|
||||
else
|
||||
makepkg -smf --noconfirm --noprogressbar --skippgpcheck --noarchive
|
||||
fi
|
||||
}
|
||||
|
||||
changeDir() {
|
||||
if [ -n "$CD" ]
|
||||
then
|
||||
@@ -34,11 +53,15 @@ changeDir() {
|
||||
fi
|
||||
}
|
||||
|
||||
# Clone the git repo
|
||||
git clone "$REPO" /home/user/pkg && \
|
||||
cd /home/user/pkg && \
|
||||
DIR="${WORKSPACE:-/home/user/pkg}"
|
||||
|
||||
if [ ! -d "$DIR" ]; then
|
||||
git clone "$REPO" "$DIR" || exit $?
|
||||
fi
|
||||
cd "$DIR" && \
|
||||
checkoutCommit && \
|
||||
applyPatch && \
|
||||
sudo pacman -Syu --noconfirm --noprogressbar &&\
|
||||
makepkg -smf --noconfirm --noprogressbar --skippgpcheck --noarchive
|
||||
doBuild && \
|
||||
postEntrypoint
|
||||
exit $?;
|
||||
|
||||
48
docker/scripts/pacman.conf.arch/pacman.staging.conf → docker/scripts/pacman.conf.arch/pacman.conf.pl
Normal file → Executable file
48
docker/scripts/pacman.conf.arch/pacman.staging.conf → docker/scripts/pacman.conf.arch/pacman.conf.pl
Normal file → Executable file
@@ -1,3 +1,12 @@
|
||||
#!/usr/bin/env perl
|
||||
use strict;
|
||||
use warnings;
|
||||
|
||||
my $dep = $ENV{DEP} // 'stable';
|
||||
my $tier = $ENV{TIER} // '2';
|
||||
|
||||
#region header
|
||||
print <<'EOHEADER';
|
||||
#
|
||||
# /etc/pacman.conf
|
||||
#
|
||||
@@ -12,24 +21,61 @@ DownloadUser = alpm
|
||||
SigLevel = Required DatabaseOptional
|
||||
LocalFileSigLevel = Optional
|
||||
|
||||
EOHEADER
|
||||
#endregion
|
||||
|
||||
#region core
|
||||
if ($dep eq 'staging') {
|
||||
print <<'EOCORESTAGING';
|
||||
[core-staging]
|
||||
Include = /etc/pacman.d/mirrorlist
|
||||
|
||||
EOCORESTAGING
|
||||
}
|
||||
|
||||
if ($dep eq 'staging' || $dep eq 'testing') {
|
||||
print <<'EOCORETESTING';
|
||||
[core-testing]
|
||||
Include = /etc/pacman.d/mirrorlist
|
||||
|
||||
EOCORETESTING
|
||||
}
|
||||
|
||||
print <<'EOCORE';
|
||||
[core]
|
||||
Include = /etc/pacman.d/mirrorlist
|
||||
|
||||
EOCORE
|
||||
#endregion
|
||||
|
||||
#region extra
|
||||
if ($tier ne '0') {
|
||||
if ($dep eq 'staging') {
|
||||
print <<'EOEXTRASTAGING';
|
||||
[extra-staging]
|
||||
Include = /etc/pacman.d/mirrorlist
|
||||
|
||||
EOEXTRASTAGING
|
||||
}
|
||||
|
||||
if ($dep eq 'staging' || $dep eq 'testing') {
|
||||
print <<'EOEXTRATESTING';
|
||||
[extra-testing]
|
||||
Include = /etc/pacman.d/mirrorlist
|
||||
|
||||
EOEXTRATESTING
|
||||
}
|
||||
|
||||
print <<'EOEXTRA';
|
||||
[extra]
|
||||
Include = /etc/pacman.d/mirrorlist
|
||||
|
||||
EOEXTRA
|
||||
}
|
||||
#endregion
|
||||
|
||||
#region options
|
||||
print <<'EOOPTIONS';
|
||||
[options]
|
||||
NoExtract = usr/share/help/* !usr/share/help/en* !usr/share/help/C/*
|
||||
NoExtract = usr/share/gtk-doc/html/* usr/share/doc/*
|
||||
@@ -43,3 +89,5 @@ NoExtract = !usr/share/*locales/C !usr/share/*locales/POSIX !usr/share/i18n/cha
|
||||
NoExtract = usr/share/man/* usr/share/info/*
|
||||
NoExtract = usr/share/vim/vim*/lang/*
|
||||
NoExtract = etc/pacman.conf etc/pacman.d/mirrorlist
|
||||
EOOPTIONS
|
||||
#endregion
|
||||
@@ -1,40 +0,0 @@
|
||||
#
|
||||
# /etc/pacman.conf
|
||||
#
|
||||
|
||||
[options]
|
||||
HoldPkg = pacman glibc
|
||||
Architecture = auto
|
||||
NoProgressBar
|
||||
VerbosePkgLists
|
||||
ParallelDownloads = 5
|
||||
DownloadUser = alpm
|
||||
SigLevel = Required DatabaseOptional
|
||||
LocalFileSigLevel = Optional
|
||||
|
||||
|
||||
[core-testing]
|
||||
Include = /etc/pacman.d/mirrorlist
|
||||
|
||||
[core]
|
||||
Include = /etc/pacman.d/mirrorlist
|
||||
|
||||
[extra-testing]
|
||||
Include = /etc/pacman.d/mirrorlist
|
||||
|
||||
[extra]
|
||||
Include = /etc/pacman.d/mirrorlist
|
||||
|
||||
[options]
|
||||
NoExtract = usr/share/help/* !usr/share/help/en* !usr/share/help/C/*
|
||||
NoExtract = usr/share/gtk-doc/html/* usr/share/doc/*
|
||||
NoExtract = usr/share/locale/* usr/share/X11/locale/* usr/share/i18n/*
|
||||
NoExtract = !*locale*/en*/* !usr/share/i18n/charmaps/UTF-8.gz !usr/share/*locale*/locale.*
|
||||
NoExtract = !usr/share/*locales/en_?? !usr/share/*locales/i18n* !usr/share/*locales/iso*
|
||||
NoExtract = !usr/share/*locales/trans*
|
||||
NoExtract = !usr/share/X11/locale/C/*
|
||||
NoExtract = !usr/share/X11/locale/compose.dir !usr/share/X11/locale/iso8859-1/*
|
||||
NoExtract = !usr/share/*locales/C !usr/share/*locales/POSIX !usr/share/i18n/charmaps/ANSI_X3.4-1968.gz
|
||||
NoExtract = usr/share/man/* usr/share/info/*
|
||||
NoExtract = usr/share/vim/vim*/lang/*
|
||||
NoExtract = etc/pacman.conf etc/pacman.d/mirrorlist
|
||||
65
docker/scripts/pacman.conf.artix/pacman.staging.conf → docker/scripts/pacman.conf.artix/pacman.conf.pl
Normal file → Executable file
65
docker/scripts/pacman.conf.artix/pacman.staging.conf → docker/scripts/pacman.conf.artix/pacman.conf.pl
Normal file → Executable file
@@ -1,3 +1,12 @@
|
||||
#!/usr/bin/env perl
|
||||
use strict;
|
||||
use warnings;
|
||||
|
||||
my $dep = $ENV{DEP} // 'stable';
|
||||
my $tier = $ENV{TIER} // '2';
|
||||
|
||||
#region header
|
||||
print <<'EOHEADER';
|
||||
#
|
||||
# /etc/pacman.conf
|
||||
#
|
||||
@@ -12,33 +21,87 @@ DownloadUser = alpm
|
||||
SigLevel = Required DatabaseOptional
|
||||
LocalFileSigLevel = Optional
|
||||
|
||||
EOHEADER
|
||||
#endregion
|
||||
|
||||
#region system
|
||||
if ($dep eq 'staging') {
|
||||
print <<'EOSYSTEMSTAGING';
|
||||
[system-goblins]
|
||||
Include = /etc/pacman.d/mirrorlist
|
||||
|
||||
EOSYSTEMSTAGING
|
||||
}
|
||||
|
||||
if ($dep eq 'staging' || $dep eq 'testing') {
|
||||
print <<'EOSYSTEMTESTING';
|
||||
[system-gremlins]
|
||||
Include = /etc/pacman.d/mirrorlist
|
||||
|
||||
EOSYSTEMTESTING
|
||||
}
|
||||
|
||||
print <<'EOSYSTEM';
|
||||
[system]
|
||||
Include = /etc/pacman.d/mirrorlist
|
||||
|
||||
EOSYSTEM
|
||||
#endregion
|
||||
|
||||
#region world
|
||||
if ($tier ne '0') {
|
||||
if ($dep eq 'staging') {
|
||||
print <<'EOWORLDSTAGING';
|
||||
[world-goblins]
|
||||
Include = /etc/pacman.d/mirrorlist
|
||||
|
||||
EOWORLDSTAGING
|
||||
}
|
||||
|
||||
if ($dep eq 'staging' || $dep eq 'testing') {
|
||||
print <<'EOWORLDTESTING';
|
||||
[world-gremlins]
|
||||
Include = /etc/pacman.d/mirrorlist
|
||||
|
||||
EOWORLDTESTING
|
||||
}
|
||||
|
||||
print <<'EOWORLD';
|
||||
[world]
|
||||
Include = /etc/pacman.d/mirrorlist
|
||||
|
||||
EOWORLD
|
||||
}
|
||||
#endregion
|
||||
|
||||
#region galaxy
|
||||
if ($tier eq '2') {
|
||||
if ($dep eq 'staging') {
|
||||
print <<'EOGALAXYSTAGING';
|
||||
[galaxy-goblins]
|
||||
Include = /etc/pacman.d/mirrorlist
|
||||
|
||||
EOGALAXYSTAGING
|
||||
}
|
||||
|
||||
if ($dep eq 'staging' || $dep eq 'testing') {
|
||||
print <<'EOGALAXYTESTING';
|
||||
[galaxy-gremlins]
|
||||
Include = /etc/pacman.d/mirrorlist
|
||||
|
||||
EOGALAXYTESTING
|
||||
}
|
||||
|
||||
print <<'EOGALAXY';
|
||||
[galaxy]
|
||||
Include = /etc/pacman.d/mirrorlist
|
||||
|
||||
EOGALAXY
|
||||
}
|
||||
#endregion
|
||||
|
||||
#region options
|
||||
print <<'EOOPTIONS';
|
||||
[options]
|
||||
NoExtract = usr/share/help/* !usr/share/help/en* !usr/share/help/C/*
|
||||
NoExtract = usr/share/gtk-doc/html/* usr/share/doc/*
|
||||
@@ -51,3 +114,5 @@ NoExtract = !usr/share/X11/locale/compose.dir !usr/share/X11/locale/iso8859-1/
|
||||
NoExtract = !usr/share/*locales/C !usr/share/*locales/POSIX !usr/share/i18n/charmaps/ANSI_X3.4-1968.gz
|
||||
NoExtract = usr/share/man/* usr/share/info/*
|
||||
NoExtract = usr/share/vim/vim*/lang/*
|
||||
EOOPTIONS
|
||||
#endregion
|
||||
@@ -1,44 +0,0 @@
|
||||
#
|
||||
# /etc/pacman.conf
|
||||
#
|
||||
|
||||
[options]
|
||||
HoldPkg = pacman glibc
|
||||
Architecture = auto
|
||||
NoProgressBar
|
||||
VerbosePkgLists
|
||||
ParallelDownloads = 5
|
||||
DownloadUser = alpm
|
||||
SigLevel = Required DatabaseOptional
|
||||
LocalFileSigLevel = Optional
|
||||
|
||||
[system-gremlins]
|
||||
Include = /etc/pacman.d/mirrorlist
|
||||
|
||||
[system]
|
||||
Include = /etc/pacman.d/mirrorlist
|
||||
|
||||
[world-gremlins]
|
||||
Include = /etc/pacman.d/mirrorlist
|
||||
|
||||
[world]
|
||||
Include = /etc/pacman.d/mirrorlist
|
||||
|
||||
[galaxy-gremlins]
|
||||
Include = /etc/pacman.d/mirrorlist
|
||||
|
||||
[galaxy]
|
||||
Include = /etc/pacman.d/mirrorlist
|
||||
|
||||
[options]
|
||||
NoExtract = usr/share/help/* !usr/share/help/en* !usr/share/help/C/*
|
||||
NoExtract = usr/share/gtk-doc/html/* usr/share/doc/*
|
||||
NoExtract = usr/share/locale/* usr/share/X11/locale/* usr/share/i18n/*
|
||||
NoExtract = !*locale*/en*/* !usr/share/i18n/charmaps/UTF-8.gz !usr/share/*locale*/locale.*
|
||||
NoExtract = !usr/share/*locales/en_?? !usr/share/*locales/i18n* !usr/share/*locales/iso*
|
||||
NoExtract = !usr/share/*locales/trans*
|
||||
NoExtract = !usr/share/X11/locale/C/*
|
||||
NoExtract = !usr/share/X11/locale/compose.dir !usr/share/X11/locale/iso8859-1/*
|
||||
NoExtract = !usr/share/*locales/C !usr/share/*locales/POSIX !usr/share/i18n/charmaps/ANSI_X3.4-1968.gz
|
||||
NoExtract = usr/share/man/* usr/share/info/*
|
||||
NoExtract = usr/share/vim/vim*/lang/*
|
||||
335
package-lock.json
generated
335
package-lock.json
generated
@@ -1,31 +1,38 @@
|
||||
{
|
||||
"name": "archery",
|
||||
"version": "0.1.8",
|
||||
"version": "0.3.0",
|
||||
"lockfileVersion": 3,
|
||||
"requires": true,
|
||||
"packages": {
|
||||
"": {
|
||||
"name": "archery",
|
||||
"version": "0.1.8",
|
||||
"version": "0.3.0",
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"body-parser": "^2.2.0",
|
||||
"body-parser": "^2.2.1",
|
||||
"ejs": "3.1.10",
|
||||
"express": "^5.1.0",
|
||||
"express-session": "1.18.2",
|
||||
"express-ws": "^5.0.2",
|
||||
"ky": "1.14.0",
|
||||
"passport": "0.7.0",
|
||||
"passport-openidconnect": "0.1.2",
|
||||
"pg": "^8.16.3",
|
||||
"pg-hstore": "^2.3.4",
|
||||
"sequelize": "^6.37.7",
|
||||
"sqids": "0.3.0"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@types/express": "^5.0.3",
|
||||
"@types/express-ws": "3.0.5",
|
||||
"@types/node": "^24.5.2",
|
||||
"forking-build-shit": "1.0.4"
|
||||
"@types/express": "^5.0.5",
|
||||
"@types/express-session": "^1.18.2",
|
||||
"@types/express-ws": "3.0.6",
|
||||
"@types/node": "^24.10.1",
|
||||
"@types/passport": "1.0.17",
|
||||
"@types/passport-openidconnect": "0.1.3",
|
||||
"forking-build-shit": "1.0.5"
|
||||
},
|
||||
"peerDependencies": {
|
||||
"typescript": "5.7.3"
|
||||
"typescript": "5.9.3"
|
||||
}
|
||||
},
|
||||
"node_modules/@parcel/watcher": {
|
||||
@@ -369,15 +376,15 @@
|
||||
}
|
||||
},
|
||||
"node_modules/@types/express": {
|
||||
"version": "5.0.3",
|
||||
"resolved": "https://registry.npmjs.org/@types/express/-/express-5.0.3.tgz",
|
||||
"integrity": "sha512-wGA0NX93b19/dZC1J18tKWVIYWyyF2ZjT9vin/NRu0qzzvfVzWjs04iq2rQ3H65vCTQYlRqs3YHfY7zjdV+9Kw==",
|
||||
"version": "5.0.5",
|
||||
"resolved": "https://registry.npmjs.org/@types/express/-/express-5.0.5.tgz",
|
||||
"integrity": "sha512-LuIQOcb6UmnF7C1PCFmEU1u2hmiHL43fgFQX67sN3H4Z+0Yk0Neo++mFsBjhOAuLzvlQeqAAkeDOZrJs9rzumQ==",
|
||||
"dev": true,
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"@types/body-parser": "*",
|
||||
"@types/express-serve-static-core": "^5.0.0",
|
||||
"@types/serve-static": "*"
|
||||
"@types/serve-static": "^1"
|
||||
}
|
||||
},
|
||||
"node_modules/@types/express-serve-static-core": {
|
||||
@@ -393,10 +400,20 @@
|
||||
"@types/send": "*"
|
||||
}
|
||||
},
|
||||
"node_modules/@types/express-session": {
|
||||
"version": "1.18.2",
|
||||
"resolved": "https://registry.npmjs.org/@types/express-session/-/express-session-1.18.2.tgz",
|
||||
"integrity": "sha512-k+I0BxwVXsnEU2hV77cCobC08kIsn4y44C3gC0b46uxZVMaXA04lSPgRLR/bSL2w0t0ShJiG8o4jPzRG/nscFg==",
|
||||
"dev": true,
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"@types/express": "*"
|
||||
}
|
||||
},
|
||||
"node_modules/@types/express-ws": {
|
||||
"version": "3.0.5",
|
||||
"resolved": "https://registry.npmjs.org/@types/express-ws/-/express-ws-3.0.5.tgz",
|
||||
"integrity": "sha512-lbWMjoHrm/v85j81UCmb/GNZFO3genxRYBW1Ob7rjRI+zxUBR+4tcFuOpKKsYQ1LYTYiy3356epLeYi/5zxUwA==",
|
||||
"version": "3.0.6",
|
||||
"resolved": "https://registry.npmjs.org/@types/express-ws/-/express-ws-3.0.6.tgz",
|
||||
"integrity": "sha512-6ZDt+tMEQgM4RC1sMX1fIO7kHQkfUDlWfxoPddXUeeDjmc+Yt/fCzqXfp8rFahNr5eIxdomrWphLEWDkB2q3UQ==",
|
||||
"dev": true,
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
@@ -426,12 +443,56 @@
|
||||
"license": "MIT"
|
||||
},
|
||||
"node_modules/@types/node": {
|
||||
"version": "24.5.2",
|
||||
"resolved": "https://registry.npmjs.org/@types/node/-/node-24.5.2.tgz",
|
||||
"integrity": "sha512-FYxk1I7wPv3K2XBaoyH2cTnocQEu8AOZ60hPbsyukMPLv5/5qr7V1i8PLHdl6Zf87I+xZXFvPCXYjiTFq+YSDQ==",
|
||||
"version": "24.10.1",
|
||||
"resolved": "https://registry.npmjs.org/@types/node/-/node-24.10.1.tgz",
|
||||
"integrity": "sha512-GNWcUTRBgIRJD5zj+Tq0fKOJ5XZajIiBroOF0yvj2bSU1WvNdYS/dn9UxwsujGW4JX06dnHyjV2y9rRaybH0iQ==",
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"undici-types": "~7.12.0"
|
||||
"undici-types": "~7.16.0"
|
||||
}
|
||||
},
|
||||
"node_modules/@types/oauth": {
|
||||
"version": "0.9.6",
|
||||
"resolved": "https://registry.npmjs.org/@types/oauth/-/oauth-0.9.6.tgz",
|
||||
"integrity": "sha512-H9TRCVKBNOhZZmyHLqFt9drPM9l+ShWiqqJijU1B8P3DX3ub84NjxDuy+Hjrz+fEca5Kwip3qPMKNyiLgNJtIA==",
|
||||
"dev": true,
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"@types/node": "*"
|
||||
}
|
||||
},
|
||||
"node_modules/@types/passport": {
|
||||
"version": "1.0.17",
|
||||
"resolved": "https://registry.npmjs.org/@types/passport/-/passport-1.0.17.tgz",
|
||||
"integrity": "sha512-aciLyx+wDwT2t2/kJGJR2AEeBz0nJU4WuRX04Wu9Dqc5lSUtwu0WERPHYsLhF9PtseiAMPBGNUOtFjxZ56prsg==",
|
||||
"dev": true,
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"@types/express": "*"
|
||||
}
|
||||
},
|
||||
"node_modules/@types/passport-openidconnect": {
|
||||
"version": "0.1.3",
|
||||
"resolved": "https://registry.npmjs.org/@types/passport-openidconnect/-/passport-openidconnect-0.1.3.tgz",
|
||||
"integrity": "sha512-k1Ni7bG/9OZNo2Qpjg2W6GajL+pww6ZPaNWMXfpteCX4dXf4QgaZLt2hjR5IiPrqwBT9+W8KjCTJ/uhGIoBx/g==",
|
||||
"dev": true,
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"@types/express": "*",
|
||||
"@types/oauth": "*",
|
||||
"@types/passport": "*",
|
||||
"@types/passport-strategy": "*"
|
||||
}
|
||||
},
|
||||
"node_modules/@types/passport-strategy": {
|
||||
"version": "0.2.38",
|
||||
"resolved": "https://registry.npmjs.org/@types/passport-strategy/-/passport-strategy-0.2.38.tgz",
|
||||
"integrity": "sha512-GC6eMqqojOooq993Tmnmp7AUTbbQSgilyvpCYQjT+H6JfG/g6RGc7nXEniZlp0zyKJ0WUdOiZWLBZft9Yug1uA==",
|
||||
"dev": true,
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"@types/express": "*",
|
||||
"@types/passport": "*"
|
||||
}
|
||||
},
|
||||
"node_modules/@types/qs": {
|
||||
@@ -528,23 +589,27 @@
|
||||
"license": "MIT"
|
||||
},
|
||||
"node_modules/body-parser": {
|
||||
"version": "2.2.0",
|
||||
"resolved": "https://registry.npmjs.org/body-parser/-/body-parser-2.2.0.tgz",
|
||||
"integrity": "sha512-02qvAaxv8tp7fBa/mw1ga98OGm+eCbqzJOKoRt70sLmfEEi+jyBYVTDGfCL/k06/4EMk/z01gCe7HoCH/f2LTg==",
|
||||
"version": "2.2.1",
|
||||
"resolved": "https://registry.npmjs.org/body-parser/-/body-parser-2.2.1.tgz",
|
||||
"integrity": "sha512-nfDwkulwiZYQIGwxdy0RUmowMhKcFVcYXUU7m4QlKYim1rUtg83xm2yjZ40QjDuc291AJjjeSc9b++AWHSgSHw==",
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"bytes": "^3.1.2",
|
||||
"content-type": "^1.0.5",
|
||||
"debug": "^4.4.0",
|
||||
"debug": "^4.4.3",
|
||||
"http-errors": "^2.0.0",
|
||||
"iconv-lite": "^0.6.3",
|
||||
"iconv-lite": "^0.7.0",
|
||||
"on-finished": "^2.4.1",
|
||||
"qs": "^6.14.0",
|
||||
"raw-body": "^3.0.0",
|
||||
"type-is": "^2.0.0"
|
||||
"raw-body": "^3.0.1",
|
||||
"type-is": "^2.0.1"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">=18"
|
||||
},
|
||||
"funding": {
|
||||
"type": "opencollective",
|
||||
"url": "https://opencollective.com/express"
|
||||
}
|
||||
},
|
||||
"node_modules/brace-expansion": {
|
||||
@@ -910,6 +975,55 @@
|
||||
"url": "https://opencollective.com/express"
|
||||
}
|
||||
},
|
||||
"node_modules/express-session": {
|
||||
"version": "1.18.2",
|
||||
"resolved": "https://registry.npmjs.org/express-session/-/express-session-1.18.2.tgz",
|
||||
"integrity": "sha512-SZjssGQC7TzTs9rpPDuUrR23GNZ9+2+IkA/+IJWmvQilTr5OSliEHGF+D9scbIpdC6yGtTI0/VhaHoVes2AN/A==",
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"cookie": "0.7.2",
|
||||
"cookie-signature": "1.0.7",
|
||||
"debug": "2.6.9",
|
||||
"depd": "~2.0.0",
|
||||
"on-headers": "~1.1.0",
|
||||
"parseurl": "~1.3.3",
|
||||
"safe-buffer": "5.2.1",
|
||||
"uid-safe": "~2.1.5"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">= 0.8.0"
|
||||
}
|
||||
},
|
||||
"node_modules/express-session/node_modules/cookie": {
|
||||
"version": "0.7.2",
|
||||
"resolved": "https://registry.npmjs.org/cookie/-/cookie-0.7.2.tgz",
|
||||
"integrity": "sha512-yki5XnKuf750l50uGTllt6kKILY4nQ1eNIQatoXEByZ5dWgnKqbnqmTrBE5B4N7lrMJKQ2ytWMiTO2o0v6Ew/w==",
|
||||
"license": "MIT",
|
||||
"engines": {
|
||||
"node": ">= 0.6"
|
||||
}
|
||||
},
|
||||
"node_modules/express-session/node_modules/cookie-signature": {
|
||||
"version": "1.0.7",
|
||||
"resolved": "https://registry.npmjs.org/cookie-signature/-/cookie-signature-1.0.7.tgz",
|
||||
"integrity": "sha512-NXdYc3dLr47pBkpUCHtKSwIOQXLVn8dZEuywboCOJY/osA0wFSLlSawr3KN8qXJEyX66FcONTH8EIlVuK0yyFA==",
|
||||
"license": "MIT"
|
||||
},
|
||||
"node_modules/express-session/node_modules/debug": {
|
||||
"version": "2.6.9",
|
||||
"resolved": "https://registry.npmjs.org/debug/-/debug-2.6.9.tgz",
|
||||
"integrity": "sha512-bC7ElrdJaJnPbAP+1EotYvqZsb3ecl5wi6Bfi6BJTUcNowp6cvspg0jXznRTKDjm/E7AdgFBVeAPVMNcKGsHMA==",
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"ms": "2.0.0"
|
||||
}
|
||||
},
|
||||
"node_modules/express-session/node_modules/ms": {
|
||||
"version": "2.0.0",
|
||||
"resolved": "https://registry.npmjs.org/ms/-/ms-2.0.0.tgz",
|
||||
"integrity": "sha512-Tpp60P6IUJDTuOq/5Z8cdskzJujfwqfOTkrwIwj7IRISpnkJnT6SyJ4PCPnGMoFjC9ddhal5KVIYtAt97ix05A==",
|
||||
"license": "MIT"
|
||||
},
|
||||
"node_modules/express-ws": {
|
||||
"version": "5.0.2",
|
||||
"resolved": "https://registry.npmjs.org/express-ws/-/express-ws-5.0.2.tgz",
|
||||
@@ -987,14 +1101,14 @@
|
||||
}
|
||||
},
|
||||
"node_modules/forking-build-shit": {
|
||||
"version": "1.0.4",
|
||||
"resolved": "https://registry.npmjs.org/forking-build-shit/-/forking-build-shit-1.0.4.tgz",
|
||||
"integrity": "sha512-pknWCgvJWSkP30sMllWzFxJhjFtXCRuILgYT1N7pJLAyI/SXQ0RXyhTcg+hjCnKaH4aVpxWUFUF2afwTDRO6RA==",
|
||||
"version": "1.0.5",
|
||||
"resolved": "https://registry.npmjs.org/forking-build-shit/-/forking-build-shit-1.0.5.tgz",
|
||||
"integrity": "sha512-b9HVQF1f2qXkgB+yTJe3U2kLfggvbUZjU1aqljI0E8O+sxo+cQH/HsyMGdHNPaUoMgSe/qfOsL6CPumu0jrrdg==",
|
||||
"dev": true,
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"csso": "5.0.5",
|
||||
"sass": "1.90.0",
|
||||
"sass": "1.93.2",
|
||||
"uglify-js": "3.19.3"
|
||||
},
|
||||
"bin": {
|
||||
@@ -1128,21 +1242,25 @@
|
||||
}
|
||||
},
|
||||
"node_modules/iconv-lite": {
|
||||
"version": "0.6.3",
|
||||
"resolved": "https://registry.npmjs.org/iconv-lite/-/iconv-lite-0.6.3.tgz",
|
||||
"integrity": "sha512-4fCk79wshMdzMp2rH06qWrJE4iolqLhCUH+OiuIgU++RB0+94NlDL81atO7GX55uUKueo0txHNtvEyI6D7WdMw==",
|
||||
"version": "0.7.0",
|
||||
"resolved": "https://registry.npmjs.org/iconv-lite/-/iconv-lite-0.7.0.tgz",
|
||||
"integrity": "sha512-cf6L2Ds3h57VVmkZe+Pn+5APsT7FpqJtEhhieDCvrE2MK5Qk9MyffgQyuxQTm6BChfeZNtcOLHp9IcWRVcIcBQ==",
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"safer-buffer": ">= 2.1.2 < 3.0.0"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">=0.10.0"
|
||||
},
|
||||
"funding": {
|
||||
"type": "opencollective",
|
||||
"url": "https://opencollective.com/express"
|
||||
}
|
||||
},
|
||||
"node_modules/immutable": {
|
||||
"version": "5.1.3",
|
||||
"resolved": "https://registry.npmjs.org/immutable/-/immutable-5.1.3.tgz",
|
||||
"integrity": "sha512-+chQdDfvscSF1SJqv2gn4SRO2ZyS3xL3r7IW/wWEEzrzLisnOlKiQu5ytC/BVNcS15C39WT2Hg/bjKjDMcu+zg==",
|
||||
"version": "5.1.4",
|
||||
"resolved": "https://registry.npmjs.org/immutable/-/immutable-5.1.4.tgz",
|
||||
"integrity": "sha512-p6u1bG3YSnINT5RQmx/yRZBpenIl30kVxkTLDyHLIMk0gict704Q9n+thfDI7lTRm9vXdDYutVzXhzcThxTnXA==",
|
||||
"dev": true,
|
||||
"license": "MIT"
|
||||
},
|
||||
@@ -1230,6 +1348,18 @@
|
||||
"node": ">=10"
|
||||
}
|
||||
},
|
||||
"node_modules/ky": {
|
||||
"version": "1.14.0",
|
||||
"resolved": "https://registry.npmjs.org/ky/-/ky-1.14.0.tgz",
|
||||
"integrity": "sha512-Rczb6FMM6JT0lvrOlP5WUOCB7s9XKxzwgErzhKlKde1bEV90FXplV1o87fpt4PU/asJFiqjYJxAJyzJhcrxOsQ==",
|
||||
"license": "MIT",
|
||||
"engines": {
|
||||
"node": ">=18"
|
||||
},
|
||||
"funding": {
|
||||
"url": "https://github.com/sindresorhus/ky?sponsor=1"
|
||||
}
|
||||
},
|
||||
"node_modules/lodash": {
|
||||
"version": "4.17.21",
|
||||
"resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.21.tgz",
|
||||
@@ -1365,6 +1495,12 @@
|
||||
"license": "MIT",
|
||||
"optional": true
|
||||
},
|
||||
"node_modules/oauth": {
|
||||
"version": "0.10.2",
|
||||
"resolved": "https://registry.npmjs.org/oauth/-/oauth-0.10.2.tgz",
|
||||
"integrity": "sha512-JtFnB+8nxDEXgNyniwz573xxbKSOu3R8D40xQKqcjwJ2CDkYqUDI53o6IuzDJBx60Z8VKCm271+t8iFjakrl8Q==",
|
||||
"license": "MIT"
|
||||
},
|
||||
"node_modules/object-inspect": {
|
||||
"version": "1.13.4",
|
||||
"resolved": "https://registry.npmjs.org/object-inspect/-/object-inspect-1.13.4.tgz",
|
||||
@@ -1389,6 +1525,15 @@
|
||||
"node": ">= 0.8"
|
||||
}
|
||||
},
|
||||
"node_modules/on-headers": {
|
||||
"version": "1.1.0",
|
||||
"resolved": "https://registry.npmjs.org/on-headers/-/on-headers-1.1.0.tgz",
|
||||
"integrity": "sha512-737ZY3yNnXy37FHkQxPzt4UZ2UWPWiCZWLvFZ4fu5cueciegX0zGPnrlY6bwRg4FdQOe9YU8MkmJwGhoMybl8A==",
|
||||
"license": "MIT",
|
||||
"engines": {
|
||||
"node": ">= 0.8"
|
||||
}
|
||||
},
|
||||
"node_modules/once": {
|
||||
"version": "1.4.0",
|
||||
"resolved": "https://registry.npmjs.org/once/-/once-1.4.0.tgz",
|
||||
@@ -1407,6 +1552,49 @@
|
||||
"node": ">= 0.8"
|
||||
}
|
||||
},
|
||||
"node_modules/passport": {
|
||||
"version": "0.7.0",
|
||||
"resolved": "https://registry.npmjs.org/passport/-/passport-0.7.0.tgz",
|
||||
"integrity": "sha512-cPLl+qZpSc+ireUvt+IzqbED1cHHkDoVYMo30jbJIdOOjQ1MQYZBPiNvmi8UM6lJuOpTPXJGZQk0DtC4y61MYQ==",
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"passport-strategy": "1.x.x",
|
||||
"pause": "0.0.1",
|
||||
"utils-merge": "^1.0.1"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">= 0.4.0"
|
||||
},
|
||||
"funding": {
|
||||
"type": "github",
|
||||
"url": "https://github.com/sponsors/jaredhanson"
|
||||
}
|
||||
},
|
||||
"node_modules/passport-openidconnect": {
|
||||
"version": "0.1.2",
|
||||
"resolved": "https://registry.npmjs.org/passport-openidconnect/-/passport-openidconnect-0.1.2.tgz",
|
||||
"integrity": "sha512-JX3rTyW+KFZ/E9OF/IpXJPbyLO9vGzcmXB5FgSP2jfL3LGKJPdV7zUE8rWeKeeI/iueQggOeFa3onrCmhxXZTg==",
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"oauth": "0.10.x",
|
||||
"passport-strategy": "1.x.x"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">= 0.6.0"
|
||||
},
|
||||
"funding": {
|
||||
"type": "github",
|
||||
"url": "https://github.com/sponsors/jaredhanson"
|
||||
}
|
||||
},
|
||||
"node_modules/passport-strategy": {
|
||||
"version": "1.0.0",
|
||||
"resolved": "https://registry.npmjs.org/passport-strategy/-/passport-strategy-1.0.0.tgz",
|
||||
"integrity": "sha512-CB97UUvDKJde2V0KDWWB3lyf6PC3FaZP7YxZ2G8OAtn9p4HI9j9JLP9qjOGZFvyl8uwNT8qM+hGnz/n16NI7oA==",
|
||||
"engines": {
|
||||
"node": ">= 0.4.0"
|
||||
}
|
||||
},
|
||||
"node_modules/path-to-regexp": {
|
||||
"version": "8.3.0",
|
||||
"resolved": "https://registry.npmjs.org/path-to-regexp/-/path-to-regexp-8.3.0.tgz",
|
||||
@@ -1417,6 +1605,11 @@
|
||||
"url": "https://opencollective.com/express"
|
||||
}
|
||||
},
|
||||
"node_modules/pause": {
|
||||
"version": "0.0.1",
|
||||
"resolved": "https://registry.npmjs.org/pause/-/pause-0.0.1.tgz",
|
||||
"integrity": "sha512-KG8UEiEVkR3wGEb4m5yZkVCzigAD+cVEJck2CzYZO37ZGJfctvVptVO192MwrtPhzONn6go8ylnOdMhKqi4nfg=="
|
||||
},
|
||||
"node_modules/pg": {
|
||||
"version": "8.16.3",
|
||||
"resolved": "https://registry.npmjs.org/pg/-/pg-8.16.3.tgz",
|
||||
@@ -1599,6 +1792,15 @@
|
||||
"url": "https://github.com/sponsors/ljharb"
|
||||
}
|
||||
},
|
||||
"node_modules/random-bytes": {
|
||||
"version": "1.0.0",
|
||||
"resolved": "https://registry.npmjs.org/random-bytes/-/random-bytes-1.0.0.tgz",
|
||||
"integrity": "sha512-iv7LhNVO047HzYR3InF6pUcUsPQiHTM1Qal51DcGSuZFBil1aBBWG5eHPNek7bvILMaYJ/8RU1e8w1AMdHmLQQ==",
|
||||
"license": "MIT",
|
||||
"engines": {
|
||||
"node": ">= 0.8"
|
||||
}
|
||||
},
|
||||
"node_modules/range-parser": {
|
||||
"version": "1.2.1",
|
||||
"resolved": "https://registry.npmjs.org/range-parser/-/range-parser-1.2.1.tgz",
|
||||
@@ -1623,22 +1825,6 @@
|
||||
"node": ">= 0.10"
|
||||
}
|
||||
},
|
||||
"node_modules/raw-body/node_modules/iconv-lite": {
|
||||
"version": "0.7.0",
|
||||
"resolved": "https://registry.npmjs.org/iconv-lite/-/iconv-lite-0.7.0.tgz",
|
||||
"integrity": "sha512-cf6L2Ds3h57VVmkZe+Pn+5APsT7FpqJtEhhieDCvrE2MK5Qk9MyffgQyuxQTm6BChfeZNtcOLHp9IcWRVcIcBQ==",
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"safer-buffer": ">= 2.1.2 < 3.0.0"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">=0.10.0"
|
||||
},
|
||||
"funding": {
|
||||
"type": "opencollective",
|
||||
"url": "https://opencollective.com/express"
|
||||
}
|
||||
},
|
||||
"node_modules/readdirp": {
|
||||
"version": "4.1.2",
|
||||
"resolved": "https://registry.npmjs.org/readdirp/-/readdirp-4.1.2.tgz",
|
||||
@@ -1702,9 +1888,9 @@
|
||||
"license": "MIT"
|
||||
},
|
||||
"node_modules/sass": {
|
||||
"version": "1.90.0",
|
||||
"resolved": "https://registry.npmjs.org/sass/-/sass-1.90.0.tgz",
|
||||
"integrity": "sha512-9GUyuksjw70uNpb1MTYWsH9MQHOHY6kwfnkafC24+7aOMZn9+rVMBxRbLvw756mrBFbIsFg6Xw9IkR2Fnn3k+Q==",
|
||||
"version": "1.93.2",
|
||||
"resolved": "https://registry.npmjs.org/sass/-/sass-1.93.2.tgz",
|
||||
"integrity": "sha512-t+YPtOQHpGW1QWsh1CHQ5cPIr9lbbGZLZnbihP/D/qZj/yuV68m8qarcV17nvkOX81BCrvzAlq2klCQFZghyTg==",
|
||||
"dev": true,
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
@@ -2010,9 +2196,9 @@
|
||||
}
|
||||
},
|
||||
"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==",
|
||||
"version": "5.9.3",
|
||||
"resolved": "https://registry.npmjs.org/typescript/-/typescript-5.9.3.tgz",
|
||||
"integrity": "sha512-jl1vZzPDinLr9eUt3J/t7V6FgNEw9QjvBPdysz9KfQDD41fQrC2Y4vKQdiaUpFT4bXlb1RHhLpp8wtm6M5TgSw==",
|
||||
"license": "Apache-2.0",
|
||||
"peer": true,
|
||||
"bin": {
|
||||
@@ -2036,6 +2222,18 @@
|
||||
"node": ">=0.8.0"
|
||||
}
|
||||
},
|
||||
"node_modules/uid-safe": {
|
||||
"version": "2.1.5",
|
||||
"resolved": "https://registry.npmjs.org/uid-safe/-/uid-safe-2.1.5.tgz",
|
||||
"integrity": "sha512-KPHm4VL5dDXKz01UuEd88Df+KzynaohSL9fBh096KWAxSKZQDI2uBrVqtvRM4rwrIrRRKsdLNML/lnaaVSRioA==",
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"random-bytes": "~1.0.0"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">= 0.8"
|
||||
}
|
||||
},
|
||||
"node_modules/underscore": {
|
||||
"version": "1.13.7",
|
||||
"resolved": "https://registry.npmjs.org/underscore/-/underscore-1.13.7.tgz",
|
||||
@@ -2043,9 +2241,9 @@
|
||||
"license": "MIT"
|
||||
},
|
||||
"node_modules/undici-types": {
|
||||
"version": "7.12.0",
|
||||
"resolved": "https://registry.npmjs.org/undici-types/-/undici-types-7.12.0.tgz",
|
||||
"integrity": "sha512-goOacqME2GYyOZZfb5Lgtu+1IDmAlAEu5xnD3+xTzS10hT0vzpf0SPjkXwAw9Jm+4n/mQGDP3LO8CPbYROeBfQ==",
|
||||
"version": "7.16.0",
|
||||
"resolved": "https://registry.npmjs.org/undici-types/-/undici-types-7.16.0.tgz",
|
||||
"integrity": "sha512-Zz+aZWSj8LE6zoxD+xrjh4VfkIG8Ya6LvYkZqtUQGJPZjYl53ypCaUwWqo7eI0x66KBGeRo+mlBEkMSeSZ38Nw==",
|
||||
"license": "MIT"
|
||||
},
|
||||
"node_modules/unpipe": {
|
||||
@@ -2057,6 +2255,15 @@
|
||||
"node": ">= 0.8"
|
||||
}
|
||||
},
|
||||
"node_modules/utils-merge": {
|
||||
"version": "1.0.1",
|
||||
"resolved": "https://registry.npmjs.org/utils-merge/-/utils-merge-1.0.1.tgz",
|
||||
"integrity": "sha512-pMZTvIkT1d+TFGvDOqodOclx0QWkkgi6Tdoa8gC8ffGAAqz9pzPTZWAybbsHHoED/ztMtkv/VoYTYyShUn81hA==",
|
||||
"license": "MIT",
|
||||
"engines": {
|
||||
"node": ">= 0.4.0"
|
||||
}
|
||||
},
|
||||
"node_modules/uuid": {
|
||||
"version": "8.3.2",
|
||||
"resolved": "https://registry.npmjs.org/uuid/-/uuid-8.3.2.tgz",
|
||||
@@ -2067,9 +2274,9 @@
|
||||
}
|
||||
},
|
||||
"node_modules/validator": {
|
||||
"version": "13.12.0",
|
||||
"resolved": "https://registry.npmjs.org/validator/-/validator-13.12.0.tgz",
|
||||
"integrity": "sha512-c1Q0mCiPlgdTVVVIJIrBuxNicYE+t/7oKeI9MWLj3fh/uq2Pxh/3eeWbVZ4OcGW1TUf53At0njHw5SMdA3tmMg==",
|
||||
"version": "13.15.20",
|
||||
"resolved": "https://registry.npmjs.org/validator/-/validator-13.15.20.tgz",
|
||||
"integrity": "sha512-KxPOq3V2LmfQPP4eqf3Mq/zrT0Dqp2Vmx2Bn285LwVahLc+CsxOM0crBHczm8ijlcjZ0Q5Xd6LW3z3odTPnlrw==",
|
||||
"license": "MIT",
|
||||
"engines": {
|
||||
"node": ">= 0.10"
|
||||
|
||||
25
package.json
25
package.json
@@ -1,42 +1,49 @@
|
||||
{
|
||||
"name": "archery",
|
||||
"version": "0.1.8",
|
||||
"version": "0.3.0",
|
||||
"description": "Build Arch packages through a web interface",
|
||||
"keywords": [
|
||||
"docker",
|
||||
"arch",
|
||||
"artix"
|
||||
],
|
||||
"homepage": "https://github.com/CorySanin/archery#readme",
|
||||
"homepage": "https://git.sanin.dev/corysanin/archery#readme",
|
||||
"bugs": {
|
||||
"url": "https://github.com/CorySanin/archery/issues"
|
||||
},
|
||||
"repository": {
|
||||
"type": "git",
|
||||
"url": "git+https://github.com/CorySanin/archery.git"
|
||||
"url": "git+https://git.sanin.dev/corysanin/archery.git"
|
||||
},
|
||||
"license": "MIT",
|
||||
"author": "Cory Sanin",
|
||||
"type": "module",
|
||||
"main": "index.ts",
|
||||
"dependencies": {
|
||||
"body-parser": "^2.2.0",
|
||||
"body-parser": "^2.2.1",
|
||||
"ejs": "3.1.10",
|
||||
"express": "^5.1.0",
|
||||
"express-session": "1.18.2",
|
||||
"express-ws": "^5.0.2",
|
||||
"ky": "1.14.0",
|
||||
"passport": "0.7.0",
|
||||
"passport-openidconnect": "0.1.2",
|
||||
"pg": "^8.16.3",
|
||||
"pg-hstore": "^2.3.4",
|
||||
"sequelize": "^6.37.7",
|
||||
"sqids": "0.3.0"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@types/express": "^5.0.3",
|
||||
"@types/express-ws": "3.0.5",
|
||||
"@types/node": "^24.5.2",
|
||||
"forking-build-shit": "1.0.4"
|
||||
"@types/express": "^5.0.5",
|
||||
"@types/express-session": "^1.18.2",
|
||||
"@types/express-ws": "3.0.6",
|
||||
"@types/node": "^24.10.1",
|
||||
"@types/passport": "1.0.17",
|
||||
"@types/passport-openidconnect": "0.1.3",
|
||||
"forking-build-shit": "1.0.5"
|
||||
},
|
||||
"peerDependencies": {
|
||||
"typescript": "5.7.3"
|
||||
"typescript": "5.9.3"
|
||||
},
|
||||
"scripts": {
|
||||
"build": "npx build-shit",
|
||||
|
||||
@@ -4,14 +4,6 @@ document.addEventListener('DOMContentLoaded', function () {
|
||||
const buildStatusTxt = this.getElementById('buildStatus');
|
||||
let started = logContainer.childElementCount > 0;
|
||||
|
||||
/**
|
||||
* Get the correct path to establish a ws connection
|
||||
* @param {Location} loc
|
||||
*/
|
||||
function wsPath(loc) {
|
||||
return loc.pathname.replace(/\/$/, '') + '/ws';
|
||||
}
|
||||
|
||||
/**
|
||||
* Add log line to the DOM
|
||||
* @param {string[]} str
|
||||
@@ -52,7 +44,7 @@ document.addEventListener('DOMContentLoaded', function () {
|
||||
const loc = window.location;
|
||||
let new_uri = loc.protocol === 'https:' ? 'wss:' : 'ws:';
|
||||
new_uri += "//" + loc.host;
|
||||
new_uri += wsPath(loc);
|
||||
new_uri += loc.pathname + 'ws';
|
||||
var ws = new WebSocket(new_uri);
|
||||
|
||||
ws.onmessage = function (message) {
|
||||
|
||||
23
scripts/form.js
Normal file
23
scripts/form.js
Normal file
@@ -0,0 +1,23 @@
|
||||
document.addEventListener('DOMContentLoaded', function () {
|
||||
for (let btn of document.getElementsByClassName('copybtn')) {
|
||||
btn.addEventListener('click', e => {
|
||||
navigator.clipboard.writeText(e.target.previousElementSibling.innerText);
|
||||
});
|
||||
}
|
||||
|
||||
document.getElementById('persistChk')?.addEventListener('change', async e => {
|
||||
const sqid = document.getElementById('sqid').textContent;
|
||||
const persist = !!e.target?.checked;
|
||||
const resp = await fetch(`/build/${sqid}/persist`, {
|
||||
method: 'post',
|
||||
headers: {
|
||||
'Accept': 'application/json',
|
||||
'Content-Type': 'application/json'
|
||||
},
|
||||
body: JSON.stringify({ persist })
|
||||
});
|
||||
if (!resp.ok) {
|
||||
this.location.reload();
|
||||
}
|
||||
});
|
||||
});
|
||||
@@ -15,6 +15,11 @@ interface BuildEvent {
|
||||
message: any;
|
||||
}
|
||||
|
||||
interface ControllerConfig {
|
||||
"arch-mirror"?: string;
|
||||
"artix-mirror"?: string;
|
||||
}
|
||||
|
||||
function getContainerName(id: number) {
|
||||
return `archery-build-${id}`;
|
||||
}
|
||||
@@ -24,9 +29,11 @@ class BuildController extends EventEmitter {
|
||||
private running: boolean = false;
|
||||
private interval: NodeJS.Timeout;
|
||||
private cancelled: boolean = false;
|
||||
private config: ControllerConfig;
|
||||
|
||||
constructor(config = {}) {
|
||||
constructor(config: ControllerConfig = {}) {
|
||||
super();
|
||||
this.config = config;
|
||||
// this.interval = setInterval(this.triggerBuild, 60000);
|
||||
}
|
||||
|
||||
@@ -84,7 +91,7 @@ class BuildController extends EventEmitter {
|
||||
}
|
||||
|
||||
private build = async (build: Build) => {
|
||||
return new Promise<void>((resolve, reject) => {
|
||||
return new Promise<void>((resolve, _) => {
|
||||
const docker = spawn.spawn('docker', this.createBuildParams(build));
|
||||
docker.on('spawn', () => {
|
||||
const remainder = {
|
||||
@@ -129,6 +136,7 @@ class BuildController extends EventEmitter {
|
||||
}
|
||||
|
||||
private createBuildParams = (build: Build) => {
|
||||
const customMirror = this.config?.[`${build.distro}-mirror`];
|
||||
const params = ['run', '--rm', '-e', `REPO=${build.repo}`];
|
||||
if (build.dependencies) {
|
||||
params.push('-e', `DEP=${build.dependencies}`);
|
||||
@@ -139,6 +147,9 @@ class BuildController extends EventEmitter {
|
||||
if (build.patch) {
|
||||
params.push('-e', `PATCH=${build.patch}`);
|
||||
}
|
||||
if (customMirror && typeof customMirror === 'string' && customMirror.length > 0) {
|
||||
params.push('-e', `MIRROR=${customMirror}`);
|
||||
}
|
||||
params.push('--name', getContainerName(build.id));
|
||||
params.push(docker_images[build.distro]);
|
||||
return params;
|
||||
@@ -188,4 +199,4 @@ class BuildController extends EventEmitter {
|
||||
|
||||
export default BuildController;
|
||||
export { BuildController };
|
||||
export type { BuildEvent, LogType };
|
||||
export type { BuildEvent, LogType, ControllerConfig };
|
||||
258
src/DB.ts
258
src/DB.ts
@@ -1,9 +1,13 @@
|
||||
import { Sequelize, DataTypes, Op, } from 'sequelize';
|
||||
import { Store } from 'express-session'
|
||||
import { notStupidParseInt } from './Web.ts';
|
||||
import type { ModelStatic, Filterable } from 'sequelize';
|
||||
import type { LogType } from './BuildController.ts';
|
||||
import type { SessionData } from 'express-session'
|
||||
|
||||
type Status = 'queued' | 'running' | 'cancelled' | 'success' | 'error';
|
||||
type Dependencies = 'stable' | 'testing' | 'staging';
|
||||
type Callback = (err?: unknown, data?: any) => any
|
||||
|
||||
interface DBConfig {
|
||||
db?: string;
|
||||
@@ -25,6 +29,14 @@ interface Build {
|
||||
status: Status;
|
||||
pid?: number;
|
||||
sqid?: string;
|
||||
uuid: string;
|
||||
persist: boolean;
|
||||
}
|
||||
|
||||
interface User {
|
||||
id: string;
|
||||
username: string;
|
||||
displayName?: string;
|
||||
}
|
||||
|
||||
interface LogChunk {
|
||||
@@ -34,7 +46,7 @@ interface LogChunk {
|
||||
chunk: string
|
||||
}
|
||||
|
||||
const MONTH = 1000 * 60 * 60 * 24 * 24;
|
||||
const MONTH = 1000 * 60 * 60 * 24 * 30;
|
||||
const FRESH = {
|
||||
[Op.or]: [
|
||||
{ startTime: { [Op.gt]: new Date(Date.now() - MONTH) } },
|
||||
@@ -43,12 +55,27 @@ const FRESH = {
|
||||
}
|
||||
const SELECT = ['id', 'repo', 'commit', 'distro', 'dependencies', 'startTime', 'endTime', 'status'];
|
||||
|
||||
class DB {
|
||||
function handleCallback<T>(err: unknown, data: T, cb?: Callback): T {
|
||||
if (cb) {
|
||||
cb(err, data);
|
||||
}
|
||||
if (err) {
|
||||
throw err;
|
||||
}
|
||||
return data;
|
||||
}
|
||||
|
||||
class DB extends Store {
|
||||
private build: ModelStatic<any>;
|
||||
private logChunk: ModelStatic<any>;
|
||||
private user: ModelStatic<any>;
|
||||
private session: ModelStatic<any>;
|
||||
private sequelize: Sequelize;
|
||||
private ttl: number;
|
||||
|
||||
constructor(config: DBConfig = {}) {
|
||||
super();
|
||||
this.ttl = notStupidParseInt(process.env['COOKIETTL']) || 1000 * 60 * 60 * 24 * 30;
|
||||
this.sequelize = new Sequelize(config.db || 'archery', config.user || 'archery', process.env.PASSWORD || config.password || '', {
|
||||
host: config.host || 'localhost',
|
||||
port: config.port || 5432,
|
||||
@@ -98,6 +125,14 @@ class DB {
|
||||
pid: {
|
||||
type: DataTypes.INTEGER,
|
||||
allowNull: true
|
||||
},
|
||||
uuid: {
|
||||
type: DataTypes.STRING,
|
||||
unique: true
|
||||
},
|
||||
persist: {
|
||||
type: DataTypes.BOOLEAN,
|
||||
defaultValue: false
|
||||
}
|
||||
});
|
||||
|
||||
@@ -128,21 +163,82 @@ class DB {
|
||||
}
|
||||
});
|
||||
|
||||
this.user = this.sequelize.define('users', {
|
||||
id: {
|
||||
type: DataTypes.STRING,
|
||||
primaryKey: true,
|
||||
},
|
||||
username: {
|
||||
type: DataTypes.STRING,
|
||||
},
|
||||
displayName: {
|
||||
type: DataTypes.STRING,
|
||||
allowNull: true
|
||||
}
|
||||
});
|
||||
|
||||
this.session = this.sequelize.define('session', {
|
||||
sid: {
|
||||
type: DataTypes.STRING,
|
||||
primaryKey: true,
|
||||
},
|
||||
sessionData: {
|
||||
type: DataTypes.JSONB,
|
||||
}
|
||||
});
|
||||
|
||||
this.build.belongsTo(this.user);
|
||||
this.user.hasMany(this.build);
|
||||
|
||||
this.sync();
|
||||
}
|
||||
|
||||
private async sync(): Promise<void> {
|
||||
await this.user.sync();
|
||||
await this.build.sync();
|
||||
await this.logChunk.sync();
|
||||
await this.session.sync();
|
||||
|
||||
if (!(await this.getUser('-1'))) {
|
||||
await this.createUser({
|
||||
id: '-1',
|
||||
username: '???',
|
||||
displayName: 'Anonymous User'
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
public async createBuild(repo: string, commit: string, patch: string, distro: string, dependencies: string): Promise<number> {
|
||||
public async getUser(id: string): Promise<User> {
|
||||
return await this.user.findByPk(id);
|
||||
}
|
||||
|
||||
public async createUser(user: User): Promise<string> {
|
||||
await this.user.create({
|
||||
id: user.id,
|
||||
username: user.username,
|
||||
displayName: user.displayName || null
|
||||
});
|
||||
return user.id;
|
||||
}
|
||||
|
||||
public async upsertUser(user: User): Promise<string> {
|
||||
await this.user.upsert({
|
||||
id: user.id,
|
||||
username: user.username,
|
||||
displayName: user.displayName || null
|
||||
});
|
||||
return user.id;
|
||||
}
|
||||
|
||||
public async createBuild(repo: string, commit: string, patch: string, distro: string, dependencies: string, author: string, uuid: string): Promise<number> {
|
||||
const buildRec = await this.build.create({
|
||||
repo,
|
||||
commit: commit || null,
|
||||
patch: patch || null,
|
||||
distro,
|
||||
dependencies
|
||||
dependencies,
|
||||
uuid,
|
||||
userId: author || '-1'
|
||||
});
|
||||
return buildRec.id;
|
||||
}
|
||||
@@ -171,6 +267,16 @@ class DB {
|
||||
});
|
||||
}
|
||||
|
||||
public async persist(id: number, persist: boolean = true): Promise<void> {
|
||||
await this.build.update({
|
||||
persist
|
||||
}, {
|
||||
where: {
|
||||
id
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
public async appendLog(buildId: number, type: LogType, chunk: string): Promise<void> {
|
||||
await this.logChunk.create({
|
||||
buildId,
|
||||
@@ -189,14 +295,26 @@ class DB {
|
||||
}
|
||||
|
||||
public async getBuild(id: number): Promise<Build> {
|
||||
return await this.build.findByPk(id);
|
||||
return await this.build.findByPk(id, {
|
||||
include: this.user
|
||||
});
|
||||
}
|
||||
|
||||
public async getBuildByUuid(uuid: string): Promise<Build> {
|
||||
return await this.build.findOne({
|
||||
where: {
|
||||
uuid
|
||||
},
|
||||
include: this.user
|
||||
});
|
||||
}
|
||||
|
||||
public async getBuilds(): Promise<Build[]> {
|
||||
return await this.build.findAll({
|
||||
attributes: SELECT,
|
||||
order: [['id', 'DESC']],
|
||||
where: FRESH
|
||||
where: FRESH,
|
||||
include: this.user
|
||||
});
|
||||
}
|
||||
|
||||
@@ -207,7 +325,8 @@ class DB {
|
||||
where: {
|
||||
...FRESH,
|
||||
status
|
||||
}
|
||||
},
|
||||
include: this.user
|
||||
});
|
||||
}
|
||||
|
||||
@@ -218,7 +337,8 @@ class DB {
|
||||
where: {
|
||||
...FRESH,
|
||||
distro
|
||||
}
|
||||
},
|
||||
include: this.user
|
||||
});
|
||||
}
|
||||
|
||||
@@ -229,7 +349,8 @@ class DB {
|
||||
where: {
|
||||
...FRESH,
|
||||
...filterable
|
||||
}
|
||||
},
|
||||
include: this.user
|
||||
});
|
||||
}
|
||||
|
||||
@@ -252,16 +373,127 @@ class DB {
|
||||
{ repo: { [Op.iLike]: `%${query}%` } }
|
||||
]
|
||||
},
|
||||
limit: 100
|
||||
limit: 100,
|
||||
include: this.user
|
||||
});
|
||||
}
|
||||
|
||||
public async cleanup(): Promise<void> {
|
||||
await this.build.destroy({
|
||||
where: {
|
||||
startTime: { [Op.lt]: new Date(Date.now() - MONTH * 6) }
|
||||
}
|
||||
startTime: { [Op.lt]: new Date(Date.now() - MONTH * 6) },
|
||||
persist: { [Op.eq]: false }
|
||||
},
|
||||
force: true
|
||||
});
|
||||
await this.session.destroy({
|
||||
where: {
|
||||
updatedAt: { [Op.lt]: new Date(Date.now() - this.ttl) }
|
||||
},
|
||||
force: true
|
||||
});
|
||||
}
|
||||
|
||||
public getTTL(sessionData: SessionData) {
|
||||
if (sessionData?.cookie?.expires) {
|
||||
const ms = Number(new Date(sessionData.cookie.expires)) - Date.now();
|
||||
return ms;
|
||||
}
|
||||
else {
|
||||
return this.ttl;
|
||||
}
|
||||
}
|
||||
|
||||
public async set(sid: string, sessionData: SessionData, cb?: Callback): Promise<void> {
|
||||
const ttl = this.getTTL(sessionData);
|
||||
try {
|
||||
if (ttl > 0) {
|
||||
await this.session.upsert({
|
||||
sid,
|
||||
sessionData
|
||||
});
|
||||
handleCallback(null, null, cb);
|
||||
return;
|
||||
}
|
||||
await this.destroy(sid, cb);
|
||||
}
|
||||
catch (err) {
|
||||
return handleCallback(err, null, cb);
|
||||
}
|
||||
}
|
||||
|
||||
public async get(sid: string, cb?: Callback): Promise<SessionData> {
|
||||
try {
|
||||
return handleCallback(null, ((await this.session.findByPk(sid))?.sessionData) as SessionData || null, cb);
|
||||
}
|
||||
catch (err) {
|
||||
return handleCallback(err, null, cb);
|
||||
}
|
||||
}
|
||||
|
||||
public async destroy(sid: string, cb?: Callback): Promise<void> {
|
||||
try {
|
||||
await this.session.destroy({
|
||||
where: {
|
||||
sid
|
||||
},
|
||||
force: true
|
||||
});
|
||||
handleCallback(null, null, cb);
|
||||
}
|
||||
catch (err) {
|
||||
handleCallback(err, null, cb);
|
||||
}
|
||||
}
|
||||
|
||||
public async clear(cb?: Callback): Promise<void> {
|
||||
try {
|
||||
await this.session.destroy({
|
||||
truncate: true,
|
||||
force: true
|
||||
});
|
||||
handleCallback(null, null, cb);
|
||||
}
|
||||
catch (err) {
|
||||
handleCallback(err, null, cb);
|
||||
}
|
||||
}
|
||||
|
||||
public async length(cb?: Callback): Promise<number> {
|
||||
try {
|
||||
return handleCallback(null, await this.session.count(), cb);
|
||||
}
|
||||
catch (err) {
|
||||
handleCallback(err, null, cb);
|
||||
}
|
||||
}
|
||||
|
||||
public async touch(sid: string, sessionData: SessionData, cb?: Callback): Promise<void> {
|
||||
try {
|
||||
await this.session.update({},
|
||||
{
|
||||
where: {
|
||||
sid
|
||||
}
|
||||
}
|
||||
);
|
||||
handleCallback(null, null, cb);
|
||||
}
|
||||
catch (err) {
|
||||
handleCallback(err, null, cb);
|
||||
}
|
||||
}
|
||||
|
||||
public async all(cb?: Callback): Promise<SessionData[]> {
|
||||
try {
|
||||
const all = await this.session.findAll({
|
||||
attributes: ['sessionData']
|
||||
});
|
||||
return handleCallback(null, all.map(row => row.sessionData as SessionData), cb);
|
||||
}
|
||||
catch (err) {
|
||||
handleCallback(err, null, cb);
|
||||
}
|
||||
}
|
||||
|
||||
public async close(): Promise<void> {
|
||||
@@ -271,4 +503,4 @@ class DB {
|
||||
|
||||
export default DB;
|
||||
export { DB };
|
||||
export type { DBConfig, Status, Build, LogChunk };
|
||||
export type { DBConfig, Status, Build, LogChunk, User };
|
||||
|
||||
271
src/Web.ts
271
src/Web.ts
@@ -1,15 +1,34 @@
|
||||
import * as http from "http";
|
||||
import crypto from 'crypto';
|
||||
import type { Express } from "express";
|
||||
import type { Express } from 'express';
|
||||
import express from 'express';
|
||||
import expressWs from "express-ws";
|
||||
import bodyParser from "body-parser";
|
||||
import expressWs from 'express-ws';
|
||||
import session from 'express-session';
|
||||
import ky from 'ky';
|
||||
import passport from 'passport';
|
||||
import OpenIDConnectStrategy from 'passport-openidconnect';
|
||||
import bodyParser from 'body-parser';
|
||||
import Sqids from 'sqids';
|
||||
import type { DB, LogChunk } from "./DB.ts";
|
||||
import type { DB, LogChunk, Build, User } from "./DB.ts";
|
||||
import type { BuildController, BuildEvent } from "./BuildController.ts";
|
||||
|
||||
interface WebConfig {
|
||||
sessionSecret?: string;
|
||||
port?: number;
|
||||
secure?: boolean;
|
||||
oidc?: {
|
||||
server: string;
|
||||
clientId: string;
|
||||
clientSecret: string;
|
||||
appBaseUrl: string;
|
||||
};
|
||||
}
|
||||
|
||||
interface OpenIdConfiguration {
|
||||
issuer: string;
|
||||
authorization_endpoint: string;
|
||||
token_endpoint: string;
|
||||
userinfo_endpoint: string;
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -40,14 +59,22 @@ class Web {
|
||||
private buildController: BuildController;
|
||||
private app: expressWs.Application;
|
||||
private port: number;
|
||||
private options:WebConfig;
|
||||
|
||||
constructor(options: WebConfig = {}) {
|
||||
this.options = options;
|
||||
}
|
||||
|
||||
initialize = async () => {
|
||||
const options = this.options;
|
||||
const sessionSecret = process.env['SESSIONSECRET'] || options.sessionSecret;
|
||||
const sqids = new Sqids({
|
||||
minLength: 6,
|
||||
alphabet: 'abcdefghijkmnprstuvwxyz'
|
||||
});
|
||||
const app: Express = express();
|
||||
const wsApp = this.app = expressWs(app).app;
|
||||
const oidc = await this.initializeOIDC(options);
|
||||
this.port = notStupidParseInt(process.env.PORT) || options['port'] as number || 8080;
|
||||
|
||||
app.set('trust proxy', 1);
|
||||
@@ -68,6 +95,141 @@ class Web {
|
||||
});
|
||||
});
|
||||
|
||||
const createBuildPages = (slug: string, getBuildFn: (str: string) => Promise<Build>) => {
|
||||
app.get(`/${slug}/:id/`, async (req, res) => {
|
||||
const build = await getBuildFn(req.params.id);
|
||||
if (!build) {
|
||||
res.sendStatus(404);
|
||||
return;
|
||||
}
|
||||
build.sqid = sqids.encode([build.id]);
|
||||
const log = splitLines(await this.db.getLog(build.id));
|
||||
|
||||
if (req?.user) {
|
||||
res.locals.shareable = `${req.protocol}://${req.host}/b/${build.uuid}/`;
|
||||
}
|
||||
|
||||
res.render('build', {
|
||||
page: {
|
||||
title: 'Archery',
|
||||
titlesuffix: `Build #${build.id}`,
|
||||
description: `Building ${build.repo} on ${build.distro}`,
|
||||
},
|
||||
user: req?.user,
|
||||
build,
|
||||
log,
|
||||
ended: build.status !== 'queued' && build.status !== 'running',
|
||||
public: !!oidc && !req?.user
|
||||
});
|
||||
});
|
||||
|
||||
app.get(`/${slug}/:id/logs{/}`, async (req, res) => {
|
||||
const build = await getBuildFn(req.params.id);
|
||||
if (!build) {
|
||||
res.sendStatus(404);
|
||||
return;
|
||||
}
|
||||
const log = (await this.db.getLog(build.id)).map(logChunk => logChunk.chunk).join('\n');
|
||||
res.set('Content-Type', 'text/plain').send(log);
|
||||
});
|
||||
|
||||
app.get(`/${slug}/:id/patch{/}`, async (req, res) => {
|
||||
const build = await getBuildFn(req.params.id);
|
||||
if (!build || !build.patch) {
|
||||
res.sendStatus(404);
|
||||
return;
|
||||
}
|
||||
res.set('Content-Type', 'text/plain').send(build.patch);
|
||||
});
|
||||
|
||||
wsApp.ws(`/${slug}/:id/ws`, async (ws, req) => {
|
||||
const build = await getBuildFn(req.params.id);
|
||||
if (!build || (build.status !== 'queued' && build.status !== 'running')) {
|
||||
return ws.close();
|
||||
}
|
||||
console.log('WS Opened');
|
||||
const eventListener = (be: BuildEvent) => {
|
||||
if (be.id === build.id) {
|
||||
ws.send(JSON.stringify(be));
|
||||
}
|
||||
};
|
||||
this.buildController.on('log', eventListener);
|
||||
|
||||
ws.on('close', () => {
|
||||
console.log('WS Closed');
|
||||
this.buildController.removeListener('log', eventListener);
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
app.get('/healthcheck', (_, res) => {
|
||||
res.send('Healthy');
|
||||
});
|
||||
|
||||
if (oidc) {
|
||||
if (!sessionSecret) {
|
||||
throw new Error('sessionSecret must be set.');
|
||||
}
|
||||
app.use(session({
|
||||
name: 'sessionId',
|
||||
secret: sessionSecret,
|
||||
resave: true,
|
||||
saveUninitialized: false,
|
||||
store: this.db,
|
||||
cookie: {
|
||||
maxAge: notStupidParseInt(process.env['COOKIETTL']) || 1000 * 60 * 60 * 24 * 30, // 30 days
|
||||
httpOnly: true,
|
||||
secure: !!options.secure
|
||||
}
|
||||
}));
|
||||
passport.use(oidc);
|
||||
app.use(passport.initialize());
|
||||
app.use(passport.session());
|
||||
passport.serializeUser(function (user: User, done) {
|
||||
done(null, user.id);
|
||||
});
|
||||
|
||||
passport.deserializeUser(async (id: string, done) => {
|
||||
const user = await this.db.getUser(id);
|
||||
done(null, {
|
||||
id: user.id,
|
||||
username: user.username,
|
||||
displayName: user.displayName
|
||||
});
|
||||
});
|
||||
app.get('/login', (req, res) => {
|
||||
if (req?.user) {
|
||||
return res.redirect('/');
|
||||
}
|
||||
res.append('X-Robots-Tag', 'none');
|
||||
res.render('login-required', {
|
||||
page: {
|
||||
title: 'Archery',
|
||||
titlesuffix: 'Log In',
|
||||
description: 'Authentication required',
|
||||
}
|
||||
});
|
||||
});
|
||||
app.post('/login', passport.authenticate('openidconnect'));
|
||||
app.get('/cb', passport.authenticate('openidconnect', { successRedirect: '/', failureRedirect: '/login', failureMessage: true }));
|
||||
app.get('/logout', (req, res) => {
|
||||
req.logOut((err) => {
|
||||
if (err) {
|
||||
console.error(`Failed to log out user: ${err}`);
|
||||
}
|
||||
res.redirect('/login');
|
||||
});
|
||||
});
|
||||
createBuildPages('b', (id) => this.db.getBuildByUuid(id));
|
||||
app.use((req, res, next) => {
|
||||
if (!req?.user) {
|
||||
res.redirect('/login');
|
||||
return;
|
||||
}
|
||||
next();
|
||||
});
|
||||
}
|
||||
|
||||
app.get('/', async (req, res) => {
|
||||
try {
|
||||
const builds = 'q' in req.query ? await this.db.searchBuilds(req.query.q as string) : await this.db.getBuildsBy(req.query);
|
||||
@@ -80,6 +242,7 @@ class Web {
|
||||
titlesuffix: 'Dashboard',
|
||||
description: 'PKGBUILD central'
|
||||
},
|
||||
user: req?.user,
|
||||
builds,
|
||||
timeElapsed
|
||||
});
|
||||
@@ -90,7 +253,7 @@ class Web {
|
||||
}
|
||||
});
|
||||
|
||||
app.get('/build{/}', async(req, res) => {
|
||||
app.get('/build{/}', async (req, res) => {
|
||||
const query = ('id' in req.query && typeof req.query.id === 'string' && await this.db.getBuild(sqids.decode(req.query.id)?.[0])) || req.query;
|
||||
res.render('build-new', {
|
||||
page: {
|
||||
@@ -98,6 +261,7 @@ class Web {
|
||||
titlesuffix: 'New Build',
|
||||
description: 'Kick off a build',
|
||||
},
|
||||
user: req?.user,
|
||||
query
|
||||
});
|
||||
});
|
||||
@@ -108,32 +272,15 @@ class Web {
|
||||
req.body.commit || null,
|
||||
req.body.patch || null,
|
||||
req.body.distro || 'arch',
|
||||
req.body.dependencies || 'stable'
|
||||
req.body.dependencies || 'stable',
|
||||
req?.user?.['id'],
|
||||
crypto.randomUUID()
|
||||
);
|
||||
res.redirect(`/build/${sqids.encode([buildId])}`);
|
||||
res.redirect(`/build/${sqids.encode([buildId])}/`);
|
||||
this.buildController.triggerBuild();
|
||||
});
|
||||
|
||||
app.get('/build/:id{/}', async (req, res) => {
|
||||
const build = await this.db.getBuild(sqids.decode(req.params.id)?.[0]);
|
||||
if (!build) {
|
||||
res.sendStatus(404);
|
||||
return;
|
||||
}
|
||||
build.sqid = sqids.encode([build.id]);
|
||||
const log = splitLines(await this.db.getLog(build.id));
|
||||
|
||||
res.render('build', {
|
||||
page: {
|
||||
title: 'Archery',
|
||||
titlesuffix: `Build #${build.id}`,
|
||||
description: `Building ${build.repo} on ${build.distro}`
|
||||
},
|
||||
build,
|
||||
log,
|
||||
ended: build.status !== 'queued' && build.status !== 'running'
|
||||
});
|
||||
});
|
||||
createBuildPages('build', (id) => this.db.getBuild(sqids.decode(id)?.[0]));
|
||||
|
||||
app.get('/build/:id/cancel', async (req, res) => {
|
||||
const build = await this.db.getBuild(sqids.decode(req.params.id)?.[0]);
|
||||
@@ -147,47 +294,21 @@ class Web {
|
||||
catch (ex) {
|
||||
console.error(ex);
|
||||
}
|
||||
res.redirect(`/build/${req.params.id}`);
|
||||
res.redirect(`/build/${req.params.id}/`);
|
||||
});
|
||||
|
||||
app.get('/build/:id/logs{/}', async (req, res) => {
|
||||
app.post('/build/:id/persist', async (req, res) => {
|
||||
const build = await this.db.getBuild(sqids.decode(req.params.id)?.[0]);
|
||||
const persist = !! req?.body?.persist;
|
||||
if (!build) {
|
||||
res.sendStatus(404);
|
||||
return;
|
||||
}
|
||||
const log = (await this.db.getLog(build.id)).map(logChunk => logChunk.chunk).join('\n');
|
||||
res.set('Content-Type', 'text/plain').send(log);
|
||||
});
|
||||
|
||||
app.get('/build/:id/patch{/}', async (req, res) => {
|
||||
const build = await this.db.getBuild(sqids.decode(req.params.id)?.[0]);
|
||||
if (!build || !build.patch) {
|
||||
res.sendStatus(404);
|
||||
return;
|
||||
}
|
||||
res.set('Content-Type', 'text/plain').send(build.patch);
|
||||
});
|
||||
|
||||
app.get('/healthcheck', (_, res) => {
|
||||
res.send('Healthy');
|
||||
});
|
||||
|
||||
wsApp.ws('/build/:id/ws', (ws, req) => {
|
||||
console.log('WS Opened');
|
||||
const eventListener = (be: BuildEvent) => {
|
||||
if (be.id === sqids.decode(req.params.id)?.[0]) {
|
||||
ws.send(JSON.stringify(be));
|
||||
}
|
||||
};
|
||||
this.buildController.on('log', eventListener);
|
||||
|
||||
ws.on('close', () => {
|
||||
console.log('WS Closed');
|
||||
this.buildController.removeListener('log', eventListener);
|
||||
});
|
||||
});
|
||||
await this.db.persist(build.id, persist);
|
||||
res.sendStatus(200);
|
||||
})
|
||||
|
||||
this._webserver = this.app.listen(this.port, () => console.log(`archery is running on port ${this.port}`));
|
||||
}
|
||||
|
||||
close = () => {
|
||||
@@ -198,9 +319,33 @@ class Web {
|
||||
|
||||
setDB = (db: DB) => {
|
||||
this.db = db;
|
||||
if (!this._webserver) {
|
||||
this._webserver = this.app.listen(this.port, () => console.log(`archery is running on port ${this.port}`));
|
||||
}
|
||||
|
||||
initializeOIDC = async (options: WebConfig): Promise<OpenIDConnectStrategy | false> => {
|
||||
if (!options.oidc || !options.oidc.server || !options.oidc.clientId || !options.oidc.clientSecret) {
|
||||
return false;
|
||||
}
|
||||
const server = options.oidc.server.endsWith('/') ? options.oidc.server : `${options.oidc.server}/`;
|
||||
const baseUrl = options.oidc.appBaseUrl.endsWith('/') ? options.oidc.appBaseUrl : `${options.oidc.appBaseUrl}/`;
|
||||
const openidconf = await ky.get(`${server}.well-known/openid-configuration`).json<OpenIdConfiguration>();
|
||||
return new OpenIDConnectStrategy({
|
||||
issuer: openidconf.issuer,
|
||||
authorizationURL: openidconf.authorization_endpoint,
|
||||
tokenURL: openidconf.token_endpoint,
|
||||
userInfoURL: openidconf.userinfo_endpoint,
|
||||
clientID: options.oidc.clientId,
|
||||
clientSecret: options.oidc.clientSecret,
|
||||
callbackURL: `${baseUrl}cb`,
|
||||
scope: 'profile'
|
||||
}, async (_: string, profile: passport.Profile, cb: OpenIDConnectStrategy.VerifyCallback) => {
|
||||
const userObj: User = {
|
||||
id: profile.id,
|
||||
username: profile.username,
|
||||
displayName: profile.displayName
|
||||
};
|
||||
await this.db.upsertUser(userObj);
|
||||
return cb(null, userObj);
|
||||
});
|
||||
}
|
||||
|
||||
setBuildController = (buildController: BuildController) => {
|
||||
@@ -209,5 +354,5 @@ class Web {
|
||||
}
|
||||
|
||||
export default Web;
|
||||
export { Web };
|
||||
export { Web, notStupidParseInt };
|
||||
export type { WebConfig };
|
||||
|
||||
@@ -5,20 +5,23 @@ import { DB } from './DB.ts';
|
||||
import { BuildController } from './BuildController.ts';
|
||||
import type { WebConfig } from './Web.ts';
|
||||
import type { DBConfig } from './DB.ts';
|
||||
import type { ControllerConfig } from './BuildController.ts';
|
||||
|
||||
interface compositeConfig {
|
||||
web?: WebConfig,
|
||||
db?: DBConfig
|
||||
db?: DBConfig,
|
||||
controller?: ControllerConfig,
|
||||
}
|
||||
|
||||
const config: compositeConfig = JSON.parse(await fs.promises.readFile(process.env.config || process.env.CONFIG || path.join('config', 'config.json'), 'utf-8'));
|
||||
const config: compositeConfig = JSON.parse(await fs.promises.readFile(process.env.config || process.env.CONFIG || path.join(process.cwd(), 'config', 'config.json'), 'utf-8'));
|
||||
|
||||
const web = new Web(config.web);
|
||||
const buildController = new BuildController();
|
||||
const buildController = new BuildController(config.controller);
|
||||
await new Promise((resolve) => setTimeout(resolve, 1500));
|
||||
const db = new DB(config.db);
|
||||
web.setDB(db);
|
||||
web.setBuildController(buildController);
|
||||
web.initialize();
|
||||
buildController.setDB(db);
|
||||
|
||||
process.on('SIGTERM', () => {
|
||||
|
||||
@@ -118,6 +118,15 @@ input[type="submit"] {
|
||||
}
|
||||
}
|
||||
|
||||
span,
|
||||
a {
|
||||
|
||||
&:has(+ button.copybtn) {
|
||||
float: left;
|
||||
margin-right: .75em;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
.sidebar {
|
||||
background: var(--primary);
|
||||
@@ -190,6 +199,10 @@ input[type="submit"] {
|
||||
&.no-padding {
|
||||
padding: 0;
|
||||
}
|
||||
|
||||
&:has(+ .content.footer) {
|
||||
padding-bottom: 3em;
|
||||
}
|
||||
}
|
||||
|
||||
.overflow-x {
|
||||
@@ -231,9 +244,13 @@ input[type="submit"] {
|
||||
.content.footer {
|
||||
background: var(--primary-dark);
|
||||
color: var(--color-text);
|
||||
margin-top: .5em;
|
||||
padding: .25em 1em;
|
||||
|
||||
position: fixed;
|
||||
bottom: 0;
|
||||
left: 0;
|
||||
right: 0;
|
||||
|
||||
a {
|
||||
color: var(--color-text);
|
||||
text-decoration: underline;
|
||||
@@ -251,6 +268,10 @@ input[type="submit"] {
|
||||
}
|
||||
}
|
||||
|
||||
.display-none {
|
||||
display: none;
|
||||
}
|
||||
|
||||
#followCheckmarkContainer {
|
||||
display: inline-block;
|
||||
position: fixed;
|
||||
|
||||
@@ -10,25 +10,39 @@
|
||||
<div class="content">
|
||||
<h1>Build #<%= build.id %></h1>
|
||||
<h2 id="buildStatus"><%= build.status %></h2>
|
||||
<% if (!public) { %>
|
||||
<h3 id="sqid" class="display-none"><%= build.sqid %></h3>
|
||||
<% } %>
|
||||
<div class="overflow-x">
|
||||
<div class="grid-2col">
|
||||
<label>Repo</label> <span><%= build.repo %></span>
|
||||
<label>Repo</label> <span><span><%= build.repo %></span> <button class="copybtn">Copy</button></span>
|
||||
<label>Commit</label> <span><% if (build.commit) { %><%= build.commit %><% } else { %>latest<% } %></span>
|
||||
<label>Patch</label> <span><% if (build.patch) { %><a href="/build/<%= build.sqid %>/patch">patch file</a><% } else { %>none<% } %></span>
|
||||
<label>Distro</label> <span><%= build.distro %></span>
|
||||
<label>Dependencies</label> <span><%= build.dependencies %></span>
|
||||
<label>Start time</label> <span class="to-local-time"><%= build.startTime %></span>
|
||||
<% if (build.userId && build.userId !== '-1') { %>
|
||||
<label>Triggered by</label> <span><%= build.user.displayName %> (<%= build.user.username %>)</span>
|
||||
<% } %>
|
||||
<% if (!public) { %>
|
||||
<label>Persist</label> <span><input id="persistChk" type="checkbox" <% if (build.persist) { %>checked<% } %>/></span>
|
||||
<% } %>
|
||||
<% if (locals.shareable) { %>
|
||||
<label>Shareable link</label> <span><a href="<%= shareable %>"><%= shareable %></a> <button class="copybtn">Copy</button></span>
|
||||
<% } %>
|
||||
</div>
|
||||
</div>
|
||||
<% if (build.sqid && !public) { %>
|
||||
<div>
|
||||
<a href="/build?id=<%= build.sqid %>" class="button">Clone</a>
|
||||
</div>
|
||||
<% if (!ended) { %>
|
||||
<% } %>
|
||||
<% if (!ended && !public) { %>
|
||||
<div id="cancelRow">
|
||||
<a href="/build/<%= build.sqid %>/cancel" class="button">Cancel build</a>
|
||||
<a href="cancel" class="button">Cancel build</a>
|
||||
</div>
|
||||
<% } %>
|
||||
<p><a href="/build/<%= build.sqid %>/logs">Full logs</a></p>
|
||||
<p><a href="logs">Full logs</a></p>
|
||||
<pre class="overflow-x"><div class="logs" id="logs"><% (log || []).forEach(line => { %><p><%= line %></p><% }) %></div></pre>
|
||||
|
||||
<% if (!ended) { %>
|
||||
@@ -39,6 +53,7 @@
|
||||
</div>
|
||||
<%- include("footer", locals) %>
|
||||
<script src="/assets/js/timezone.js?v1" nonce="<%= cspNonce %>"></script>
|
||||
<script src="/assets/js/form.js?v1" nonce="<%= cspNonce %>"></script>
|
||||
<% if (!ended) { %>
|
||||
<script src="/assets/js/build.js?v3" nonce="<%= cspNonce %>"></script>
|
||||
<% } %>
|
||||
|
||||
@@ -14,7 +14,7 @@
|
||||
<link rel="canonical" href="<%= page.canonical%>"/>
|
||||
<% } %>
|
||||
<link rel="shortcut icon" href="/assets/svg/favicon.svg">
|
||||
<link rel="stylesheet" href="/assets/css/styles.css?v3">
|
||||
<link rel="stylesheet" href="/assets/css/styles.css?v5">
|
||||
<script nonce="<%= cspNonce %>">
|
||||
document.addEventListener("DOMContentLoaded", function() {
|
||||
document.body.classList.remove('preload');
|
||||
|
||||
@@ -20,7 +20,7 @@
|
||||
</tr>
|
||||
<% builds.forEach(build => { %>
|
||||
<tr>
|
||||
<td><a href="/build/<%= build.sqid %>"><%= build.repo %></a></td>
|
||||
<td><a href="/build/<%= build.sqid %>/"><%= build.repo %></a></td>
|
||||
<td><%= build.distro %></td>
|
||||
<td class="to-local-time"><%= build.startTime %></td>
|
||||
<td><%= timeElapsed(build.startTime, build.endTime) %></td>
|
||||
|
||||
19
views/login-required.ejs
Normal file
19
views/login-required.ejs
Normal file
@@ -0,0 +1,19 @@
|
||||
<!DOCTYPE html>
|
||||
<html xmlns="http://www.w3.org/1999/xhtml" lang="en">
|
||||
|
||||
<head>
|
||||
<%- include("head", locals) %>
|
||||
</head>
|
||||
|
||||
<body class="preload">
|
||||
<%- include("navigation", locals) %>
|
||||
<div class="content">
|
||||
<h1>Authentication Required</h1>
|
||||
You must log in to access that page.
|
||||
<form action="/login" method="post">
|
||||
<button type="submit">Log In</button>
|
||||
</form>
|
||||
</div>
|
||||
<%- include("footer", locals) %>
|
||||
</body>
|
||||
</html>
|
||||
@@ -14,6 +14,9 @@
|
||||
<li><a href="/?distro=arch">Arch Builds</a></li>
|
||||
<li><a href="/?distro=artix">Artix Builds</a></li>
|
||||
<li><a href="/build">New Build</a></li>
|
||||
<% if (locals.user) { %>
|
||||
<li><a href="/logout">Log Out</a></li>
|
||||
<% } %>
|
||||
</ul>
|
||||
</nav>
|
||||
</div>
|
||||
Reference in New Issue
Block a user