Compare commits
1 Commits
92b00934a2
...
698a6c7e19
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
698a6c7e19 |
@ -16,10 +16,7 @@
|
|||||||
"enabled": true,
|
"enabled": true,
|
||||||
"includes": ["src/**", "!src/types/openapi.d.ts"],
|
"includes": ["src/**", "!src/types/openapi.d.ts"],
|
||||||
"rules": {
|
"rules": {
|
||||||
"recommended": true,
|
"recommended": true
|
||||||
"style": {
|
|
||||||
"noNonNullAssertion": "off"
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"javascript": {
|
"javascript": {
|
||||||
|
|||||||
@ -1,6 +1,6 @@
|
|||||||
import * as v from "valibot";
|
import { ConfigSchema, CONFIG_SCHEMA_KEYS, type Config } from "./schema";
|
||||||
import { CONFIG_SCHEMA_KEYS, type Config, ConfigSchema } from "./schema";
|
|
||||||
import { transformEnvToConfig } from "./transformer";
|
import { transformEnvToConfig } from "./transformer";
|
||||||
|
import * as v from "valibot";
|
||||||
|
|
||||||
function createConfig(): Config {
|
function createConfig(): Config {
|
||||||
const rawConfig = transformEnvToConfig(
|
const rawConfig = transformEnvToConfig(
|
||||||
|
|||||||
@ -26,7 +26,7 @@ export function transformEnvToConfig<Keys extends string[]>(
|
|||||||
// descend into the deeper layers
|
// descend into the deeper layers
|
||||||
// (following keyPath)
|
// (following keyPath)
|
||||||
let current: Record<string, unknown> = config;
|
let current: Record<string, unknown> = config;
|
||||||
for (const part of keyPathParts.slice(0, -1)) {
|
for (let part of keyPathParts.slice(0, -1)) {
|
||||||
if (!(part in current)) {
|
if (!(part in current)) {
|
||||||
current[part] = {};
|
current[part] = {};
|
||||||
}
|
}
|
||||||
|
|||||||
@ -18,7 +18,7 @@ authRouter.get("/login/:forgeId", (req: Request, res: Response) => {
|
|||||||
}
|
}
|
||||||
|
|
||||||
const forgeId = parseInt(forgeIdParam, 10);
|
const forgeId = parseInt(forgeIdParam, 10);
|
||||||
if (Number.isNaN(forgeId)) {
|
if (isNaN(forgeId)) {
|
||||||
res.status(400).json({ error: "Invalid forgeId" });
|
res.status(400).json({ error: "Invalid forgeId" });
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|||||||
@ -1,8 +1,8 @@
|
|||||||
import express from "express";
|
import express from "express";
|
||||||
import session from "express-session";
|
import session from "express-session";
|
||||||
import { createOpenAPIBackend, createOpenAPIMiddleware } from "./api/openapi";
|
import { createOpenAPIBackend, createOpenAPIMiddleware } from "./api/openapi";
|
||||||
import { config } from "./config";
|
|
||||||
import { connectDB } from "./config/db";
|
import { connectDB } from "./config/db";
|
||||||
|
import { config } from "./config";
|
||||||
import authRouter from "./routes/auth";
|
import authRouter from "./routes/auth";
|
||||||
import { seedForges } from "./util/seedforges";
|
import { seedForges } from "./util/seedforges";
|
||||||
|
|
||||||
|
|||||||
@ -1,9 +1,9 @@
|
|||||||
import * as arctic from "arctic";
|
import * as arctic from "arctic";
|
||||||
import type { ForgeInstanceConfig } from "../../config/schema";
|
|
||||||
import type { Forge } from "../../types/forge";
|
import type { Forge } from "../../types/forge";
|
||||||
import type { ForgeUser } from "../../types/forgeuser";
|
import type { ForgeUser } from "../../types/forgeuser";
|
||||||
import type { GiteaRepo } from "../../types/gitearepo";
|
import type { GiteaRepo } from "../../types/gitearepo";
|
||||||
import type { Repository } from "../../types/openapi";
|
import type { Repository } from "../../types/openapi";
|
||||||
|
import { ForgeInstanceConfig } from "../../config/schema";
|
||||||
export class GiteaForge implements Forge {
|
export class GiteaForge implements Forge {
|
||||||
private gitea: arctic.Gitea;
|
private gitea: arctic.Gitea;
|
||||||
private forgeId: number;
|
private forgeId: number;
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user