Skip to content

Commit 921be55

Browse files
committed
v.0.9-rc-001
1 parent 81a1325 commit 921be55

File tree

21 files changed

+232
-250
lines changed

21 files changed

+232
-250
lines changed

Dockerfile

Lines changed: 18 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,29 +1,34 @@
1-
# Build stage: install all dependencies and build the application
1+
2+
# Build stage: install all dependencies and bu ild the application
23
FROM oven/bun:slim AS builder
34
WORKDIR /app
45

5-
# Copy package files and install all dependencies (including dev)
6+
# # Copy package files and install all dependencies (including dev)
67
COPY package*.json ./
78
RUN bun install
89

9-
# Copy the rest of your application code
10+
# # Copy the rest of your application code
1011
COPY . .
11-
ENV LOG_LEVEL="debug" \
12+
RUN --mount=type=secret,id=ADMIN_PASSWORD \
13+
export ADMIN_PASSWORD=$(cat /run/secrets/ADMIN_PASSWORD) && echo $ADMIN_PASSWORD
14+
RUN --mount=type=secret,id=TOKEN_SECRET \
15+
export TOKEN_SECRET=$(cat /run/secrets/TOKEN_SECRET) && echo $TOKEN_SECRET
16+
ENV DATABASE_URL=file:./db.sqlite \
17+
DATABASE_PROVIDER=sqlite \
18+
LOG_LEVEL="debug" \
1219
HOST=0.0.0.0 \
1320
ORIGIN=http://localhost:3000 \
1421
PORT=3000 \
15-
TOKEN_SECRET=secret \
1622
ADMIN_USERNAME=admin \
1723
ADMIN_EMAIL=email@example.com \
18-
ADMIN_PASSWORD=password \
1924
ENABLE_SIGNUP=false \
2025
ENABLED_MFA=false \
2126
PUBLIC_URL=http://localhost:3000 \
2227
APPNAME="Snapp.li" \
2328
PUBLIC_SNAPP_VERSION="0.9-rc"
2429

2530

26-
# Run build commands
31+
# # Run build commands
2732
ENV DATABASE_URL=mysql://root:password@localhost:3306/snapp \
2833
DATABASE_PROVIDER=mysql
2934
RUN bunx zenstack generate --schema dbschema/mysql/schema.zmodel --output /app/zenstack/mysql
@@ -41,7 +46,7 @@ RUN bunx prisma migrate deploy --schema dbschema/sqlite/prisma/schema.prisma
4146

4247
RUN bun run build
4348

44-
# Final stage: set up a lean runtime environment and reinstall production dependencies
49+
# # Final stage: set up a lean runtime environment and reinstall production dependencies
4550
FROM oven/bun:slim
4651
WORKDIR /app
4752

@@ -66,18 +71,19 @@ RUN bun install --production
6671
# Copy the entrypoint script and make it executable
6772
COPY entrypoint.sh /usr/local/bin/entrypoint.sh
6873
RUN chmod +x /usr/local/bin/entrypoint.sh
69-
74+
RUN --mount=type=secret,id=ADMIN_PASSWORD \
75+
export ADMIN_PASSWORD=$(cat /run/secrets/ADMIN_PASSWORD)
76+
RUN --mount=type=secret,id=TOKEN_SECRET \
77+
export TOKEN_SECRET=$(cat /run/secrets/TOKEN_SECRET)
7078
# Set runtime environment variables
7179
ENV DATABASE_URL=file:./db.sqlite \
7280
DATABASE_PROVIDER=sqlite \
7381
LOG_LEVEL="info" \
7482
HOST=0.0.0.0 \
7583
ORIGIN=http://localhost:3000 \
7684
PORT=3000 \
77-
TOKEN_SECRET=secret \
7885
ADMIN_USERNAME=admin \
7986
ADMIN_EMAIL=email@example.com \
80-
ADMIN_PASSWORD=password \
8187
ENABLE_SIGNUP=false \
8288
ENABLED_MFA=false \
8389
PUBLIC_URL=http://localhost:3000 \
@@ -88,3 +94,4 @@ EXPOSE 3000
8894

8995
ENTRYPOINT ["entrypoint.sh"]
9096
CMD ["bun", "./build"]
97+

src/lib/components/metrics/map.svelte

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -106,7 +106,7 @@
106106
let container = $state<HTMLElement>();
107107
</script>
108108

109-
<div class="h-full w-full p-2" in:fade|global>
109+
<div class="h-full min-h-[264px] w-full p-2" in:fade|global>
110110
<div class="flex h-full w-full shrink-0 flex-col rounded border p-4">
111111
<div bind:this={container} class="h-full w-full"></div>
112112
{#await loadData()}

src/lib/components/metrics/topSnapps.svelte

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,7 @@
7777
const i18n = getTranslations();
7878
</script>
7979

80-
<div class="flex h-full flex-col py-0">
80+
<div class="flex h-max md:h-full flex-col py-0">
8181
<Table.Root>
8282
<Table.Header>
8383
<Table.Row class="h-8">
@@ -115,5 +115,7 @@
115115
{/await}
116116
</Table.Body>
117117
</Table.Root>
118+
{#if data.length}
118119
<Separator />
120+
{/if}
119121
</div>

src/lib/components/snapps/createSnappForm.svelte

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -100,6 +100,10 @@
100100
icon="globe-simple"
101101
placeholder={i18n.t('snapps.placeholders.original-url')}
102102
{...props}
103+
oninput={(e)=>{
104+
const value = e.currentTarget.value
105+
if(value.trim()!=='') $formData.originalUrl=value.toLowerCase()
106+
}}
103107
bind:value={$formData.originalUrl}
104108
/>
105109
{/snippet}

src/lib/components/snapps/graph.svelte

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@
1313
1414
import { DateSelector } from '../metrics';
1515
import { Separator } from '../ui/separator';
16+
import { browser } from '$app/environment';
1617
type CharData = { date: string; value: number };
1718
1819
let { snappId }: { snappId: string } = $props();
@@ -82,7 +83,7 @@
8283
<div class="flex min-h-[325px] flex-col px-2 py-2">
8384
<div class="min-h-[325px] w-full rounded border p-4">
8485
{#key mstore.start || mstore.end}
85-
{#if mstore.start && mstore.end}
86+
{#if mstore.start && mstore.end && browser}
8687
{@const days =
8788
Math.floor(
8889
Math.abs(

src/lib/components/snapps/singleForm.svelte

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,9 @@
1616
const form = superForm(formSchema, {
1717
applyAction: true,
1818
invalidateAll: true,
19+
onResult:async()=>{
20+
if (page.form?.message) toast.info(decode(i18n.t(page.form.message)));
21+
},
1922
onError: async () => {
2023
if (page.form?.message) toast.info(decode(i18n.t(page.form.message)));
2124
},

src/lib/i18n/translations/de.json

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -64,15 +64,13 @@
6464
"unallowed-not-https": "Die ursprüngliche URL muss ein sicherer https-Link sein.",
6565
"original-url-missing": "Eine ursprüngliche URL muss für die Weiterleitung angegeben werden.",
6666
"original-url-blacklisted": "Diese URL wurde von VirusTotal API auf die Blacklist gesetzt oder markiert.",
67-
6867
"not-found": "URL nicht gefunden.",
6968
"disabled": "Diese URL wurde möglicherweise vom Benutzer gelöscht oder deaktiviert oder hat einen festgelegten Schwellenwert erreicht. Wenn Sie glauben, dass dies ein Fehler ist, wenden Sie sich bitte an den Administrator."
7069
},
7170
"auth": {
7271
"disabled-signups": "Registrierungen sind deaktiviert. Wenn Sie glauben, dass dies ein Fehler ist, wenden Sie sich bitte an den Serviceadministrator.",
7372
"user-not-found": "Benutzer nicht gefunden.",
7473
"wrong-credentials": "Falsche Anmeldedaten."
75-
7674
},
7775
"generic": "Unbekannter Fehler, bitte versuchen Sie es später erneut."
7876
},
@@ -264,6 +262,15 @@
264262
},
265263
"actions": {
266264
"confirm-delete": "Diese Aktion löscht die URL dauerhaft"
265+
},
266+
"time": {
267+
"seconds": "Sekunden",
268+
"minutes": "Minuten",
269+
"hours": "Stunden",
270+
"days": "Tage",
271+
"weeks": "Wochen",
272+
"months": "Monate",
273+
"years": "Jahre"
267274
}
268275
},
269276
"tags": {
@@ -370,5 +377,4 @@
370377
"search": "Suche nach Benutzername oder E-Mail..."
371378
}
372379
}
373-
}
374-
380+
}

src/lib/i18n/translations/en.json

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -272,7 +272,16 @@
272272
},
273273
"actions": {
274274
"confirm-delete": "This action will permanently delete the URL"
275-
}
275+
},
276+
"time": {
277+
"seconds": "Seconds",
278+
"minutes": "Minutes",
279+
"hours": "Hours",
280+
"days": "Days",
281+
"weeks": "Weeks",
282+
"months": "Months",
283+
"years": "Years"
284+
}
276285
},
277286
"tags": {
278287
"labels": {

src/lib/i18n/translations/es.json

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -273,6 +273,15 @@
273273
},
274274
"actions": {
275275
"confirm-delete": "Esta acción eliminará permanentemente la URL"
276+
},
277+
"time": {
278+
"seconds": "Segundos",
279+
"minutes": "Minutos",
280+
"hours": "Horas",
281+
"days": "Días",
282+
"weeks": "Semanas",
283+
"months": "Meses",
284+
"years": "Años"
276285
}
277286
},
278287
"tags": {

src/lib/i18n/translations/fr.json

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -273,7 +273,16 @@
273273
},
274274
"actions": {
275275
"confirm-delete": "Cette action supprimera définitivement l'URL"
276-
}
276+
},
277+
"time": {
278+
"seconds": "Secondes",
279+
"minutes": "Minutes",
280+
"hours": "Heures",
281+
"days": "Jours",
282+
"weeks": "Semaines",
283+
"months": "Mois",
284+
"years": "Années"
285+
}
277286
},
278287
"tags": {
279288
"labels": {

0 commit comments

Comments
 (0)