mirror of
https://github.com/LukeHagar/website.git
synced 2025-12-09 04:22:13 +00:00
Merge branch 'main' into button-component
This commit is contained in:
1
global.d.ts
vendored
Normal file
1
global.d.ts
vendored
Normal file
@@ -0,0 +1 @@
|
||||
declare module 'reodotdev';
|
||||
@@ -43,7 +43,6 @@
|
||||
"@melt-ui/pp": "^0.3.2",
|
||||
"@melt-ui/svelte": "^0.86.5",
|
||||
"@playwright/test": "^1.50.0",
|
||||
"@sentry/sveltekit": "^9.10.1",
|
||||
"@sveltejs/adapter-node": "^5.2.12",
|
||||
"@sveltejs/enhanced-img": "^0.4.4",
|
||||
"@sveltejs/kit": "^2.20.2",
|
||||
@@ -82,6 +81,7 @@
|
||||
"prettier-plugin-svelte": "^3.3.3",
|
||||
"prettier-plugin-tailwindcss": "^0.6.11",
|
||||
"remeda": "^2.20.0",
|
||||
"reodotdev": "^1.0.0",
|
||||
"sass": "^1.83.4",
|
||||
"svelte": "^5.25.6",
|
||||
"svelte-check": "^4.0.0",
|
||||
@@ -97,12 +97,11 @@
|
||||
"vite-plugin-dynamic-import": "^1.6.0",
|
||||
"vite-plugin-image-optimizer": "^1.1.8",
|
||||
"vite-plugin-manifest-sri": "^0.2.0",
|
||||
"vitest": "^1.6.0"
|
||||
"vitest": "^3.1.1"
|
||||
},
|
||||
"pnpm": {
|
||||
"onlyBuiltDependencies": [
|
||||
"@parcel/watcher",
|
||||
"@sentry/cli",
|
||||
"core-js",
|
||||
"esbuild",
|
||||
"sharp",
|
||||
|
||||
2036
pnpm-lock.yaml
generated
2036
pnpm-lock.yaml
generated
File diff suppressed because it is too large
Load Diff
@@ -1,22 +0,0 @@
|
||||
import { dev } from '$app/environment';
|
||||
import { SENTRY_DSN } from '$lib/constants';
|
||||
import * as Sentry from '@sentry/sveltekit';
|
||||
import { handleErrorWithSentry } from '@sentry/sveltekit';
|
||||
|
||||
Sentry.init({
|
||||
enabled: !dev,
|
||||
dsn: SENTRY_DSN,
|
||||
allowUrls: [/appwrite\.io/],
|
||||
tracesSampleRate: 1.0,
|
||||
|
||||
// This sets the sample rate to be 10%. You may want this to be 100% while
|
||||
// in development and sample at a lower rate in production
|
||||
replaysSessionSampleRate: 0,
|
||||
|
||||
// If the entire session is not sampled, use the below sample rate to sample
|
||||
// sessions when an error occurs.
|
||||
replaysOnErrorSampleRate: 0
|
||||
});
|
||||
|
||||
// If you have a custom error handler, pass it to `handleErrorWithSentry`
|
||||
export const handleError = handleErrorWithSentry();
|
||||
@@ -1,135 +0,0 @@
|
||||
import * as Sentry from '@sentry/sveltekit';
|
||||
import type { Handle } from '@sveltejs/kit';
|
||||
import redirects from './redirects.json';
|
||||
import { sequence } from '@sveltejs/kit/hooks';
|
||||
import { BANNER_KEY, SENTRY_DSN } from '$lib/constants';
|
||||
import { dev } from '$app/environment';
|
||||
|
||||
Sentry.init({
|
||||
enabled: !dev,
|
||||
dsn: SENTRY_DSN,
|
||||
tracesSampleRate: 1,
|
||||
allowUrls: [/appwrite\.io/]
|
||||
});
|
||||
|
||||
const redirectMap = new Map(redirects.map(({ link, redirect }) => [link, redirect]));
|
||||
|
||||
const redirecter: Handle = async ({ event, resolve }) => {
|
||||
const currentPath = event.url.pathname;
|
||||
if (redirectMap.has(currentPath)) {
|
||||
return new Response(null, {
|
||||
status: 308,
|
||||
headers: {
|
||||
location: redirectMap.get(currentPath) ?? ''
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
return await resolve(event);
|
||||
};
|
||||
|
||||
const securityheaders: Handle = async ({ event, resolve }) => {
|
||||
const nonce = Buffer.from(crypto.randomUUID()).toString('base64');
|
||||
(event.locals as { nonce: string }).nonce = nonce;
|
||||
|
||||
const response = await resolve(event, {
|
||||
transformPageChunk: ({ html }) => {
|
||||
return html.replace(/%sveltekit.nonce%/g, nonce);
|
||||
}
|
||||
});
|
||||
|
||||
// `true` if deployed via Coolify.
|
||||
const isPreview = !!process.env.COOLIFY_FQDN;
|
||||
// COOLIFY_FQDN already includes `http`.
|
||||
const previewDomain = isPreview ? `${process.env.COOLIFY_FQDN}` : null;
|
||||
const join = (arr: string[]) => arr.join(' ');
|
||||
|
||||
const cspDirectives: Record<string, string> = {
|
||||
'default-src': "'self'",
|
||||
'script-src': join([
|
||||
"'self'",
|
||||
'blob:',
|
||||
"'unsafe-inline'",
|
||||
"'unsafe-eval'",
|
||||
'https://*.posthog.com',
|
||||
'https://*.plausible.io',
|
||||
'https://*.reo.dev',
|
||||
'https://plausible.io',
|
||||
'https://js.zi-scripts.com',
|
||||
'https://ws.zoominfo.com'
|
||||
]),
|
||||
'style-src': "'self' 'unsafe-inline'",
|
||||
'img-src': "'self' data: https:",
|
||||
'font-src': "'self'",
|
||||
'object-src': "'none'",
|
||||
'base-uri': "'self'",
|
||||
'form-action': "'self'",
|
||||
'frame-ancestors': join(["'self'", 'https://www.youtube.com', 'https://*.vimeo.com']),
|
||||
'block-all-mixed-content': '',
|
||||
'upgrade-insecure-requests': '',
|
||||
'connect-src': join([
|
||||
"'self'",
|
||||
'https://*.appwrite.io',
|
||||
'https://*.appwrite.org',
|
||||
'https://*.posthog.com',
|
||||
'https://*.sentry.io',
|
||||
'https://*.plausible.io',
|
||||
'https://plausible.io',
|
||||
'https://*.reo.dev',
|
||||
'https://js.zi-scripts.com',
|
||||
'https://aorta.clickagy.com',
|
||||
'https://hemsync.clickagy.com',
|
||||
'https://ws.zoominfo.com '
|
||||
]),
|
||||
'frame-src': join([
|
||||
"'self'",
|
||||
'https://www.youtube.com',
|
||||
'https://status.appwrite.online',
|
||||
'https://www.youtube-nocookie.com',
|
||||
'https://player.vimeo.com',
|
||||
'https://hemsync.clickagy.com'
|
||||
])
|
||||
};
|
||||
|
||||
if (isPreview) {
|
||||
delete cspDirectives['block-all-mixed-content'];
|
||||
delete cspDirectives['upgrade-insecure-requests'];
|
||||
['default-src', 'script-src', 'style-src', 'img-src', 'font-src', 'connect-src'].forEach(
|
||||
(key) => {
|
||||
cspDirectives[key] += ` ${previewDomain}`;
|
||||
}
|
||||
);
|
||||
}
|
||||
|
||||
const cspDirectivesString = Object.entries(cspDirectives)
|
||||
.map(([key, value]) => `${key} ${value}`.trim())
|
||||
.join('; ');
|
||||
|
||||
// Set security headers
|
||||
response.headers.set('Content-Security-Policy', cspDirectivesString);
|
||||
|
||||
// HTTP Strict Transport Security
|
||||
// max-age is set to 1 year in seconds
|
||||
response.headers.set(
|
||||
'Strict-Transport-Security',
|
||||
'max-age=31536000; includeSubDomains; preload'
|
||||
);
|
||||
|
||||
// X-Content-Type-Options
|
||||
response.headers.set('X-Content-Type-Options', 'nosniff');
|
||||
|
||||
// X-Frame-Options
|
||||
response.headers.set('X-Frame-Options', 'DENY');
|
||||
|
||||
return response;
|
||||
};
|
||||
|
||||
const bannerRewriter: Handle = async ({ event, resolve }) => {
|
||||
const response = await resolve(event, {
|
||||
transformPageChunk: ({ html }) => html.replace('%aw_banner_key%', BANNER_KEY)
|
||||
});
|
||||
return response;
|
||||
};
|
||||
|
||||
export const handle = sequence(Sentry.sentryHandle(), redirecter, bannerRewriter, securityheaders);
|
||||
export const handleError = Sentry.handleErrorWithSentry();
|
||||
@@ -1,8 +1,6 @@
|
||||
export const GITHUB_STARS = '47K';
|
||||
export const GITHUB_REPO_LINK = 'https://github.com/appwrite/appwrite';
|
||||
export const BANNER_KEY: Banners = 'discord-banner-01'; // Change key to force banner to show again
|
||||
export const SENTRY_DSN =
|
||||
'https://27d41dc8bb67b596f137924ab8599e59@o1063647.ingest.us.sentry.io/4507497727000576';
|
||||
|
||||
export const BLOG_POSTS_PER_PAGE = 12;
|
||||
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
<script lang="ts" context="module">
|
||||
import { derived, writable } from 'svelte/store';
|
||||
import { loadReoScript } from 'reodotdev';
|
||||
|
||||
export type Theme = 'dark' | 'light' | 'system';
|
||||
export const currentTheme = (function () {
|
||||
@@ -128,6 +129,15 @@
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
if (!dev && browser) {
|
||||
const clientID = '144fa7eaa4904e8';
|
||||
|
||||
const reoPromise = loadReoScript({ clientID });
|
||||
reoPromise.then((Reo: any) => {
|
||||
Reo.init({ clientID });
|
||||
});
|
||||
}
|
||||
</script>
|
||||
|
||||
<svelte:window on:scroll={handleScroll} />
|
||||
@@ -135,6 +145,7 @@
|
||||
{#if !dev}
|
||||
<!--suppress JSUnresolvedLibraryURL -->
|
||||
<script defer data-domain="appwrite.io" src="https://plausible.io/js/script.js"></script>
|
||||
|
||||
<!-- ZoomInfo snippet -->
|
||||
<script>
|
||||
window[
|
||||
@@ -178,22 +189,6 @@
|
||||
document.body.appendChild(zi);
|
||||
});
|
||||
</script>
|
||||
|
||||
<!-- Reo.dev -->
|
||||
<script type="text/javascript">
|
||||
!(function () {
|
||||
var e, t, n;
|
||||
(e = '144fa7eaa4904e8'),
|
||||
(t = function () {
|
||||
Reo.init({ clientID: '144fa7eaa4904e8' });
|
||||
}),
|
||||
((n = document.createElement('script')).src =
|
||||
'https://static.reo.dev/' + e + '/reo.js'),
|
||||
(n.defer = !0),
|
||||
(n.onload = t),
|
||||
document.head.appendChild(n);
|
||||
})();
|
||||
</script>
|
||||
{/if}
|
||||
|
||||
<!-- canonical url -->
|
||||
|
||||
@@ -106,6 +106,7 @@ If running in production, it might be easier to use a 3rd party SMTP server as i
|
||||
| `_APP_STORAGE_S3_SECRET` | **version >= 0.13.0** AWS S3 storage secret key. Required when the storage adapter is set to S3. You can get your secret key from your AWS console. |
|
||||
| `_APP_STORAGE_S3_REGION` | **version >= 0.13.0** AWS S3 storage region. Required when storage adapter is set to S3. You can find your region info for your bucket from AWS console. |
|
||||
| `_APP_STORAGE_S3_BUCKET` | **version >= 0.13.0** AWS S3 storage bucket. Required when storage adapter is set to S3. You can create buckets in your AWS console. |
|
||||
| `_APP_STORAGE_S3_ENDPOINT` | **version >= 1.7.0** Override the S3 endpoint to use an S3-compatible provider. This should just be the host (without 'https://'). |
|
||||
| `_APP_STORAGE_DO_SPACES_ACCESS_KEY` | **version >= 0.13.0** DigitalOcean spaces access key. Required when the storage adapter is set to DOSpaces. You can get your access key from your DigitalOcean console. |
|
||||
| `_APP_STORAGE_DO_SPACES_SECRET` | **version >= 0.13.0** DigitalOcean spaces secret key. Required when the storage adapter is set to DOSpaces. You can get your secret key from your DigitalOcean console. |
|
||||
| `_APP_STORAGE_DO_SPACES_REGION` | **version >= 0.13.0** DigitalOcean spaces region. Required when storage adapter is set to DOSpaces. You can find your region info for your space from DigitalOcean console. |
|
||||
|
||||
@@ -1,4 +1,3 @@
|
||||
import { sentrySvelteKit } from '@sentry/sveltekit';
|
||||
import dynamicImport from 'vite-plugin-dynamic-import';
|
||||
import { sveltekit } from '@sveltejs/kit/vite';
|
||||
import { defineConfig } from 'vitest/config';
|
||||
@@ -8,13 +7,6 @@ import manifestSRI from 'vite-plugin-manifest-sri';
|
||||
|
||||
export default defineConfig({
|
||||
plugins: [
|
||||
sentrySvelteKit({
|
||||
adapter: 'node',
|
||||
sourceMapsUploadOptions: {
|
||||
org: 'appwrite',
|
||||
project: 'website'
|
||||
}
|
||||
}),
|
||||
enhancedImages(),
|
||||
sveltekit(),
|
||||
dynamicImport({
|
||||
|
||||
Reference in New Issue
Block a user