Skip to content

Commit 15c5059

Browse files
sftp in web 1/2 + landing redesign
1 parent 5731837 commit 15c5059

14 files changed

Lines changed: 2812 additions & 553 deletions

File tree

backend/bun.lock

Lines changed: 86 additions & 88 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

backend/package.json

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,7 @@
4848
"sharp": "^0.34.5",
4949
"speakeasy": "latest",
5050
"srvx": "latest",
51+
"ssh2": "^1.17.0",
5152
"tar": "^7.5.13",
5253
"typeorm": "^0.3.28",
5354
"uuid": "latest",
@@ -65,6 +66,7 @@
6566
"@types/node": "latest",
6667
"@types/nodemailer": "latest",
6768
"@types/uuid": "latest",
69+
"@types/ssh2": "latest",
6870
"@types/ws": "latest",
6971
"typescript": "latest"
7072
},

backend/pnpm-lock.yaml

Lines changed: 79 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

backend/src/app.ts

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -272,7 +272,7 @@ const app = new Elysia()
272272
},
273273
credentials: true,
274274
methods: ['GET', 'HEAD', 'PUT', 'PATCH', 'POST', 'DELETE', 'OPTIONS'],
275-
allowedHeaders: ['Content-Type', 'Authorization', 'X-Requested-With', 'Accept', 'Origin'],
275+
allowedHeaders: ['Content-Type', 'Authorization', 'X-Requested-With', 'Accept', 'Origin', 'x-sftp-password', 'x-path'],
276276
exposeHeaders: ['Content-Type', 'Content-Length', 'Cache-Control'],
277277
}))
278278
.use(helmet())
@@ -295,9 +295,9 @@ app.onError((ctx: any) => {
295295
status = ctx.code;
296296
}
297297

298-
if (status === 404) {
298+
if (status === 404) {
299299
const origin = (ctx.request as Request)?.headers?.get?.('origin') || '*';
300-
return new Response(JSON.stringify({ error: 'Route not found' }), { status: 404, headers: { 'Content-Type': 'application/json', 'Access-Control-Allow-Origin': origin, 'Access-Control-Allow-Credentials': 'true', 'Access-Control-Allow-Headers': 'Content-Type, Authorization, X-Requested-With, Accept, Origin', 'Access-Control-Expose-Headers': 'Content-Type, Content-Length, Cache-Control' } });
300+
return new Response(JSON.stringify({ error: 'Route not found' }), { status: 404, headers: { 'Content-Type': 'application/json', 'Access-Control-Allow-Origin': origin, 'Access-Control-Allow-Credentials': 'true', 'Access-Control-Allow-Headers': 'Content-Type, Authorization, X-Requested-With, Accept, Origin, x-sftp-password, x-path', 'Access-Control-Expose-Headers': 'Content-Type, Content-Length, Cache-Control' } });
301301
}
302302

303303
const log = (app as any).log || console;
@@ -324,11 +324,11 @@ app.onError((ctx: any) => {
324324
}
325325

326326
const origin = (ctx.request as Request)?.headers?.get?.('origin') || '*';
327-
return new Response(JSON.stringify({ error: 'Internal server error' }), { status: 500, headers: { 'Content-Type': 'application/json', 'Access-Control-Allow-Origin': origin, 'Access-Control-Allow-Credentials': 'true', 'Access-Control-Allow-Headers': 'Content-Type, Authorization, X-Requested-With, Accept, Origin', 'Access-Control-Expose-Headers': 'Content-Type, Content-Length, Cache-Control' } });
327+
return new Response(JSON.stringify({ error: 'Internal server error' }), { status: 500, headers: { 'Content-Type': 'application/json', 'Access-Control-Allow-Origin': origin, 'Access-Control-Allow-Credentials': 'true', 'Access-Control-Allow-Headers': 'Content-Type, Authorization, X-Requested-With, Accept, Origin, x-sftp-password, x-path', 'Access-Control-Expose-Headers': 'Content-Type, Content-Length, Cache-Control' } });
328328
}
329329

330330
const origin = (ctx.request as Request)?.headers?.get?.('origin') || '*';
331-
return new Response(JSON.stringify({ error: ctx.error?.message ?? 'Request error' }), { status, headers: { 'Content-Type': 'application/json', 'Access-Control-Allow-Origin': origin, 'Access-Control-Allow-Credentials': 'true', 'Access-Control-Allow-Headers': 'Content-Type, Authorization, X-Requested-With, Accept, Origin', 'Access-Control-Expose-Headers': 'Content-Type, Content-Length, Cache-Control' } });
331+
return new Response(JSON.stringify({ error: ctx.error?.message ?? 'Request error' }), { status, headers: { 'Content-Type': 'application/json', 'Access-Control-Allow-Origin': origin, 'Access-Control-Allow-Credentials': 'true', 'Access-Control-Allow-Headers': 'Content-Type, Authorization, X-Requested-With, Accept, Origin, x-sftp-password, x-path', 'Access-Control-Expose-Headers': 'Content-Type, Content-Length, Cache-Control' } });
332332
});
333333

334334
declare module 'elysia' {

0 commit comments

Comments
 (0)