mirror of
https://github.com/whoswhip/Sharpbin.git
synced 2026-12-06 02:48:43 +00:00
fix: lower vulnerabilities + harden docker setup
also includes a github workflow
This commit is contained in:
@@ -1,13 +1,15 @@
|
||||
import type { LayoutServerLoad } from './$types';
|
||||
import { error } from '@sveltejs/kit';
|
||||
|
||||
export const load: LayoutServerLoad = async ({ fetch, url }) => {
|
||||
try {
|
||||
const res = await fetch('/api/auth/info');
|
||||
const pasteOptionsRes = await fetch('/api/paste/info');
|
||||
const options = await res.json();
|
||||
const pasteOptions = await pasteOptionsRes.json();
|
||||
return { options, pasteOptions, url: url.href };
|
||||
} catch {
|
||||
return { options: null, pasteOptions: null, url: url.href };
|
||||
const res = await fetch('/api/auth/info');
|
||||
const pasteOptionsRes = await fetch('/api/paste/info');
|
||||
|
||||
if (!res.ok || !pasteOptionsRes.ok) {
|
||||
throw error(503, 'Failed to load site configuration.');
|
||||
}
|
||||
|
||||
const options = await res.json();
|
||||
const pasteOptions = await pasteOptionsRes.json();
|
||||
return { options, pasteOptions, url: url.href };
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user