Skip to content

Commit 218d0af

Browse files
authored
Merge branch 'main' into patch-1
2 parents 4c5332b + a9db6ae commit 218d0af

File tree

61 files changed

+906
-164
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

61 files changed

+906
-164
lines changed

.github/workflows/production.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@ jobs:
7272
echo "_APP_VERSION=${{ env.TAG }}" >> .env
7373
echo "_APP_DOMAIN=${{ secrets.PRD_APP_DOMAIN }}" >> .env
7474
echo "_APP_SYSTEM_SECURITY_EMAIL_ADDRESS=${{ secrets.APP_SYSTEM_SECURITY_EMAIL_ADDRESS }}" >> .env
75-
echo "SEMATEXT_TOKEN=${{ secrets.SEMATEXT_TOKEN }}" >> .env
75+
echo "_APP_BETTER_STACK_INCIDENT_URL=${{ secrets.BETTER_STACK_INCIDENT_URL }}" >> .env
7676
7777
echo ${{ secrets.GH_REGISTRY_TOKEN }} | docker login ghcr.io --username ${{ env.REGISTRY_USERNAME }} --password-stdin
7878
docker-compose -f ${{ env.STACK_FILE }} config

.github/workflows/staging.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@ jobs:
7474
echo "_APP_VERSION=${{ env.TAG }}" >> .env
7575
echo "_APP_DOMAIN=${{ secrets.STG_APP_DOMAIN }}" >> .env
7676
echo "_APP_SYSTEM_SECURITY_EMAIL_ADDRESS=${{ secrets.APP_SYSTEM_SECURITY_EMAIL_ADDRESS }}" >> .env
77-
echo "SEMATEXT_TOKEN=${{ secrets.SEMATEXT_TOKEN }}" >> .env
77+
echo "_APP_BETTER_STACK_INCIDENT_URL=${{ secrets.BETTER_STACK_INCIDENT_URL }}" >> .env
7878
7979
echo ${{ secrets.GH_REGISTRY_TOKEN }} | docker login ghcr.io --username ${{ env.REGISTRY_USERNAME }} --password-stdin
8080
docker-compose -f ${{ env.STACK_FILE }} config

docker/production.yml

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -119,23 +119,23 @@ services:
119119
- TIME_BETWEEN_RUNS=3600
120120
- UNUSED_TIME=6h
121121

122-
sematext-agent:
123-
image: sematext/agent:latest
124-
environment:
125-
REGION: EU
126-
INFRA_TOKEN: $SEMATEXT_TOKEN
122+
resource-monitor:
123+
image: ghcr.io/appwrite/monitoring:0.1.0
124+
entrypoint: monitoring
125+
command:
126+
- "--url=${_APP_BETTER_STACK_INCIDENT_URL}"
127+
- "--interval=60"
128+
- "--cpu-limit=85"
129+
- "--memory-limit=80"
130+
- "--disk-limit=85"
131+
hostname: "{{.Node.Hostname}}"
132+
<<: *x-logging
133+
volumes:
134+
- /mnt:/mnt:ro
127135
deploy:
136+
<<: *x-update-config
137+
endpoint_mode: dnsrr
128138
mode: global
129-
restart_policy:
130-
condition: any
131-
volumes:
132-
- /:/hostfs:ro
133-
- /etc/passwd:/etc/passwd:ro
134-
- /etc/group:/etc/group:ro
135-
- /sys:/host/sys:ro
136-
- /dev:/hostfs/dev:ro
137-
- /var/run:/var/run
138-
- /sys/kernel/debug:/sys/kernel/debug
139139

140140
networks:
141141
cloud:

docker/stage.yml

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -114,23 +114,23 @@ services:
114114
volumes:
115115
- /var/run/docker.sock:/var/run/docker.sock
116116

117-
sematext-agent:
118-
image: sematext/agent:latest
119-
environment:
120-
REGION: EU
121-
INFRA_TOKEN: $SEMATEXT_TOKEN
117+
resource-monitor:
118+
image: ghcr.io/appwrite/monitoring:0.1.0
119+
entrypoint: monitoring
120+
command:
121+
- "--url=${_APP_BETTER_STACK_INCIDENT_URL}"
122+
- "--interval=60"
123+
- "--cpu-limit=85"
124+
- "--memory-limit=80"
125+
- "--disk-limit=85"
126+
hostname: "{{.Node.Hostname}}"
127+
<<: *x-logging
128+
volumes:
129+
- /mnt:/mnt:ro
122130
deploy:
131+
<<: *x-update-config
132+
endpoint_mode: dnsrr
123133
mode: global
124-
restart_policy:
125-
condition: any
126-
volumes:
127-
- /:/hostfs:ro
128-
- /etc/passwd:/etc/passwd:ro
129-
- /etc/group:/etc/group:ro
130-
- /sys:/host/sys:ro
131-
- /dev:/hostfs/dev:ro
132-
- /var/run:/var/run
133-
- /sys/kernel/debug:/sys/kernel/debug
134134

135135
networks:
136136
cloud:

markdoc.config.json

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,10 @@
77
"type": "esm",
88
"property": "default",
99
"watch": true
10+
},
11+
"partials": {
12+
"auth-security.md": "./src/partials/auth-security.md",
13+
"prohibited-activities.md": "./src/partials/prohibited-activities.md"
1014
}
1115
}
1216
]
Lines changed: 76 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,76 @@
1+
<script lang="ts">
2+
import { fade, scale } from 'svelte/transition';
3+
4+
let show = false;
5+
6+
function handleKeypress(event: KeyboardEvent) {
7+
if (event.key.toLowerCase() === 'escape' || event.key.toLowerCase() === 'esc') {
8+
event.preventDefault();
9+
show = false;
10+
}
11+
}
12+
</script>
13+
14+
<svelte:window on:keydown={handleKeypress} />
15+
16+
<button on:click={() => (show = true)} class="web-button is-secondary cursor-pointer">
17+
<span class="web-icon-play" style:color="unset" />
18+
<span>Appwrite in 100 seconds</span>
19+
</button>
20+
21+
{#if show}
22+
<!-- `on:keypress={null}` silences the a11y warnings -->
23+
<div
24+
tabindex="0"
25+
role="button"
26+
class="overlay"
27+
on:keypress={null}
28+
on:click={() => (show = false)}
29+
transition:fade={{ duration: 150 }}
30+
/>
31+
32+
<div class="web-media content" transition:scale={{ duration: 250, start: 0.95 }}>
33+
<iframe
34+
src="https://www.youtube-nocookie.com/embed/L07xPMyL8sY?si=Odrwj1tHzlm12Fi2&controls=0"
35+
title="YouTube video player"
36+
frameborder="0"
37+
allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share"
38+
allowfullscreen
39+
/>
40+
</div>
41+
{/if}
42+
43+
<style lang="scss">
44+
.overlay {
45+
position: fixed;
46+
inset: 0;
47+
background-color: rgba(0, 0, 0, 0.5);
48+
49+
transition: 200ms ease;
50+
}
51+
52+
.content {
53+
position: fixed;
54+
left: 50%;
55+
top: 50%;
56+
translate: -50% -50%;
57+
58+
display: block;
59+
object-fit: contain;
60+
61+
max-height: 75vh;
62+
width: calc(80%);
63+
aspect-ratio: 16 / 9;
64+
65+
z-index: 1000;
66+
67+
transform: scale(0.975);
68+
transition: 200ms ease;
69+
70+
iframe {
71+
display: block;
72+
inline-size: 100%;
73+
block-size: 100%;
74+
}
75+
}
76+
</style>

src/lib/components/Feedback.svelte

Lines changed: 17 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
<script lang="ts">
22
import { page } from '$app/stores';
3+
import { fade } from 'svelte/transition';
4+
import { loggedIn, user } from '$lib/utils/console';
35
import { PUBLIC_GROWTH_ENDPOINT } from '$env/static/public';
46
57
export let date: string | undefined = undefined;
@@ -14,6 +16,9 @@
1416
async function handleSubmit() {
1517
submitting = true;
1618
error = undefined;
19+
20+
const userId = loggedIn && $user?.$id ? $user.$id : undefined;
21+
1722
const response = await fetch(`${PUBLIC_GROWTH_ENDPOINT}/feedback/docs`, {
1823
method: 'POST',
1924
headers: {
@@ -23,7 +28,10 @@
2328
email,
2429
type: feedbackType,
2530
route: $page.route.id,
26-
comment
31+
comment,
32+
metaFields: {
33+
userId
34+
}
2735
})
2836
});
2937
submitting = false;
@@ -33,6 +41,7 @@
3341
}
3442
comment = email = '';
3543
submitted = true;
44+
setTimeout(() => (showFeedback = false), 500);
3645
}
3746
3847
function reset() {
@@ -45,6 +54,10 @@
4554
$: if (!showFeedback) {
4655
reset();
4756
}
57+
58+
$: if (showFeedback && loggedIn && $user?.email) {
59+
email = $user?.email;
60+
}
4861
</script>
4962

5063
<section class="web-content-footer">
@@ -60,7 +73,7 @@
6073
class="web-radio-button"
6174
aria-label="helpful"
6275
on:click={() => {
63-
showFeedback = feedbackType === 'positive' ? false : true;
76+
showFeedback = feedbackType !== 'positive';
6477
feedbackType = 'positive';
6578
}}
6679
>
@@ -70,7 +83,7 @@
7083
class="web-radio-button"
7184
aria-label="unhelpful"
7285
on:click={() => {
73-
showFeedback = feedbackType === 'negative' ? false : true;
86+
showFeedback = feedbackType !== 'negative';
7487
feedbackType = 'negative';
7588
}}
7689
>
@@ -104,6 +117,7 @@
104117
on:submit|preventDefault={handleSubmit}
105118
class="web-card is-normal"
106119
style="--card-padding:1rem"
120+
out:fade={{ duration: 450 }}
107121
>
108122
<div class="flex flex-col gap-2">
109123
<label for="message">

src/lib/components/FooterNav.svelte

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -32,11 +32,11 @@
3232
{ label: 'Solid', href: '/docs/quick-starts/solid' }
3333
],
3434
Products: [
35-
{ label: 'Auth', href: '/docs/products/auth' },
35+
{ label: 'Auth', href: '/products/auth' },
3636
{ label: 'Databases', href: '/docs/products/databases' },
37-
{ label: 'Functions', href: '/docs/products/functions' },
37+
{ label: 'Functions', href: '/products/functions' },
3838
{ label: 'Messaging', href: '/products/messaging' },
39-
{ label: 'Storage', href: '/docs/products/storage' },
39+
{ label: 'Storage', href: '/products/storage' },
4040
{ label: 'Realtime', href: '/docs/apis/realtime' }
4141
],
4242
Learn: [

src/lib/components/PreFooter.svelte

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,13 @@
33
import { trackEvent } from '$lib/actions/analytics';
44
</script>
55

6-
<img src="/images/bgs/pre-footer.png" alt="" class="web-pre-footer-bg" loading="lazy" style="z-index:-1" />
6+
<img
7+
src="/images/bgs/pre-footer.png"
8+
alt=""
9+
class="web-pre-footer-bg"
10+
loading="lazy"
11+
style="z-index:-1"
12+
/>
713

814
<div class="web-u-row-gap-80 relative grid gap-8 md:grid-cols-2">
915
<section class="web-hero flex items-center justify-center gap-y-8">

src/lib/components/ProductsSubmenu.svelte

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020
icon: '/images/icons/illustrated/dark/auth.png'
2121
},
2222
{
23-
name: 'Database',
23+
name: 'Databases',
2424
href: '/docs/products/databases',
2525
description: 'Scalable and robust databases.',
2626
icon: '/images/icons/illustrated/dark/databases.png'

src/lib/components/Select.svelte

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,8 @@
2626
change: unknown;
2727
}>();
2828
29+
export let initialLabel: string = 'Select an option';
30+
2931
const {
3032
elements: { trigger, menu, option: optionEl, group: groupEl, groupLabel },
3133
states: { open, selected, selectedLabel }
@@ -80,6 +82,8 @@
8082
duration: 150,
8183
y: placement === 'top' ? 4 : -4
8284
} as FlyParams;
85+
86+
console.log({ initialLabel, $selectedLabel });
8387
</script>
8488

8589
<button
@@ -93,7 +97,7 @@
9397
{#if selectedOption?.icon}
9498
<span class={selectedOption.icon} aria-hidden="true" />
9599
{/if}
96-
<span>{$selectedLabel}</span>
100+
<span>{$selectedLabel || initialLabel}</span>
97101
</div>
98102
<span class="icon-cheveron-{$open ? 'up' : 'down'}" aria-hidden="true" />
99103
</button>

src/lib/layouts/Docs.svelte

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,9 @@
3434
}
3535
3636
const CTX_KEY = Symbol('docs');
37+
const TUT_CTX_KEY = Symbol('tut-docs');
3738
export const isInDocs = () => getContext<boolean>(CTX_KEY) ?? false;
39+
export const isInTutorialDocs = () => getContext<boolean>(TUT_CTX_KEY) ?? false;
3840
</script>
3941

4042
<script lang="ts">
@@ -43,6 +45,7 @@
4345
import { getContext, setContext } from 'svelte';
4446
import { GITHUB_REPO_LINK, GITHUB_STARS } from '$lib/constants';
4547
import { PUBLIC_APPWRITE_DASHBOARD } from '$env/static/public';
48+
import { page } from '$app/stores';
4649
4750
export let variant: DocsLayoutVariant = 'default';
4851
export let isReferences = false;
@@ -63,7 +66,9 @@
6366
showSidenav: false
6467
}));
6568
});
66-
setContext(CTX_KEY, true);
69+
70+
const key = $page.route.id?.includes('tutorials') ? TUT_CTX_KEY : CTX_KEY;
71+
setContext(key, true);
6772
6873
const handleKeydown = (e: KeyboardEvent) => {
6974
if (e.key === 'Escape' && ($layoutState.showReferences || $layoutState.showSidenav)) {

src/lib/layouts/DocsArticle.svelte

Lines changed: 16 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,14 +13,17 @@
1313
</script>
1414

1515
<script lang="ts">
16-
import { scrollToTop } from '$lib/actions/scrollToTop';
17-
16+
import { setContext } from 'svelte';
17+
import { writable } from 'svelte/store';
1818
import { Feedback } from '$lib/components';
19+
import { scrollToTop } from '$lib/actions/scrollToTop';
1920
2021
export let title: string;
2122
export let toc: Array<TocItem>;
2223
export let back: string | undefined = undefined;
2324
export let date: string | undefined = undefined;
25+
26+
const reducedArticleSize = setContext('articleHasNumericBadge', writable(false));
2427
</script>
2528

2629
<main class="contents" id="main">
@@ -59,8 +62,9 @@
5962
</div>
6063
<div class="web-article-header-end" />
6164
</header>
62-
<div class="web-article-content">
65+
<div class="web-article-content" class:web-reduced-article-size={$reducedArticleSize}>
6366
<slot />
67+
6468
<Feedback {date} />
6569
</div>
6670
<aside class="web-references-menu ps-6">
@@ -110,3 +114,12 @@
110114
</aside>
111115
</article>
112116
</main>
117+
118+
<style>
119+
@media (min-width: 1280px) and (max-width: 1330px) {
120+
.web-reduced-article-size {
121+
/* original/default is 41.5rem */
122+
max-inline-size: 40.5rem;
123+
}
124+
}
125+
</style>

0 commit comments

Comments
 (0)