diff --git a/Caddyfile b/Caddyfile
deleted file mode 100644
index d293f49..0000000
--- a/Caddyfile
+++ /dev/null
@@ -1,4 +0,0 @@
-http://localhost {
- file_server
- root * /usr/share/caddy
-}
diff --git a/Dockerfile b/Dockerfile
index 05fccf2..0d9a2b7 100644
--- a/Dockerfile
+++ b/Dockerfile
@@ -1,14 +1,15 @@
-FROM cl00e9ment/node.js-builder:light AS build
+FROM node:19-alpine
-WORKDIR /app
+WORKDIR /usr/src/app
COPY package.json ./
-COPY pnpm-lock.yaml ./
-RUN pnpm i
-COPY . ./
-RUN pnpm build && cp Caddyfile build
-FROM caddy:2.5.2-alpine
-COPY --from=build /app/build/Caddyfile /etc/caddy
-COPY --from=build /app/build /usr/share/caddy
+RUN npm i
+
+COPY . .
+
+RUN npm run build
+
EXPOSE 80
+
+CMD [ "npm", "run", "preview" ]
\ No newline at end of file
diff --git a/docker-compose.yml b/docker-compose.yml
new file mode 100644
index 0000000..5e30726
--- /dev/null
+++ b/docker-compose.yml
@@ -0,0 +1,11 @@
+version: "3.9"
+services:
+ website:
+ container_name: website
+ image: realprojectsegfault/website
+ restart: always
+ #build: .
+ ports:
+ - "80:80"
+ volumes:
+ - "./data:/usr/src/app/data"
\ No newline at end of file
diff --git a/package.json b/package.json
index 9d0b413..0a2b36f 100644
--- a/package.json
+++ b/package.json
@@ -14,7 +14,7 @@
"devDependencies": {
"@iconify-json/fa6-solid": "^1.1.7",
"@iconify-json/simple-icons": "^1.1.28",
- "@sveltejs/adapter-static": "1.0.0-next.43",
+ "@sveltejs/adapter-node": "1.0.0-next.43",
"@sveltejs/kit": "1.0.0-next.504",
"dayjs": "^1.11.5",
"mdsvex": "^0.10.6",
diff --git a/src/lib/Announcements.svelte b/src/lib/Announcements.svelte
deleted file mode 100644
index 4e48d48..0000000
--- a/src/lib/Announcements.svelte
+++ /dev/null
@@ -1,124 +0,0 @@
-
-
-{#await fetchState("announcements") then state}
- {#if state.enabled === "true"}
-
@@ -17,7 +18,8 @@
{title}
{#if position}
- - {position}
+
-
+
{position}
{/if}
diff --git a/src/lib/ContactForm.svelte b/src/lib/ContactForm.svelte
deleted file mode 100644
index 4a01bb8..0000000
--- a/src/lib/ContactForm.svelte
+++ /dev/null
@@ -1,43 +0,0 @@
-
-
-{#await promise}
-
-{:then state}
- {#if state.enabled === "true"}
-
- {:else}
-
-
-
The contact form is currently disabled.
-
- {/if}
-{/await}
diff --git a/src/lib/Instances.json b/src/lib/Instances.json
deleted file mode 100644
index 88416c6..0000000
--- a/src/lib/Instances.json
+++ /dev/null
@@ -1,90 +0,0 @@
-[
- {
- "name": "Invidious",
- "description": "A frontend for YouTube.",
- "website": "https://invidious.projectsegfau.lt/",
- "icon": "https://github.com/iv-org/invidious/raw/master/assets/invidious-colored-vector.svg",
- "category": "General",
- "projectWebsite": "https://invidious.io/"
- },
- {
- "name": "Librarian",
- "description": "A frontend for Odysee.",
- "website": "https://lbry.projectsegfau.lt/",
- "icon": "https://codeberg.org/avatars/dd785d92b4d4df06d448db075cd29274",
- "category": "General",
- "projectWebsite": "https://codeberg.org/librarian/librarian"
- },
- {
- "name": "Libreddit",
- "description": "A frontend for Reddit.",
- "website": "https://libreddit.projectsegfau.lt/",
- "icon": "https://github.com/spikecodes/libreddit/raw/master/static/logo.png",
- "category": "General",
- "projectWebsite": "https://github.com/spikecodes/libreddit"
- },
- {
- "name": "Nitter",
- "description": "A frontend for Twitter.",
- "website": "https://nitter.projectsegfau.lt/",
- "icon": "https://github.com/zedeus/nitter/raw/master/public/logo.png",
- "category": "General",
- "projectWebsite": "https://github.com/zedeus/nitter"
- },
- {
- "name": "Element",
- "description": "An open source and decentralized chat application.",
- "website": "https://chat.projectsegfau.lt/",
- "icon": "https://element.io/images/logo-mark-primary.svg",
- "category": "General",
- "projectWebsite": "https://element.io/"
- },
- {
- "name": "Piped",
- "description": "Another frontend for YouTube.",
- "website": "https://piped.projectsegfau.lt/",
- "icon": "https://github.com/TeamPiped/Piped/raw/master/public/img/icons/logo.svg",
- "category": "General",
- "projectWebsite": "https://github.com/TeamPiped/Piped"
- },
- {
- "name": "SearXNG",
- "description": "A private meta-search engine.",
- "website": "https://search.projectsegfau.lt/search",
- "icon": "https://docs.searxng.org/_static/searxng-wordmark.svg",
- "category": "General",
- "projectWebsite": "https://searxng.org/"
- },
- {
- "name": "Gitea",
- "description": "A web interface for Git, alternative to GitHub.",
- "website": "https://git.projectsegfau.lt",
- "icon": "https://gitea.io/images/gitea.png",
- "category": "General",
- "projectWebsite": "https://gitea.io/"
- },
- {
- "name": "Portainer",
- "description": "Portainer instance for Soleil Levant.",
- "website": "https://portainer.soleil-levant.projectsegfau.lt/",
- "icon": "https://avatars.githubusercontent.com/u/22225832",
- "category": "Internal",
- "projectWebsite": "https://www.portainer.io/"
- },
- {
- "name": "mailcow",
- "description": "Our mail server and webmail.",
- "website": "https://mail.projectsegfau.lt/",
- "icon": "https://mailcow.email/images/cow_mailcow.svg",
- "category": "Internal",
- "projectWebsite": "https://mailcow.email/"
- },
- {
- "name": "Plausible analytics",
- "description": "Analytics for our website.",
- "website": "https://analytics.projectsegfau.lt/projectsegfau.lt",
- "icon": "https://avatars.githubusercontent.com/u/54802774",
- "category": "Internal",
- "projectWebsite": "https://plausible.io/"
- }
-]
diff --git a/src/lib/fetchState.ts b/src/lib/fetchState.ts
deleted file mode 100644
index 92017a3..0000000
--- a/src/lib/fetchState.ts
+++ /dev/null
@@ -1,7 +0,0 @@
-let state: any = [];
-export default async function fetchState(module: "announcements" | "form") {
- const url = `https://segfautils.projectsegfau.lt/api/set/${module}`;
- const response = await fetch(url);
- state = await response.json();
- return state;
-}
diff --git a/src/routes/+page.server.ts b/src/routes/+page.server.ts
new file mode 100644
index 0000000..846d961
--- /dev/null
+++ b/src/routes/+page.server.ts
@@ -0,0 +1,8 @@
+import type { PageServerLoad } from "./$types";
+
+export const load: PageServerLoad = async () => {
+ return {
+ state: await fetch("https://api.projectsegfau.lt/api/v1/state/announcements").then((res) => res.json()),
+ announcements: await fetch("https://api.projectsegfau.lt/api/v1/announcements").then((res) => res.json())
+ }
+}
\ No newline at end of file
diff --git a/src/routes/+page.svelte b/src/routes/+page.svelte
index d8f596b..6e08e6a 100644
--- a/src/routes/+page.svelte
+++ b/src/routes/+page.svelte
@@ -2,7 +2,12 @@
import SvelteSeo from "svelte-seo";
import Hero from "$lib/Hero.svelte";
import LinkButton from "$lib/LinkButton.svelte";
- import Announcements from "$lib/Announcements.svelte";
+ import dayjs from "dayjs";
+ import type { PageData } from "./$types";
+
+ export let data: PageData;
+
+ let announcements = data.announcements;
let description: string = "Open source development and hosted services.";
@@ -30,7 +35,101 @@
-