FROM node:20-alpine AS base
WORKDIR /app
RUN apk add --no-cache libc6-compat
FROM base AS deps
COPY package.json package-lock.json ./
name: CI
on:
push:
branches: [main]
pull_request:
export interface PageInfo {
hasNextPage: boolean;
hasPreviousPage: boolean;
startCursor: string | null;
endCursor: string | null;
}
export const FLAG_REGISTRY = {
newDashboard: {
default: false as boolean,
description: 'Renders the redesigned dashboard shell',
},
maxUploadMb: {
import { Writable } from "node:stream";
import type { Pool } from "pg";
interface Row {
email: string;
name: string;
import { defaultSchema, type Schema } from 'hast-util-sanitize';
export const markdownSchema: Schema = {
...defaultSchema,
attributes: {
...defaultSchema.attributes,
import { JSDOM } from 'jsdom';
import createDOMPurify, { DOMPurifyI } from 'dompurify';
const { window } = new JSDOM('');
const DOMPurify: DOMPurifyI = createDOMPurify(window as unknown as Window);
import { Registry, Histogram, Counter, collectDefaultMetrics } from 'prom-client';
export const register = new Registry();
collectDefaultMetrics({ register });
export type ErrorCode =
| 'VALIDATION'
| 'UNAUTHENTICATED'
| 'FORBIDDEN'
| 'NOT_FOUND'
| 'CONFLICT'
import { S3Client } from "@aws-sdk/client-s3";
import { createPresignedPost, PresignedPost } from "@aws-sdk/s3-presigned-post";
import { randomUUID } from "crypto";
const s3 = new S3Client({ region: process.env.AWS_REGION });
const BUCKET = process.env.UPLOAD_BUCKET!;
import express from 'express';
import cookieParser from 'cookie-parser';
import { issueCsrfToken, csrfProtection } from './csrf';
import { transfersRouter } from './routes/transfers';
const app = express();
import { randomBytes } from 'crypto';
import { Request, Response, NextFunction } from 'express';
interface CspOptions {
reportOnly?: boolean;
reportUri?: string;