Skip to content

Commit

Permalink
Merge branch 'main' into patch-1
Browse files Browse the repository at this point in the history
  • Loading branch information
loks0n authored Dec 21, 2024
2 parents 4c5332b + a9db6ae commit 218d0af
Show file tree
Hide file tree
Showing 61 changed files with 906 additions and 164 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/production.yml
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ jobs:
echo "_APP_VERSION=${{ env.TAG }}" >> .env
echo "_APP_DOMAIN=${{ secrets.PRD_APP_DOMAIN }}" >> .env
echo "_APP_SYSTEM_SECURITY_EMAIL_ADDRESS=${{ secrets.APP_SYSTEM_SECURITY_EMAIL_ADDRESS }}" >> .env
echo "SEMATEXT_TOKEN=${{ secrets.SEMATEXT_TOKEN }}" >> .env
echo "_APP_BETTER_STACK_INCIDENT_URL=${{ secrets.BETTER_STACK_INCIDENT_URL }}" >> .env
echo ${{ secrets.GH_REGISTRY_TOKEN }} | docker login ghcr.io --username ${{ env.REGISTRY_USERNAME }} --password-stdin
docker-compose -f ${{ env.STACK_FILE }} config
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/staging.yml
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ jobs:
echo "_APP_VERSION=${{ env.TAG }}" >> .env
echo "_APP_DOMAIN=${{ secrets.STG_APP_DOMAIN }}" >> .env
echo "_APP_SYSTEM_SECURITY_EMAIL_ADDRESS=${{ secrets.APP_SYSTEM_SECURITY_EMAIL_ADDRESS }}" >> .env
echo "SEMATEXT_TOKEN=${{ secrets.SEMATEXT_TOKEN }}" >> .env
echo "_APP_BETTER_STACK_INCIDENT_URL=${{ secrets.BETTER_STACK_INCIDENT_URL }}" >> .env
echo ${{ secrets.GH_REGISTRY_TOKEN }} | docker login ghcr.io --username ${{ env.REGISTRY_USERNAME }} --password-stdin
docker-compose -f ${{ env.STACK_FILE }} config
Expand Down
30 changes: 15 additions & 15 deletions docker/production.yml
Original file line number Diff line number Diff line change
Expand Up @@ -119,23 +119,23 @@ services:
- TIME_BETWEEN_RUNS=3600
- UNUSED_TIME=6h

sematext-agent:
image: sematext/agent:latest
environment:
REGION: EU
INFRA_TOKEN: $SEMATEXT_TOKEN
resource-monitor:
image: ghcr.io/appwrite/monitoring:0.1.0
entrypoint: monitoring
command:
- "--url=${_APP_BETTER_STACK_INCIDENT_URL}"
- "--interval=60"
- "--cpu-limit=85"
- "--memory-limit=80"
- "--disk-limit=85"
hostname: "{{.Node.Hostname}}"
<<: *x-logging
volumes:
- /mnt:/mnt:ro
deploy:
<<: *x-update-config
endpoint_mode: dnsrr
mode: global
restart_policy:
condition: any
volumes:
- /:/hostfs:ro
- /etc/passwd:/etc/passwd:ro
- /etc/group:/etc/group:ro
- /sys:/host/sys:ro
- /dev:/hostfs/dev:ro
- /var/run:/var/run
- /sys/kernel/debug:/sys/kernel/debug

networks:
cloud:
Expand Down
30 changes: 15 additions & 15 deletions docker/stage.yml
Original file line number Diff line number Diff line change
Expand Up @@ -114,23 +114,23 @@ services:
volumes:
- /var/run/docker.sock:/var/run/docker.sock

sematext-agent:
image: sematext/agent:latest
environment:
REGION: EU
INFRA_TOKEN: $SEMATEXT_TOKEN
resource-monitor:
image: ghcr.io/appwrite/monitoring:0.1.0
entrypoint: monitoring
command:
- "--url=${_APP_BETTER_STACK_INCIDENT_URL}"
- "--interval=60"
- "--cpu-limit=85"
- "--memory-limit=80"
- "--disk-limit=85"
hostname: "{{.Node.Hostname}}"
<<: *x-logging
volumes:
- /mnt:/mnt:ro
deploy:
<<: *x-update-config
endpoint_mode: dnsrr
mode: global
restart_policy:
condition: any
volumes:
- /:/hostfs:ro
- /etc/passwd:/etc/passwd:ro
- /etc/group:/etc/group:ro
- /sys:/host/sys:ro
- /dev:/hostfs/dev:ro
- /var/run:/var/run
- /sys/kernel/debug:/sys/kernel/debug

networks:
cloud:
Expand Down
4 changes: 4 additions & 0 deletions markdoc.config.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,10 @@
"type": "esm",
"property": "default",
"watch": true
},
"partials": {
"auth-security.md": "./src/partials/auth-security.md",
"prohibited-activities.md": "./src/partials/prohibited-activities.md"
}
}
]
76 changes: 76 additions & 0 deletions src/lib/components/AppwriteIn100Seconds.svelte
Original file line number Diff line number Diff line change
@@ -0,0 +1,76 @@
<script lang="ts">
import { fade, scale } from 'svelte/transition';
let show = false;
function handleKeypress(event: KeyboardEvent) {
if (event.key.toLowerCase() === 'escape' || event.key.toLowerCase() === 'esc') {
event.preventDefault();
show = false;
}
}
</script>

<svelte:window on:keydown={handleKeypress} />

<button on:click={() => (show = true)} class="web-button is-secondary cursor-pointer">
<span class="web-icon-play" style:color="unset" />
<span>Appwrite in 100 seconds</span>
</button>

{#if show}
<!-- `on:keypress={null}` silences the a11y warnings -->
<div
tabindex="0"
role="button"
class="overlay"
on:keypress={null}
on:click={() => (show = false)}
transition:fade={{ duration: 150 }}
/>

<div class="web-media content" transition:scale={{ duration: 250, start: 0.95 }}>
<iframe
src="https://www.youtube-nocookie.com/embed/L07xPMyL8sY?si=Odrwj1tHzlm12Fi2&controls=0"
title="YouTube video player"
frameborder="0"
allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share"
allowfullscreen
/>
</div>
{/if}

<style lang="scss">
.overlay {
position: fixed;
inset: 0;
background-color: rgba(0, 0, 0, 0.5);
transition: 200ms ease;
}
.content {
position: fixed;
left: 50%;
top: 50%;
translate: -50% -50%;
display: block;
object-fit: contain;
max-height: 75vh;
width: calc(80%);
aspect-ratio: 16 / 9;
z-index: 1000;
transform: scale(0.975);
transition: 200ms ease;
iframe {
display: block;
inline-size: 100%;
block-size: 100%;
}
}
</style>
20 changes: 17 additions & 3 deletions src/lib/components/Feedback.svelte
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
<script lang="ts">
import { page } from '$app/stores';
import { fade } from 'svelte/transition';
import { loggedIn, user } from '$lib/utils/console';
import { PUBLIC_GROWTH_ENDPOINT } from '$env/static/public';
export let date: string | undefined = undefined;
Expand All @@ -14,6 +16,9 @@
async function handleSubmit() {
submitting = true;
error = undefined;
const userId = loggedIn && $user?.$id ? $user.$id : undefined;
const response = await fetch(`${PUBLIC_GROWTH_ENDPOINT}/feedback/docs`, {
method: 'POST',
headers: {
Expand All @@ -23,7 +28,10 @@
email,
type: feedbackType,
route: $page.route.id,
comment
comment,
metaFields: {
userId
}
})
});
submitting = false;
Expand All @@ -33,6 +41,7 @@
}
comment = email = '';
submitted = true;
setTimeout(() => (showFeedback = false), 500);
}
function reset() {
Expand All @@ -45,6 +54,10 @@
$: if (!showFeedback) {
reset();
}
$: if (showFeedback && loggedIn && $user?.email) {
email = $user?.email;
}
</script>

<section class="web-content-footer">
Expand All @@ -60,7 +73,7 @@
class="web-radio-button"
aria-label="helpful"
on:click={() => {
showFeedback = feedbackType === 'positive' ? false : true;
showFeedback = feedbackType !== 'positive';
feedbackType = 'positive';
}}
>
Expand All @@ -70,7 +83,7 @@
class="web-radio-button"
aria-label="unhelpful"
on:click={() => {
showFeedback = feedbackType === 'negative' ? false : true;
showFeedback = feedbackType !== 'negative';
feedbackType = 'negative';
}}
>
Expand Down Expand Up @@ -104,6 +117,7 @@
on:submit|preventDefault={handleSubmit}
class="web-card is-normal"
style="--card-padding:1rem"
out:fade={{ duration: 450 }}
>
<div class="flex flex-col gap-2">
<label for="message">
Expand Down
6 changes: 3 additions & 3 deletions src/lib/components/FooterNav.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -32,11 +32,11 @@
{ label: 'Solid', href: '/docs/quick-starts/solid' }
],
Products: [
{ label: 'Auth', href: '/docs/products/auth' },
{ label: 'Auth', href: '/products/auth' },
{ label: 'Databases', href: '/docs/products/databases' },
{ label: 'Functions', href: '/docs/products/functions' },
{ label: 'Functions', href: '/products/functions' },
{ label: 'Messaging', href: '/products/messaging' },
{ label: 'Storage', href: '/docs/products/storage' },
{ label: 'Storage', href: '/products/storage' },
{ label: 'Realtime', href: '/docs/apis/realtime' }
],
Learn: [
Expand Down
8 changes: 7 additions & 1 deletion src/lib/components/PreFooter.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,13 @@
import { trackEvent } from '$lib/actions/analytics';
</script>

<img src="/images/bgs/pre-footer.png" alt="" class="web-pre-footer-bg" loading="lazy" style="z-index:-1" />
<img
src="/images/bgs/pre-footer.png"
alt=""
class="web-pre-footer-bg"
loading="lazy"
style="z-index:-1"
/>

<div class="web-u-row-gap-80 relative grid gap-8 md:grid-cols-2">
<section class="web-hero flex items-center justify-center gap-y-8">
Expand Down
2 changes: 1 addition & 1 deletion src/lib/components/ProductsSubmenu.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
icon: '/images/icons/illustrated/dark/auth.png'
},
{
name: 'Database',
name: 'Databases',
href: '/docs/products/databases',
description: 'Scalable and robust databases.',
icon: '/images/icons/illustrated/dark/databases.png'
Expand Down
6 changes: 5 additions & 1 deletion src/lib/components/Select.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,8 @@
change: unknown;
}>();
export let initialLabel: string = 'Select an option';
const {
elements: { trigger, menu, option: optionEl, group: groupEl, groupLabel },
states: { open, selected, selectedLabel }
Expand Down Expand Up @@ -80,6 +82,8 @@
duration: 150,
y: placement === 'top' ? 4 : -4
} as FlyParams;
console.log({ initialLabel, $selectedLabel });
</script>

<button
Expand All @@ -93,7 +97,7 @@
{#if selectedOption?.icon}
<span class={selectedOption.icon} aria-hidden="true" />
{/if}
<span>{$selectedLabel}</span>
<span>{$selectedLabel || initialLabel}</span>
</div>
<span class="icon-cheveron-{$open ? 'up' : 'down'}" aria-hidden="true" />
</button>
Expand Down
7 changes: 6 additions & 1 deletion src/lib/layouts/Docs.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,9 @@
}
const CTX_KEY = Symbol('docs');
const TUT_CTX_KEY = Symbol('tut-docs');
export const isInDocs = () => getContext<boolean>(CTX_KEY) ?? false;
export const isInTutorialDocs = () => getContext<boolean>(TUT_CTX_KEY) ?? false;
</script>

<script lang="ts">
Expand All @@ -43,6 +45,7 @@
import { getContext, setContext } from 'svelte';
import { GITHUB_REPO_LINK, GITHUB_STARS } from '$lib/constants';
import { PUBLIC_APPWRITE_DASHBOARD } from '$env/static/public';
import { page } from '$app/stores';
export let variant: DocsLayoutVariant = 'default';
export let isReferences = false;
Expand All @@ -63,7 +66,9 @@
showSidenav: false
}));
});
setContext(CTX_KEY, true);
const key = $page.route.id?.includes('tutorials') ? TUT_CTX_KEY : CTX_KEY;
setContext(key, true);
const handleKeydown = (e: KeyboardEvent) => {
if (e.key === 'Escape' && ($layoutState.showReferences || $layoutState.showSidenav)) {
Expand Down
19 changes: 16 additions & 3 deletions src/lib/layouts/DocsArticle.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -13,14 +13,17 @@
</script>

<script lang="ts">
import { scrollToTop } from '$lib/actions/scrollToTop';
import { setContext } from 'svelte';
import { writable } from 'svelte/store';
import { Feedback } from '$lib/components';
import { scrollToTop } from '$lib/actions/scrollToTop';
export let title: string;
export let toc: Array<TocItem>;
export let back: string | undefined = undefined;
export let date: string | undefined = undefined;
const reducedArticleSize = setContext('articleHasNumericBadge', writable(false));
</script>

<main class="contents" id="main">
Expand Down Expand Up @@ -59,8 +62,9 @@
</div>
<div class="web-article-header-end" />
</header>
<div class="web-article-content">
<div class="web-article-content" class:web-reduced-article-size={$reducedArticleSize}>
<slot />

<Feedback {date} />
</div>
<aside class="web-references-menu ps-6">
Expand Down Expand Up @@ -110,3 +114,12 @@
</aside>
</article>
</main>

<style>
@media (min-width: 1280px) and (max-width: 1330px) {
.web-reduced-article-size {
/* original/default is 41.5rem */
max-inline-size: 40.5rem;
}
}
</style>
Loading

0 comments on commit 218d0af

Please sign in to comment.