Compare commits
2 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| bda9bc5aa5 | |||
| adb7400e87 |
@@ -1,4 +1,4 @@
|
|||||||
FROM node:23-alpine AS base
|
FROM node:24-alpine AS base
|
||||||
FROM base AS build-env
|
FROM base AS build-env
|
||||||
|
|
||||||
WORKDIR /build
|
WORKDIR /build
|
||||||
|
|||||||
@@ -18,6 +18,7 @@ NoProgressBar
|
|||||||
VerbosePkgLists
|
VerbosePkgLists
|
||||||
ParallelDownloads = 5
|
ParallelDownloads = 5
|
||||||
DownloadUser = alpm
|
DownloadUser = alpm
|
||||||
|
DisableSandbox
|
||||||
SigLevel = Required DatabaseOptional
|
SigLevel = Required DatabaseOptional
|
||||||
LocalFileSigLevel = Optional
|
LocalFileSigLevel = Optional
|
||||||
|
|
||||||
|
|||||||
@@ -18,6 +18,7 @@ NoProgressBar
|
|||||||
VerbosePkgLists
|
VerbosePkgLists
|
||||||
ParallelDownloads = 5
|
ParallelDownloads = 5
|
||||||
DownloadUser = alpm
|
DownloadUser = alpm
|
||||||
|
DisableSandbox
|
||||||
SigLevel = Required DatabaseOptional
|
SigLevel = Required DatabaseOptional
|
||||||
LocalFileSigLevel = Optional
|
LocalFileSigLevel = Optional
|
||||||
|
|
||||||
|
|||||||
4
package-lock.json
generated
4
package-lock.json
generated
@@ -1,12 +1,12 @@
|
|||||||
{
|
{
|
||||||
"name": "archery",
|
"name": "archery",
|
||||||
"version": "0.3.1",
|
"version": "0.3.2",
|
||||||
"lockfileVersion": 3,
|
"lockfileVersion": 3,
|
||||||
"requires": true,
|
"requires": true,
|
||||||
"packages": {
|
"packages": {
|
||||||
"": {
|
"": {
|
||||||
"name": "archery",
|
"name": "archery",
|
||||||
"version": "0.3.1",
|
"version": "0.3.2",
|
||||||
"license": "MIT",
|
"license": "MIT",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"body-parser": "^2.2.1",
|
"body-parser": "^2.2.1",
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "archery",
|
"name": "archery",
|
||||||
"version": "0.3.1",
|
"version": "0.3.2",
|
||||||
"description": "Build Arch packages through a web interface",
|
"description": "Build Arch packages through a web interface",
|
||||||
"keywords": [
|
"keywords": [
|
||||||
"docker",
|
"docker",
|
||||||
|
|||||||
13
src/Web.ts
13
src/Web.ts
@@ -53,13 +53,20 @@ function splitLines(lines: LogChunk[]) {
|
|||||||
return lines.map(logChunk => logChunk.chunk.split('\n')).flat().map(line => line.substring(line.lastIndexOf('\r') + 1));
|
return lines.map(logChunk => logChunk.chunk.split('\n')).flat().map(line => line.substring(line.lastIndexOf('\r') + 1));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function resolvePackageRepo(repo: string) {
|
||||||
|
if (/^[a-zA-Z]+:\/\//.test(repo) || repo.toLowerCase().endsWith('.git')) {
|
||||||
|
return repo;
|
||||||
|
}
|
||||||
|
return `https://gitlab.archlinux.org/archlinux/packaging/packages/${repo}.git`;
|
||||||
|
}
|
||||||
|
|
||||||
class Web {
|
class Web {
|
||||||
private _webserver: http.Server | null = null;
|
private _webserver: http.Server | null = null;
|
||||||
private db: DB;
|
private db: DB;
|
||||||
private buildController: BuildController;
|
private buildController: BuildController;
|
||||||
private app: expressWs.Application;
|
private app: expressWs.Application;
|
||||||
private port: number;
|
private port: number;
|
||||||
private options:WebConfig;
|
private options: WebConfig;
|
||||||
|
|
||||||
constructor(options: WebConfig = {}) {
|
constructor(options: WebConfig = {}) {
|
||||||
this.options = options;
|
this.options = options;
|
||||||
@@ -268,7 +275,7 @@ class Web {
|
|||||||
|
|
||||||
app.post('/build{/}', async (req, res) => {
|
app.post('/build{/}', async (req, res) => {
|
||||||
const buildId = await this.db.createBuild(
|
const buildId = await this.db.createBuild(
|
||||||
req.body.repo,
|
resolvePackageRepo(req.body.repo),
|
||||||
req.body.commit || null,
|
req.body.commit || null,
|
||||||
req.body.patch || null,
|
req.body.patch || null,
|
||||||
req.body.distro || 'arch',
|
req.body.distro || 'arch',
|
||||||
@@ -299,7 +306,7 @@ class Web {
|
|||||||
|
|
||||||
app.post('/build/:id/persist', async (req, res) => {
|
app.post('/build/:id/persist', async (req, res) => {
|
||||||
const build = await this.db.getBuild(sqids.decode(req.params.id)?.[0]);
|
const build = await this.db.getBuild(sqids.decode(req.params.id)?.[0]);
|
||||||
const persist = !! req?.body?.persist;
|
const persist = !!req?.body?.persist;
|
||||||
if (!build) {
|
if (!build) {
|
||||||
res.sendStatus(404);
|
res.sendStatus(404);
|
||||||
return;
|
return;
|
||||||
|
|||||||
Reference in New Issue
Block a user