fix: temp save

This commit is contained in:
2025-04-05 07:02:47 +08:00
parent 27b52f7fd1
commit ecb56013a5
11 changed files with 1804 additions and 102 deletions

View File

@@ -8,6 +8,7 @@ FROM nodebt AS deps
RUN mkdir -p /app/workspace
WORKDIR /app
COPY package.json /app/
RUN pnpm approve-builds utf-8-validate node-datachannel utp-native
RUN --mount=type=cache,id=pnpm,target=/pnpm/store pnpm install --no-frozen-lockfile
FROM deps AS app

View File

@@ -12,6 +12,7 @@ import WebTorrent, { type Torrent } from 'webtorrent';
// Configuration
const API_PORT = 6080;
const TRACKER_PORT = 6081;
const SEEDING_PORT = 6082;
const STATIC_API_PATH = '/api/static';
const LOCAL_IP = '127.0.0.1';
const WORKSPACE_PATH = 'workspace';
@@ -72,7 +73,10 @@ async function startTracker(): Promise<void> {
}
// Tracker and WebTorrent client
const webTorrent = new WebTorrent({});
const webTorrent = new WebTorrent({
// @ts-ignore
torrentPort: SEEDING_PORT,
});
// Generate mock file
async function generateMockFile(filePath: string, size: number) {

View File

@@ -18,12 +18,5 @@
"devDependencies": {
"@types/create-torrent": "^5.0.2",
"@types/webtorrent": "^0.110.0"
},
"pnpm": {
"onlyBuiltDependencies": [
"utf-8-validate",
"node-datachannel",
"utp-native"
]
}
}

View File

@@ -0,0 +1,9 @@
{
"extends": "../../tsconfig.base.json",
"compilerOptions": {
"baseUrl": ".",
"composite": true
},
"include": ["./main.ts"],
"exclude": ["node_modules"]
}