+ We’re developing suyu as a tool to prevent Switch games from becoming lost media, so we’re
+ taking care to prevent dissolution from outside influences.
+
+
+
+
+
suyu is community-run.
+
+
+
+
suyu is completely free. There’s no option to monetarily support the project.
+
+
+
+
suyu exists solely as an effort of hardware preservation and research.
+
+
+
+
suyu does not condone nor facilitate piracy or intellectual property theft.
+
+
+
+
+
From 70ac650c7e6fffd88c4469ee699b59a792f0317b Mon Sep 17 00:00:00 2001
From: million1156
Date: Mon, 25 Mar 2024 13:41:04 -0500
Subject: [PATCH 05/15] Fix invalid release
---
src/routes/download/+page.svelte | 11 ++++++-----
src/routes/faq/+page.svelte | 6 +++---
2 files changed, 9 insertions(+), 8 deletions(-)
diff --git a/src/routes/download/+page.svelte b/src/routes/download/+page.svelte
index f8ee7c9..6243ac0 100644
--- a/src/routes/download/+page.svelte
+++ b/src/routes/download/+page.svelte
@@ -45,10 +45,11 @@
const releases = await response.json();
const latestRelease = releases[0].name;
+ console.log(latestRelease)
// Release found
if (latestRelease) {
- console.log("Latest release tag:", latestRelease.name);
- return latestRelease.name; // Assuming the first result is the latest
+ console.log("Latest release tag:", latestRelease);
+ return latestRelease; // Assuming the first result is the latest
} else {
console.log("No releases found.");
return null;
@@ -77,7 +78,7 @@
} else {
window.location.href = `https://git.suyu.dev/suyu/suyu/releases/${latestRelease}/`;
}
- }, 3000);
+ }, 30000);
});
@@ -107,13 +108,13 @@
/>
-
+
{@html htmlContent}
Your download should start shortly. If it doesn't, click herehere
A: The purpose of this project is to provide a free, open-source alternative to the now-dead Yuzu emulator. We believe that the community should be able to emulate their Switch device (legally) and be able to enjoy their favorite game titles.
Q: How can I contribute to Suyu?
-
A: You can contribute to this project by submitting a pull request on our Git page. We are always looking for new contributors to help us improve the project!
+
A: You can contribute to this project by submitting a pull request on our Git page. We are always looking for new contributors to help us improve the project!
Q: Where can I download Suyu?
-
A: You can download the latest build of Suyu from our Git. Please make sure you are using the right URL!
+
A: You can download the latest build of Suyu from our Git. Please make sure you are using the right URL!
Q: What is the current progress for Suyu?
-
A: As of 3/20/2024, we have released our first Windows binary 🎉! You can find it here. We are always trying to make more and more progress, so please feel free to join the Discord!
+
A: As of 3/20/2024, we have released our first Windows binary 🎉! You can find it here. We are always trying to make more and more progress, so please feel free to join the Discord!
From 1affe83ff21bc7502ace01e5e7ffd2d695178f6a Mon Sep 17 00:00:00 2001
From: million1156
Date: Tue, 26 Mar 2024 19:27:46 -0500
Subject: [PATCH 08/15] comply with new naming scheme (curse you zqpvr01)
---
src/routes/download/+page.svelte | 17 +++++------------
1 file changed, 5 insertions(+), 12 deletions(-)
diff --git a/src/routes/download/+page.svelte b/src/routes/download/+page.svelte
index 25dd0d8..1e0f9e6 100644
--- a/src/routes/download/+page.svelte
+++ b/src/routes/download/+page.svelte
@@ -22,14 +22,6 @@
const fakeVersionTag = false;
let latestRelease = "";
- // Infinite timeout to test download workflow, comment out or disable developerMode if you don't want this
- // nvm this was bugging out lmao
- /* if (developerMode) {
- timeout = 9999;
- return;
- } */
-
- // NOTE: I have no idea if this works.. Shoutout to the very smart person who blocked ALL API requests to the git server...
async function getTag() {
try {
// Get the latest release tag
@@ -67,13 +59,14 @@
setTimeout(() => {
if (UA.includes("Windows")) {
- window.location.href = `https://git.suyu.dev/suyu/suyu/releases/download/${latestRelease}/Suyu-Windows_x64.7z`;
+ window.location.href = `https://git.suyu.dev/suyu/suyu/releases/download/${latestRelease}/Suyu-Windows_x86_64.7z`;
+ // Android is above Linux because Android UA's also contain "Linux"
} else if (UA.includes("Android")) {
- window.location.href = `https://git.suyu.dev/suyu/suyu/releases/download/${latestRelease}/app-mainline-release.apk`;
+ window.location.href = `https://git.suyu.dev/suyu/suyu/releases/download/${latestRelease}/Suyu-Android_Arm64.apk`;
} else if (UA.includes("Linux")) {
- window.location.href = `https://git.suyu.dev/suyu/suyu/releases/download/${latestRelease}/suyu-mainline--.AppImage`;
+ window.location.href = `https://git.suyu.dev/suyu/suyu/releases/download/${latestRelease}/Suyu-Linux_x86_64.AppImage`;
} else if (UA.includes("Macintosh;")) {
- window.location.href = `https://git.suyu.dev/suyu/suyu/releases/download/${latestRelease}/suyu-macOS-arm64.dmg?inline=false`;
+ window.location.href = `https://git.suyu.dev/suyu/suyu/releases/download/${latestRelease}/Suyu-macOS-Arm64.dmg`;
} else {
window.location.href = `https://git.suyu.dev/suyu/suyu/releases/${latestRelease}/`;
}
From 4be4a685319cfd50fcb5498971ecded38193e99f Mon Sep 17 00:00:00 2001
From: million1156
Date: Tue, 26 Mar 2024 19:34:40 -0500
Subject: [PATCH 09/15] i have no idea how or why that happened
---
src/routes/download/+page.svelte | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/src/routes/download/+page.svelte b/src/routes/download/+page.svelte
index 1e0f9e6..4ff241d 100644
--- a/src/routes/download/+page.svelte
+++ b/src/routes/download/+page.svelte
@@ -106,7 +106,7 @@
Your download should start shortly. If it doesn't, click herehere.
From 631cb61e8a03f9498ac71ca7f8225916b74db0e0 Mon Sep 17 00:00:00 2001
From: million1156
Date: Tue, 26 Mar 2024 19:35:55 -0500
Subject: [PATCH 10/15] a
---
src/routes/download/+page.svelte | 10 +++++-----
1 file changed, 5 insertions(+), 5 deletions(-)
diff --git a/src/routes/download/+page.svelte b/src/routes/download/+page.svelte
index 4ff241d..e9aeb34 100644
--- a/src/routes/download/+page.svelte
+++ b/src/routes/download/+page.svelte
@@ -36,7 +36,7 @@
const releases = await response.json();
const latestRelease = releases[0].name;
- console.log(latestRelease)
+ console.log(latestRelease);
// Release found
if (latestRelease) {
console.log("Latest release tag:", latestRelease);
@@ -51,16 +51,16 @@
}
}
if (!fakeVersionTag) {
- latestRelease = await getTag();
+ latestRelease = await getTag();
} else {
- latestRelease = "v0.0.1";
- console.log(latestRelease)
+ latestRelease = "v0.0.1";
+ console.log(latestRelease);
}
setTimeout(() => {
if (UA.includes("Windows")) {
window.location.href = `https://git.suyu.dev/suyu/suyu/releases/download/${latestRelease}/Suyu-Windows_x86_64.7z`;
- // Android is above Linux because Android UA's also contain "Linux"
+ // Android is above Linux because Android UA's also contain "Linux"
} else if (UA.includes("Android")) {
window.location.href = `https://git.suyu.dev/suyu/suyu/releases/download/${latestRelease}/Suyu-Android_Arm64.apk`;
} else if (UA.includes("Linux")) {
From 801bd34d9bb2644359c50c2d90e3011464783942 Mon Sep 17 00:00:00 2001
From: million1156
Date: Tue, 26 Mar 2024 19:41:22 -0500
Subject: [PATCH 11/15] Cleanup
---
src/routes/download/+page.svelte | 7 ++++---
1 file changed, 4 insertions(+), 3 deletions(-)
diff --git a/src/routes/download/+page.svelte b/src/routes/download/+page.svelte
index e9aeb34..1173fcb 100644
--- a/src/routes/download/+page.svelte
+++ b/src/routes/download/+page.svelte
@@ -5,12 +5,13 @@
// cool moving dots :3
// NOTE: This is required to be ran on the server due to issues with Svelte
let text = "Downloading Suyu";
+ const textLength = text.length
setInterval(() => {
text += ".";
- if (text.length > 19) {
+ // Text length + 3 is essentially the length of the text above + the 3 dots
+ if (text.length > textLength + 3) {
text = "Downloading Suyu";
}
- //console.log(text);
}, 500);
$: htmlContent = `${text}`;
@@ -19,7 +20,7 @@
// Variables
const UA = navigator.userAgent;
const url = `https://git.suyu.dev/api/v1/repos/suyu/suyu/tags`;
- const fakeVersionTag = false;
+ const fakeVersionTag = false; // Fake version tag? (for debugging)
let latestRelease = "";
async function getTag() {
From 5cee218403dd8065647d6ca6094aeb263f977f1d Mon Sep 17 00:00:00 2001
From: Million1156
Date: Wed, 27 Mar 2024 14:38:28 -0500
Subject: [PATCH 12/15] Fix star count
---
src/routes/+page.server.ts | 12 +++---------
1 file changed, 3 insertions(+), 9 deletions(-)
diff --git a/src/routes/+page.server.ts b/src/routes/+page.server.ts
index 2ce74a2..281a8d6 100644
--- a/src/routes/+page.server.ts
+++ b/src/routes/+page.server.ts
@@ -19,21 +19,15 @@ async function fetchServerSideData() {
},
})
: Promise.resolve({ json: () => roleMembers }),
- GITLAB_API_TOKEN
- ? fetch("https://gitlab.com/api/v4/projects/suyu-emu%2Fsuyu/", {
- headers: {
- Authorization: `Bearer ${GITLAB_API_TOKEN}`,
- },
- })
- : Promise.resolve({ json: () => ({ star_count: 0 }) }), // Default to 0 if no token is provided
+ fetch("https://git.suyu.dev/api/v1/repos/suyu/suyu"),
];
const [res, roles, gitlabRes] = await Promise.all(promises);
const jsonPromises = [res.json(), roles.json(), gitlabRes.json()];
- const [resJson, rolesJson, gitlabResJson] = await Promise.all(jsonPromises);
+ const [resJson, rolesJson, gitResJson] = await Promise.all(jsonPromises);
memberCount = resJson.approximate_member_count;
- starCount = gitlabResJson.star_count;
+ starCount = gitResJson.stars_count;
if (DISCORD_USER_TOKEN) roleMembers = rolesJson;
console.log("Member count:", memberCount);
From 4cd72e9e46ee391efa9aac72f3af58c8cf6bdebf Mon Sep 17 00:00:00 2001
From: Million1156
Date: Wed, 27 Mar 2024 14:39:05 -0500
Subject: [PATCH 13/15] yes
---
src/routes/+page.svelte | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/src/routes/+page.svelte b/src/routes/+page.svelte
index 7447cf2..fbdcb5a 100644
--- a/src/routes/+page.svelte
+++ b/src/routes/+page.svelte
@@ -116,7 +116,8 @@
>
By the numbers
-
+
+
From 368e5ef0f3cbfdb5a67fb1ff024a076c744255f6 Mon Sep 17 00:00:00 2001
From: not-nullptr
Date: Thu, 28 Mar 2024 13:34:06 +0000
Subject: [PATCH 14/15] fix page transitions
---
src/lib/server/util/index.ts | 4 +-
src/lib/util/api/index.ts | 4 +-
src/routes/+page.svelte | 14 +++---
src/routes/account/+layout.svelte | 5 ++-
src/routes/jwt/external/[audience]/+server.ts | 24 ++++++++++
src/routes/jwt/external/key.pem/+server.ts | 44 +++----------------
src/routes/jwt/internal/+server.ts | 2 +-
src/routes/lobby/+server.ts | 8 ----
8 files changed, 42 insertions(+), 63 deletions(-)
create mode 100644 src/routes/jwt/external/[audience]/+server.ts
diff --git a/src/lib/server/util/index.ts b/src/lib/server/util/index.ts
index fb4030d..104afea 100644
--- a/src/lib/server/util/index.ts
+++ b/src/lib/server/util/index.ts
@@ -1,6 +1,6 @@
import type { IJwtData } from "$types/auth";
import type { Role } from "$types/db";
-import { PUBLIC_KEY } from "../secrets/secrets.json";
+import { PUB_KEY } from "$env/static/private";
import jwt from "jsonwebtoken";
export function json(body: T, status?: number): Response {
@@ -14,7 +14,7 @@ export function json(body: T, status?: number): Response {
export async function getJwtData(token: string): Promise {
return new Promise((resolve, reject) => {
- jwt.verify(token, PUBLIC_KEY, { algorithms: ["RS256"] }, (err, data) => {
+ jwt.verify(token, PUB_KEY, { algorithms: ["RS256"] }, (err, data) => {
if (err) reject(err);
else resolve(data as IJwtData);
});
diff --git a/src/lib/util/api/index.ts b/src/lib/util/api/index.ts
index b5c24e4..dbedfb6 100644
--- a/src/lib/util/api/index.ts
+++ b/src/lib/util/api/index.ts
@@ -1,6 +1,6 @@
import { userRepo } from "$lib/server/repo";
import type { SuyuUser } from "$lib/server/schema";
-import { PUBLIC_KEY } from "$lib/server/secrets/secrets.json";
+import { PUB_KEY } from "$env/static/private";
import type { IJwtData } from "$types/auth";
import cookie from "cookie";
import jwt from "jsonwebtoken";
@@ -18,7 +18,7 @@ export async function useAuth(
}
if (apiKey.startsWith("Bearer ")) {
const token = apiKey.replace("Bearer ", "");
- const decoded: IJwtData = jwt.verify(token, Buffer.from(PUBLIC_KEY), {
+ const decoded: IJwtData = jwt.verify(token, Buffer.from(PUB_KEY), {
algorithms: ["RS256"],
}) as IJwtData;
let user = await userRepo.findOne({
diff --git a/src/routes/+page.svelte b/src/routes/+page.svelte
index 7447cf2..4661e00 100644
--- a/src/routes/+page.svelte
+++ b/src/routes/+page.svelte
@@ -8,7 +8,7 @@
export let data: PageData;
$: memberCount = parseFloat(data.memberCount?.toPrecision(2));
- $: contributors = parseFloat(data.roleMembers["1214817156420862012"]?.toPrecision(2));
+ $: contributors = parseFloat(data.roleMembers?.["1214817156420862012"]?.toPrecision(2));
$: starCount = parseFloat(data.starCount?.toPrecision(2));
let metadata = {
url: "https://suyu.dev",
@@ -70,12 +70,8 @@
and open-source, forever.