add baseurl on serverside

This commit is contained in:
murdle 2025-12-27 22:19:26 +02:00
parent e1c0386b2f
commit 23f4ef1070
6 changed files with 467 additions and 379 deletions

View File

@ -1,390 +1,477 @@
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta content="width=device-width, initial-scale=1.0, maximum-scale=1, user-scalable=no" name="viewport">
<meta property="og:type" content="website">
<meta property="og:site_name" content="Discord">
<meta property="og:title" content="Discord - A New Way to Chat with Friends & Communities">
<meta property="og:description" content="Discord is the easiest way to communicate over voice, video, and text. Chat, hang out, and stay close with your friends and communities.">
<meta property="og:image" content="https://discord.com/assets/ee7c382d9257652a88c8f7b7f22a994d.png">
<meta name="twitter:card" content="summary_large_image">
<meta name="twitter:site" content="@discord">
<meta name="twitter:creator" content="@discord">
<meta charset="utf-8">
<meta content="width=device-width, initial-scale=1.0, maximum-scale=1, user-scalable=no" name="viewport">
<meta property="og:type" content="website">
<meta property="og:site_name" content="Discord">
<meta property="og:title" content="Discord - A New Way to Chat with Friends & Communities">
<meta property="og:description"
content="Discord is the easiest way to communicate over voice, video, and text. Chat, hang out, and stay close with your friends and communities.">
<meta property="og:image" content="https://discord.com/assets/ee7c382d9257652a88c8f7b7f22a994d.png">
<meta name="twitter:card" content="summary_large_image">
<meta name="twitter:site" content="@discord">
<meta name="twitter:creator" content="@discord">
<link rel="stylesheet" href="/assets/0.2b34836c33685cfed2cb.css">
<link rel="icon" href="/assets/07dca80a102d4149e9736d4b162cff6f.ico">
<link rel="manifest" href="/assets/manifest.json">
<title>Discord</title>
<link rel="stylesheet" href="/assets/0.2b34836c33685cfed2cb.css">
<link rel="icon" href="/assets/07dca80a102d4149e9736d4b162cff6f.ico">
<link rel="manifest" href="/assets/manifest.json">
<title>Discord</title>
<link rel="preload" as="script" href="/assets/custom/utils.js">
<link rel="preload" as="script" href="/assets/custom/pushMessages.js">
<link rel="preload" as="script" href="/assets/custom/rtcPatcher.js">
<link rel="preload" as="script" href="/assets/custom/web/switch.js">
<link rel="preload" as="script" href="/assets/custom/web/main.js">
<link rel="preload" as="script" href="/assets/custom/utils.js">
<link rel="preload" as="script" href="/assets/custom/pushMessages.js">
<link rel="preload" as="script" href="/assets/custom/rtcPatcher.js">
<link rel="preload" as="script" href="/assets/custom/web/switch.js">
<link rel="preload" as="script" href="/assets/custom/web/main.js">
<link rel="preload" as="script" href="/assets/053574d0f6edc579c71e.js">
<link rel="preload" as="script" href="/assets/771dcd97bfd5f9b77ef6.js">
<link rel="preload" as="script" href="/assets/0ffb9e3c90aa88720fc7.js">
<link rel="preload" as="script" href="/assets/cbc98c97c3635bf34da3.js">
<link rel="preload" as="script" href="/assets/053574d0f6edc579c71e.js">
<link rel="preload" as="script" href="/assets/771dcd97bfd5f9b77ef6.js">
<link rel="preload" as="script" href="/assets/0ffb9e3c90aa88720fc7.js">
<link rel="preload" as="script" href="/assets/cbc98c97c3635bf34da3.js">
<script>
(function() {
window.GLOBAL_ENV = {};
window.__OVERLAY__ = /overlay/.test(location.pathname)
window.__BILLING_STANDALONE__ = /^\/billing/.test(location.pathname)
<script>
(function () {
window.__OVERLAY__ = /overlay/.test(location.pathname)
window.__BILLING_STANDALONE__ = /^\/billing/.test(location.pathname)
window.IS_IOS = /iPad|iPhone|iPod/.test(navigator.userAgent);
window.IS_MOBILE = window.matchMedia("(pointer: coarse)").matches;
window.IS_STANDALONE = window.matchMedia("(display-mode: standalone)").matches || window.navigator.standalone === true;
window.IS_IOS = /iPad|iPhone|iPod/.test(navigator.userAgent);
window.IS_MOBILE = window.matchMedia("(pointer: coarse)").matches;
window.IS_STANDALONE = window.matchMedia("(display-mode: standalone)").matches || window.navigator.standalone === true;
window.AUTH_TOKEN = null;
window.localStorage_ = localStorage;
window.AUTH_TOKEN = null;
window.localStorage_ = localStorage;
function protocolRelative(url) {
if (!url) return "";
return "//" + url.replace(/^https?:\/\//, "").replace(/\/$/, "");
window.GLOBAL_ENV = {
API_ENDPOINT: "%BASE_URL%/api",
API_VERSION: 9,
WEBAPP_ENDPOINT: "%BASE_URL%",
CDN_HOST: "%CDN_URL%",
ASSET_ENDPOINT: "%CDN_URL%",
MEDIA_PROXY_ENDPOINT: "%CDN_URL%",
WIDGET_ENDPOINT: "//discord.com/widget",
INVITE_HOST: "discord.gg",
GUILD_TEMPLATE_HOST: "discord.new",
GIFT_CODE_HOST: "discord.gift",
RELEASE_CHANNEL: "stable",
MARKETING_ENDPOINT: "%BASE_URL%",
BRAINTREE_KEY: "production_5st77rrc_49pp2rp4phym7387",
STRIPE_KEY: "pk_live_CUQtlpQUF0vufWpnpUmQvcdi",
NETWORKING_ENDPOINT: "%BASE_URL%",
RTC_LATENCY_ENDPOINT: "%BASE_URL%",
ACTIVITY_APPLICATION_HOST: "%BASE_URL%",
PROJECT_ENV: "production",
REMOTE_AUTH_ENDPOINT: "//remote-auth-gateway.discord.gg",
SENTRY_TAGS: { buildId: "9af39da", buildType: "normal" },
MIGRATION_SOURCE_ORIGIN: "%BASE_URL%",
MIGRATION_DESTINATION_ORIGIN: "%BASE_URL%",
HTML_TIMESTAMP: Date.now(),
ALGOLIA_KEY: "aca0d7082e4e63af5ba5917d5e96bed0",
GATEWAY_ENDPOINT: "%GATEWAY_URL%",
VAPID_KEY: "%VAPID_KEY%",
GATEWAY_URL: "%GATEWAY_URL"
};
localStorage.setItem("exerimentOverrides", JSON.stringify({
"2022-03_text_in_voice": {
type: "guild",
revision: 1,
bucket: 1,
override: true
}
}));
})();
</script>
</head>
async function loadGlobalEnv() {
try {
const res = await fetch("/.well-known/spacebar/client");
const data = await res.json();
<body>
<div id="app-mount"></div>
window.GLOBAL_ENV = {
API_ENDPOINT: protocolRelative(data.api.baseUrl) + "/api",
API_VERSION: 9,
WEBAPP_ENDPOINT: protocolRelative(data.api.baseUrl),
CDN_HOST: protocolRelative(data.cdn.baseUrl),
ASSET_ENDPOINT: protocolRelative(data.cdn.baseUrl),
MEDIA_PROXY_ENDPOINT: protocolRelative(data.cdn.baseUrl),
WIDGET_ENDPOINT: "//discord.com/widget",
INVITE_HOST: "discord.gg",
GUILD_TEMPLATE_HOST: "discord.new",
GIFT_CODE_HOST: "discord.gift",
RELEASE_CHANNEL: "stable",
MARKETING_ENDPOINT: protocolRelative(data.api.baseUrl),
BRAINTREE_KEY: "production_5st77rrc_49pp2rp4phym7387",
STRIPE_KEY: "pk_live_CUQtlpQUF0vufWpnpUmQvcdi",
NETWORKING_ENDPOINT: protocolRelative(data.api.baseUrl),
RTC_LATENCY_ENDPOINT: protocolRelative(data.api.baseUrl),
ACTIVITY_APPLICATION_HOST: protocolRelative(data.api.baseUrl),
PROJECT_ENV: "production",
REMOTE_AUTH_ENDPOINT: "//remote-auth-gateway.discord.gg",
SENTRY_TAGS: { buildId: "9af39da", buildType: "normal" },
MIGRATION_SOURCE_ORIGIN: protocolRelative(data.api.baseUrl),
MIGRATION_DESTINATION_ORIGIN: protocolRelative(data.api.baseUrl),
HTML_TIMESTAMP: Date.now(),
ALGOLIA_KEY: "aca0d7082e4e63af5ba5917d5e96bed0",
GATEWAY_ENDPOINT: data.gateway.baseUrl,
VAPID_KEY: data.vapid.publicKey,
GATEWAY_URL: data.gateway.baseUrl
};
<!-- Normal scripts -->
<script src="/assets/053574d0f6edc579c71e.js" defer></script>
<script src="/assets/771dcd97bfd5f9b77ef6.js" defer></script>
<script src="/assets/0ffb9e3c90aa88720fc7.js" defer></script>
<script src="/assets/cbc98c97c3635bf34da3.js" defer></script>
const customScripts = [
"/assets/custom/utils.js",
"/assets/custom/pushMessages.js",
"/assets/custom/rtcPatcher.js",
"/assets/custom/web/switch.js",
"/assets/custom/web/main.js",
]
<!-- Custom scripts -->
<script src="/assets/custom/utils.js" defer></script>
<script src="/assets/custom/pushMessages.js" defer></script>
<script src="/assets/custom/rtcPatcher.js" defer></script>
<script src="/assets/custom/web/switch.js" defer></script>
<script src="/assets/custom/web/main.js" defer></script>
const normalScripts = [
"/assets/053574d0f6edc579c71e.js",
"/assets/771dcd97bfd5f9b77ef6.js",
"/assets/0ffb9e3c90aa88720fc7.js",
"/assets/cbc98c97c3635bf34da3.js",
];
<style>
[class^="qrCodeOverlay"] {
all: unset;
background-image: url("/assets/pilkerton.png");
background-size: 180px 185px;
width: 100%;
height: 100%;
}
const scripts = [
...normalScripts,
...customScripts
];
[class*="qrCode-"][class*="spinner-"] {
display: none;
}
scripts.forEach(src => {
const s = document.createElement("script");
s.src = src;
s.defer = true;
document.body.appendChild(s);
});
} catch (e) {
console.error("Failed to load GLOBAL_ENV", e);
}
}
button[aria-label="Send a gift"],
a[href="/store"] {
display: none;
}
localStorage.setItem("exerimentOverrides", JSON.stringify({
"2022-03_text_in_voice": {
type: "guild",
revision: 1,
bucket: 1,
override: true
}
}));
.platform-win .notice-3bPHh- {
display: none;
}
loadGlobalEnv();
})();
</script>
</head>
<body>
<div id="app-mount"></div>
div[aria-controls="Discord Nitro-tab"],
div[aria-controls="Nitro Server Boost-tab"],
<style>
[class^="qrCodeOverlay"] {
all: unset;
background-image: url("/assets/pilkerton.png");
background-size: 180px 185px;
width: 100%;
height: 100%;
}
[class*="qrCode-"][class*="spinner-"] { display: none; }
button[aria-label="Send a gift"], a[href="/store"] { display: none; }
.platform-win .notice-3bPHh- { display: none; }
div[aria-controls="Discord Nitro-tab"],
div[aria-controls="Nitro Server Boost-tab"],
.theme-dark, .theme-light {
--font-primary: Whitney;
--font-display: Whitney,"Helvetica Neue",Helvetica,Arial,sans-serif!important;
--text-positive: hsl(152.6,calc(var(--saturation-factor, 1) * 46%),48.6%);
--blurple: hsl(226.7,calc(var(--saturation-factor, 1) * 58.4%),65.1%);
--blurple-hover: hsl(227.1,calc(var(--saturation-factor, 1) * 44.1%),58.6%);
--blurple-active: hsl(226.3,calc(var(--saturation-factor, 1) * 33.9%),52%);
--blurple-inverted: hsl(228,calc(var(--saturation-factor, 1) * 55.6%),98.2%);
--blurple-inverted-active: hsl(228.6,calc(var(--saturation-factor, 1) * 60%),93.1%);
--red: hsl(0,calc(var(--saturation-factor, 1) * 84.9%),61%);
--red-hover: hsl(0,calc(var(--saturation-factor, 1) * 66.1%),54.9%);
--red-active: hsl(0,calc(var(--saturation-factor, 1) * 54.2%),48.8%);
--red-inverted: hsl(0,calc(var(--saturation-factor, 1) * 80%),98%);
--red-inverted-active: hsl(0,calc(var(--saturation-factor, 1) * 85%),92.2%);
--yellow: hsl(37.5,calc(var(--saturation-factor, 1) * 95.7%),54.1%);
--yellow-hover: hsl(37.4,calc(var(--saturation-factor, 1) * 81.5%),48.6%);
--yellow-inverted: hsl(38.2,calc(var(--saturation-factor, 1) * 100%),97.8%);
--yellow-inverted-active: hsl(37.3,calc(var(--saturation-factor, 1) * 95.7%),90.8%);
--green: hsl(152.6,calc(var(--saturation-factor, 1) * 46%),48.6%);
--green-hover: hsl(152.6,calc(var(--saturation-factor, 1) * 46.2%),43.7%);
--green-active: hsl(152.3,calc(var(--saturation-factor, 1) * 45.7%),39%);
--green-inverted: hsl(156,calc(var(--saturation-factor, 1) * 38.5%),97.5%);
--green-inverted-active: hsl(153.9,calc(var(--saturation-factor, 1) * 43.4%),89.6%);
--brand-experiment-100: hsl(228,calc(var(--saturation-factor, 1) * 55.6%),98.2%);
--brand-experiment-130: hsl(228,calc(var(--saturation-factor, 1) * 62.5%),96.9%);
--brand-experiment-160: hsl(228,calc(var(--saturation-factor, 1) * 60%),95.1%);
--brand-experiment-200: hsl(228.6,calc(var(--saturation-factor, 1) * 60%),93.1%);
--brand-experiment-230: hsl(226.7,calc(var(--saturation-factor, 1) * 57.4%),90.8%);
--brand-experiment-260: hsl(225.9,calc(var(--saturation-factor, 1) * 58.6%),88.6%);
--brand-experiment-300: hsl(226.8,calc(var(--saturation-factor, 1) * 57.7%),86.1%);
--brand-experiment-330: hsl(226.9,calc(var(--saturation-factor, 1) * 59.1%),81.8%);
--brand-experiment-360: hsl(227.3,calc(var(--saturation-factor, 1) * 57.9%),77.6%);
--brand-experiment-400: hsl(226.3,calc(var(--saturation-factor, 1) * 58%),72%);
--brand-experiment-430: hsl(226.5,calc(var(--saturation-factor, 1) * 58.2%),70%);
--brand-experiment-460: hsl(226.9,calc(var(--saturation-factor, 1) * 58.5%),67.8%);
--brand-experiment: var(--blurple);
--brand-experiment-500: hsl(226.7,calc(var(--saturation-factor, 1) * 58.4%),65.1%);
--brand-experiment-530: hsl(226.6,calc(var(--saturation-factor, 1) * 45.2%),59.2%);
--brand-experiment-560: hsl(226.6,calc(var(--saturation-factor, 1) * 35.3%),52.7%);
--brand-experiment-600: hsl(227.1,calc(var(--saturation-factor, 1) * 31%),44.3%);
--brand-experiment-630: hsl(226.2,calc(var(--saturation-factor, 1) * 31.3%),38.2%);
--brand-experiment-660: hsl(226.4,calc(var(--saturation-factor, 1) * 31%),33.5%);
--brand-experiment-700: hsl(226.8,calc(var(--saturation-factor, 1) * 30.8%),26.1%);
--brand-experiment-730: hsl(227.7,calc(var(--saturation-factor, 1) * 31.2%),24.5%);
--brand-experiment-760: hsl(226.7,calc(var(--saturation-factor, 1) * 31.6%),22.4%);
--brand-experiment-800: hsl(226.5,calc(var(--saturation-factor, 1) * 31.3%),19.4%);
--brand-experiment-830: hsl(225,calc(var(--saturation-factor, 1) * 31.6%),14.9%);
--brand-experiment-860: hsl(225,calc(var(--saturation-factor, 1) * 32%),9.8%);
--brand-experiment-900: hsl(228,calc(var(--saturation-factor, 1) * 29.4%),3.3%);
--brand-experiment-05a: hsl(226.7,calc(var(--saturation-factor, 1) * 58.4%),65.1%,0.05);
--brand-experiment-10a: hsl(226.7,calc(var(--saturation-factor, 1) * 58.4%),65.1%,0.1);
--brand-experiment-15a: hsl(226.7,calc(var(--saturation-factor, 1) * 58.4%),65.1%,0.15);
--brand-experiment-20a: hsl(226.7,calc(var(--saturation-factor, 1) * 58.4%),65.1%,0.2);
--brand-experiment-25a: hsl(226.7,calc(var(--saturation-factor, 1) * 58.4%),65.1%,0.25);
--brand-experiment-30a: hsl(226.7,calc(var(--saturation-factor, 1) * 58.4%),65.1%,0.3);
--brand-experiment-35a: hsl(226.7,calc(var(--saturation-factor, 1) * 58.4%),65.1%,0.35);
--brand-experiment-40a: hsl(226.7,calc(var(--saturation-factor, 1) * 58.4%),65.1%,0.4);
--brand-experiment-45a: hsl(226.7,calc(var(--saturation-factor, 1) * 58.4%),65.1%,0.45);
--brand-experiment-50a: hsl(226.7,calc(var(--saturation-factor, 1) * 58.4%),65.1%,0.5);
--brand-experiment-55a: hsl(226.7,calc(var(--saturation-factor, 1) * 58.4%),65.1%,0.55);
--brand-experiment-60a: hsl(226.7,calc(var(--saturation-factor, 1) * 58.4%),65.1%,0.6);
--brand-experiment-65a: hsl(226.7,calc(var(--saturation-factor, 1) * 58.4%),65.1%,0.65);
--brand-experiment-70a: hsl(226.7,calc(var(--saturation-factor, 1) * 58.4%),65.1%,0.7);
--brand-experiment-75a: hsl(226.7,calc(var(--saturation-factor, 1) * 58.4%),65.1%,0.75);
--brand-experiment-80a: hsl(226.7,calc(var(--saturation-factor, 1) * 58.4%),65.1%,0.8);
--brand-experiment-85a: hsl(226.7,calc(var(--saturation-factor, 1) * 58.4%),65.1%,0.85);
--brand-experiment-90a: hsl(226.7,calc(var(--saturation-factor, 1) * 58.4%),65.1%,0.9);
--brand-experiment-95a: hsl(226.7,calc(var(--saturation-factor, 1) * 58.4%),65.1%,0.95);
}
.theme-dark,
.theme-light {
--font-primary: Whitney;
--font-display: Whitney, "Helvetica Neue", Helvetica, Arial, sans-serif !important;
--text-positive: hsl(152.6, calc(var(--saturation-factor, 1) * 46%), 48.6%);
--blurple: hsl(226.7, calc(var(--saturation-factor, 1) * 58.4%), 65.1%);
--blurple-hover: hsl(227.1, calc(var(--saturation-factor, 1) * 44.1%), 58.6%);
--blurple-active: hsl(226.3, calc(var(--saturation-factor, 1) * 33.9%), 52%);
--blurple-inverted: hsl(228, calc(var(--saturation-factor, 1) * 55.6%), 98.2%);
--blurple-inverted-active: hsl(228.6, calc(var(--saturation-factor, 1) * 60%), 93.1%);
--red: hsl(0, calc(var(--saturation-factor, 1) * 84.9%), 61%);
--red-hover: hsl(0, calc(var(--saturation-factor, 1) * 66.1%), 54.9%);
--red-active: hsl(0, calc(var(--saturation-factor, 1) * 54.2%), 48.8%);
--red-inverted: hsl(0, calc(var(--saturation-factor, 1) * 80%), 98%);
--red-inverted-active: hsl(0, calc(var(--saturation-factor, 1) * 85%), 92.2%);
--yellow: hsl(37.5, calc(var(--saturation-factor, 1) * 95.7%), 54.1%);
--yellow-hover: hsl(37.4, calc(var(--saturation-factor, 1) * 81.5%), 48.6%);
--yellow-inverted: hsl(38.2, calc(var(--saturation-factor, 1) * 100%), 97.8%);
--yellow-inverted-active: hsl(37.3, calc(var(--saturation-factor, 1) * 95.7%), 90.8%);
--green: hsl(152.6, calc(var(--saturation-factor, 1) * 46%), 48.6%);
--green-hover: hsl(152.6, calc(var(--saturation-factor, 1) * 46.2%), 43.7%);
--green-active: hsl(152.3, calc(var(--saturation-factor, 1) * 45.7%), 39%);
--green-inverted: hsl(156, calc(var(--saturation-factor, 1) * 38.5%), 97.5%);
--green-inverted-active: hsl(153.9, calc(var(--saturation-factor, 1) * 43.4%), 89.6%);
--brand-experiment-100: hsl(228, calc(var(--saturation-factor, 1) * 55.6%), 98.2%);
--brand-experiment-130: hsl(228, calc(var(--saturation-factor, 1) * 62.5%), 96.9%);
--brand-experiment-160: hsl(228, calc(var(--saturation-factor, 1) * 60%), 95.1%);
--brand-experiment-200: hsl(228.6, calc(var(--saturation-factor, 1) * 60%), 93.1%);
--brand-experiment-230: hsl(226.7, calc(var(--saturation-factor, 1) * 57.4%), 90.8%);
--brand-experiment-260: hsl(225.9, calc(var(--saturation-factor, 1) * 58.6%), 88.6%);
--brand-experiment-300: hsl(226.8, calc(var(--saturation-factor, 1) * 57.7%), 86.1%);
--brand-experiment-330: hsl(226.9, calc(var(--saturation-factor, 1) * 59.1%), 81.8%);
--brand-experiment-360: hsl(227.3, calc(var(--saturation-factor, 1) * 57.9%), 77.6%);
--brand-experiment-400: hsl(226.3, calc(var(--saturation-factor, 1) * 58%), 72%);
--brand-experiment-430: hsl(226.5, calc(var(--saturation-factor, 1) * 58.2%), 70%);
--brand-experiment-460: hsl(226.9, calc(var(--saturation-factor, 1) * 58.5%), 67.8%);
--brand-experiment: var(--blurple);
--brand-experiment-500: hsl(226.7, calc(var(--saturation-factor, 1) * 58.4%), 65.1%);
--brand-experiment-530: hsl(226.6, calc(var(--saturation-factor, 1) * 45.2%), 59.2%);
--brand-experiment-560: hsl(226.6, calc(var(--saturation-factor, 1) * 35.3%), 52.7%);
--brand-experiment-600: hsl(227.1, calc(var(--saturation-factor, 1) * 31%), 44.3%);
--brand-experiment-630: hsl(226.2, calc(var(--saturation-factor, 1) * 31.3%), 38.2%);
--brand-experiment-660: hsl(226.4, calc(var(--saturation-factor, 1) * 31%), 33.5%);
--brand-experiment-700: hsl(226.8, calc(var(--saturation-factor, 1) * 30.8%), 26.1%);
--brand-experiment-730: hsl(227.7, calc(var(--saturation-factor, 1) * 31.2%), 24.5%);
--brand-experiment-760: hsl(226.7, calc(var(--saturation-factor, 1) * 31.6%), 22.4%);
--brand-experiment-800: hsl(226.5, calc(var(--saturation-factor, 1) * 31.3%), 19.4%);
--brand-experiment-830: hsl(225, calc(var(--saturation-factor, 1) * 31.6%), 14.9%);
--brand-experiment-860: hsl(225, calc(var(--saturation-factor, 1) * 32%), 9.8%);
--brand-experiment-900: hsl(228, calc(var(--saturation-factor, 1) * 29.4%), 3.3%);
--brand-experiment-05a: hsl(226.7, calc(var(--saturation-factor, 1) * 58.4%), 65.1%, 0.05);
--brand-experiment-10a: hsl(226.7, calc(var(--saturation-factor, 1) * 58.4%), 65.1%, 0.1);
--brand-experiment-15a: hsl(226.7, calc(var(--saturation-factor, 1) * 58.4%), 65.1%, 0.15);
--brand-experiment-20a: hsl(226.7, calc(var(--saturation-factor, 1) * 58.4%), 65.1%, 0.2);
--brand-experiment-25a: hsl(226.7, calc(var(--saturation-factor, 1) * 58.4%), 65.1%, 0.25);
--brand-experiment-30a: hsl(226.7, calc(var(--saturation-factor, 1) * 58.4%), 65.1%, 0.3);
--brand-experiment-35a: hsl(226.7, calc(var(--saturation-factor, 1) * 58.4%), 65.1%, 0.35);
--brand-experiment-40a: hsl(226.7, calc(var(--saturation-factor, 1) * 58.4%), 65.1%, 0.4);
--brand-experiment-45a: hsl(226.7, calc(var(--saturation-factor, 1) * 58.4%), 65.1%, 0.45);
--brand-experiment-50a: hsl(226.7, calc(var(--saturation-factor, 1) * 58.4%), 65.1%, 0.5);
--brand-experiment-55a: hsl(226.7, calc(var(--saturation-factor, 1) * 58.4%), 65.1%, 0.55);
--brand-experiment-60a: hsl(226.7, calc(var(--saturation-factor, 1) * 58.4%), 65.1%, 0.6);
--brand-experiment-65a: hsl(226.7, calc(var(--saturation-factor, 1) * 58.4%), 65.1%, 0.65);
--brand-experiment-70a: hsl(226.7, calc(var(--saturation-factor, 1) * 58.4%), 65.1%, 0.7);
--brand-experiment-75a: hsl(226.7, calc(var(--saturation-factor, 1) * 58.4%), 65.1%, 0.75);
--brand-experiment-80a: hsl(226.7, calc(var(--saturation-factor, 1) * 58.4%), 65.1%, 0.8);
--brand-experiment-85a: hsl(226.7, calc(var(--saturation-factor, 1) * 58.4%), 65.1%, 0.85);
--brand-experiment-90a: hsl(226.7, calc(var(--saturation-factor, 1) * 58.4%), 65.1%, 0.9);
--brand-experiment-95a: hsl(226.7, calc(var(--saturation-factor, 1) * 58.4%), 65.1%, 0.95);
}
.inviteBannerUpsell-1t_LYM {
display: none !important;
}
.item-1OdjEX.labelContainer-2vJzYL.colorPremium-vwmYZQ.colorDefault-CDqZdO {
display: none !important;
}
.scroller-3X7KbA .tutorialContainer-1pL9QS .childWrapper-1j_1ub > svg {
height: 48px;
width: 48px;
background-size: 28px 28px;
background-position: center;
background-repeat: no-repeat;
}
.scroller-3X7KbA .tutorialContainer-1pL9QS .childWrapper-1j_1ub > svg path {
display: none;
}
.scroller-3X7KbA .tutorialContainer-1pL9QS .childWrapper-1j_1ub > svg rect {
fill: none;
}
.theme-dark .scroller-3X7KbA .tutorialContainer-1pL9QS .childWrapper-1j_1ub > svg, .guilds-2JjMmN.theme-dark .scroller-3X7KbA .tutorialContainer-1pL9QS .childWrapper-1j_1ub > svg {
background-image: url("/assets/89576a4bb71f927eb20e8aef987b499b.svg");
}
.theme-light .homeIcon-r0w4ny {
--text-normal: #000;
}
.wrapper-3kah-n.selected-1Drb7Z .childWrapper-1j_1ub .homeIcon-r0w4ny,
.wrapper-3kah-n:hover .childWrapper-1j_1ub .homeIcon-r0w4ny {
--text-normal: #fff;
}
.scroller-3X7KbA .tutorialContainer-1pL9QS .wrapper-3kah-n.selected-1Drb7Z .childWrapper-1j_1ub > svg {
background-image: url(/assets/89576a4bb71f927eb20e8aef987b499b-119c935d.svg");
}
.scroller-3X7KbA .circleIconButton-1VxDrg [d="M12 10.9C11.39 10.9 10.9 11.39 10.9 12C10.9 12.61 11.39 13.1 12 13.1C12.61 13.1 13.1 12.61 13.1 12C13.1 11.39 12.61 10.9 12 10.9ZM12 2C6.48 2 2 6.48 2 12C2 17.52 6.48 22 12 22C17.52 22 22 17.52 22 12C22 6.48 17.52 2 12 2ZM14.19 14.19L6 18L9.81 9.81L18 6L14.19 14.19Z"] {
d: path("M4.80155 9.60429C4.80155 6.94677 6.94677 4.80155 9.60429 4.80155C12.2618 4.80155 14.407 6.94677 14.407 9.60429C14.407 12.2618 12.2618 14.407 9.60429 14.407C6.94677 14.407 4.80155 12.2618 4.80155 9.60429ZM16.0079 14.407H15.1648L14.866 14.1189C15.9119 12.9022 16.5416 11.3226 16.5416 9.60429C16.5416 5.77277 13.4358 2.66699 9.60429 2.66699C5.77277 2.66699 2.66699 5.77277 2.66699 9.60429C2.66699 13.4358 5.77277 16.5416 9.60429 16.5416C11.3226 16.5416 12.9022 15.9119 14.1189 14.866L14.407 15.1648V16.0079L19.7434 21.3337L21.3337 19.7434L16.2807 14.6803L16.0079 14.407Z");
}
/* Remove "Download Apps" button in server list */
[data-list-item-id="guildsnav___app-download-button"] {
display: none !important;
}
/* Remove guild list separators */
.listItem-3SmSlK > .guildSeparator-a4uisj {
display: none !important;
}
.socialLinks-3ywLUf {
.inviteBannerUpsell-1t_LYM {
display: none !important;
}
}
/* ------------------ */
/* Hide Nitro upsells */
/* ------------------ */
div[aria-controls="billing-tab"],
div[aria-controls="library-inventory-tab"] {
display: none !important;
}
/* Chatbox buttons */
div[aria-label="Start an Activity"] { display: none; }
/* Join more than 100 servers upsell */
/* TODO also hide the button when it appears sometimes */
.tutorialContainer-11ICd5 + .listItem-2Ig28I > .listItemWrapper-2MsAsM { display: none; }
.nitroUpsell-27TJ8P { display: none; }
/* Hide Nitro separator in settings */
deiv[aria-label="User Settings"] > div[class^="separator"] { display: none; }
deiv[aria-label="User Settings"] > div[class^="separator"] ~ div[class^="separator"] { display: block; }
/* Hide Nitro tabs in Settings */
div[aria-label="User Settings"] > div[aria-label="Nitro"] { display: none; }
div[aria-label="User Settings"] > div[aria-label="Nitro"] + div { display: none; }
div[aria-label="User Settings"] > div[aria-label="Subscriptions"] { display: none; }
div[aria-label="User Settings"] > div[aria-label="Gift Inventory"] { display: none; }
div[aria-label="User Settings"] > div[aria-label="Gift Inventory"] + div[class^="item-"] { display: none; }
/* Hide Billing header and separator */
div[aria-label="User Settings"] > div[aria-label="Connections"] + div[class^="item-"] + div[class^="separator-"] + div[class^="header-"] { display: none; }
div[aria-label="User Settings"] > div[aria-label="Gift Inventory"] + div[class^="item-"] + div[class^="separator-"] { display: none; }
/* Hide profile customization upsells */
button[class^="shinyButton"] { display: none; }
svg[class^="nitro"] { display: none; }
div[class^="customizationSection"]:nth-of-type(3) { display: none; }
div[class^="bannerNitroUpsell"] { display: none; }
div[class^="optionBox"]:nth-of-type(2) { display: none; }
/* Per server avatar */
/* TODO find a way to hide "Unlock Avatar"*/
div[class^="upsellContainer"] { display: none; }
div[class*=" disabled-"] { display: none; }
/* Hide message size upsells */
div[class*=" upsell-"] { display: none; }
/* Hide Go Live quality upsells */
button[class*=" selectorButtonPremiumRequired-"] { display: none; }
/* Hide ad in profile banners */
div[class^="premiumIconWrapper"] { display: none; }
.emojiSection-3Fb9ix > .flex-1xMQg5 > .flex-1xMQg5 > .size14-e6ZScH { display: none; }
/* ------------- */
/* Server boosts */
/* ------------- */
/* Server dropdown */
div[class*=" colorPremium-"] { display: none; }
div[id="guild-header-popout"] > div > div[role="separator"] { display: none; }
div[id="guild-header-popout"] > div > div[role="separator"] ~ div[role="separator"] { display: block; }
/* Server settings */
/* TODO: fully hide Boost customization options */
div[class^="serverBoostTabItem"] { display: none; }
div[class^="serverBoostTabItem"] + div[class^="separator"] { display: none; }
div[aria-controls="vanity_url-tab"] { display: none; }
/* Display settings in Overview */
div[id="overview-tab"] > div > div + div > div:last-child{ display: none; }
/* Thread archive times */
span[class*=" disabledOptionLabel-"] { display: none; }
div[class^="availabilityIndicator"] { display: none; }
.checkboxWrapperDisabled-36r8NK { display: none; }
/* Boosted server badge */
div[class^="guildIconContainer"] { display: none; }
/* Boost progress bar */
ul[aria-label="Channels"] > div + div + div[class^="container-"] { display: none; }
/* Server boost profile badge */
div[class^="clickable-"][aria-label^="Server boosting"] { display: none; }
/* Boost in chat bar */
button[aria-label="Boost this server"] { display: none; }
/* Bugfix laggy server scroll */
div[data-dnd-name] > div[class^="wrapper"] svg { overflow: hidden; }
/* Hide Help button */
div[aria-label="Help"] { display: none; }
.item-1OdjEX.labelContainer-2vJzYL.colorPremium-vwmYZQ.colorDefault-CDqZdO {
display: none !important;
}
[src="/assets/439112b388adcac969dc066d30767b76.png"] {
content: url("/assets/36d4b341723daffd4a372e1b19591da1.png");
}
.scroller-3X7KbA .tutorialContainer-1pL9QS .childWrapper-1j_1ub>svg {
height: 48px;
width: 48px;
background-size: 28px 28px;
background-position: center;
background-repeat: no-repeat;
}
.characterBackground-1BPOOJ {
background: url(/assets/backgroundlogin.svg);
background-size: cover;
background-position: center;
}
.characterBackground-1BPOOJ .artwork-L5TAwQ {
display: none;
}
.scroller-3X7KbA .tutorialContainer-1pL9QS .childWrapper-1j_1ub>svg path {
display: none;
}
.logo-2Rw1Ex {
background: url("/assets/4f004ac9be168ac6ee18fc442a52ab53.svg") no-repeat !important;
}
.scroller-3X7KbA .tutorialContainer-1pL9QS .childWrapper-1j_1ub>svg rect {
fill: none;
}
.theme-dark .scroller-3X7KbA .tutorialContainer-1pL9QS .childWrapper-1j_1ub>svg,
.guilds-2JjMmN.theme-dark .scroller-3X7KbA .tutorialContainer-1pL9QS .childWrapper-1j_1ub>svg {
background-image: url("/assets/89576a4bb71f927eb20e8aef987b499b.svg");
}
.theme-light .homeIcon-r0w4ny {
--text-normal: #000;
}
.wrapper-3kah-n.selected-1Drb7Z .childWrapper-1j_1ub .homeIcon-r0w4ny,
.wrapper-3kah-n:hover .childWrapper-1j_1ub .homeIcon-r0w4ny {
--text-normal: #fff;
}
.scroller-3X7KbA .tutorialContainer-1pL9QS .wrapper-3kah-n.selected-1Drb7Z .childWrapper-1j_1ub>svg {
background-image: url(/assets/89576a4bb71f927eb20e8aef987b499b-119c935d.svg);
}
.scroller-3X7KbA .circleIconButton-1VxDrg [d="M12 10.9C11.39 10.9 10.9 11.39 10.9 12C10.9 12.61 11.39 13.1 12 13.1C12.61 13.1 13.1 12.61 13.1 12C13.1 11.39 12.61 10.9 12 10.9ZM12 2C6.48 2 2 6.48 2 12C2 17.52 6.48 22 12 22C17.52 22 22 17.52 22 12C22 6.48 17.52 2 12 2ZM14.19 14.19L6 18L9.81 9.81L18 6L14.19 14.19Z"] {
d: path("M4.80155 9.60429C4.80155 6.94677 6.94677 4.80155 9.60429 4.80155C12.2618 4.80155 14.407 6.94677 14.407 9.60429C14.407 12.2618 12.2618 14.407 9.60429 14.407C6.94677 14.407 4.80155 12.2618 4.80155 9.60429ZM16.0079 14.407H15.1648L14.866 14.1189C15.9119 12.9022 16.5416 11.3226 16.5416 9.60429C16.5416 5.77277 13.4358 2.66699 9.60429 2.66699C5.77277 2.66699 2.66699 5.77277 2.66699 9.60429C2.66699 13.4358 5.77277 16.5416 9.60429 16.5416C11.3226 16.5416 12.9022 15.9119 14.1189 14.866L14.407 15.1648V16.0079L19.7434 21.3337L21.3337 19.7434L16.2807 14.6803L16.0079 14.407Z");
}
/* Remove "Download Apps" button in server list */
[data-list-item-id="guildsnav___app-download-button"] {
display: none !important;
}
/* Remove guild list separators */
.listItem-3SmSlK>.guildSeparator-a4uisj {
display: none !important;
}
.socialLinks-3ywLUf {
display: none !important;
}
/* ------------------ */
/* Hide Nitro upsells */
/* ------------------ */
div[aria-controls="billing-tab"],
div[aria-controls="library-inventory-tab"] {
display: none !important;
}
/* Chatbox buttons */
div[aria-label="Start an Activity"] {
display: none;
}
/* Join more than 100 servers upsell */
/* TODO also hide the button when it appears sometimes */
.tutorialContainer-11ICd5+.listItem-2Ig28I>.listItemWrapper-2MsAsM {
display: none;
}
.nitroUpsell-27TJ8P {
display: none;
}
/* Hide Nitro separator in settings */
deiv[aria-label="User Settings"]>div[class^="separator"] {
display: none;
}
deiv[aria-label="User Settings"]>div[class^="separator"]~div[class^="separator"] {
display: block;
}
/* Hide Nitro tabs in Settings */
div[aria-label="User Settings"]>div[aria-label="Nitro"] {
display: none;
}
div[aria-label="User Settings"]>div[aria-label="Nitro"]+div {
display: none;
}
div[aria-label="User Settings"]>div[aria-label="Subscriptions"] {
display: none;
}
div[aria-label="User Settings"]>div[aria-label="Gift Inventory"] {
display: none;
}
div[aria-label="User Settings"]>div[aria-label="Gift Inventory"]+div[class^="item-"] {
display: none;
}
/* Hide Billing header and separator */
div[aria-label="User Settings"]>div[aria-label="Connections"]+div[class^="item-"]+div[class^="separator-"]+div[class^="header-"] {
display: none;
}
div[aria-label="User Settings"]>div[aria-label="Gift Inventory"]+div[class^="item-"]+div[class^="separator-"] {
display: none;
}
/* Hide profile customization upsells */
button[class^="shinyButton"] {
display: none;
}
svg[class^="nitro"] {
display: none;
}
div[class^="customizationSection"]:nth-of-type(3) {
display: none;
}
div[class^="bannerNitroUpsell"] {
display: none;
}
div[class^="optionBox"]:nth-of-type(2) {
display: none;
}
/* Per server avatar */
/* TODO find a way to hide "Unlock Avatar"*/
div[class^="upsellContainer"] {
display: none;
}
div[class*=" disabled-"] {
display: none;
}
/* Hide message size upsells */
div[class*=" upsell-"] {
display: none;
}
/* Hide Go Live quality upsells */
button[class*=" selectorButtonPremiumRequired-"] {
display: none;
}
/* Hide ad in profile banners */
div[class^="premiumIconWrapper"] {
display: none;
}
.emojiSection-3Fb9ix>.flex-1xMQg5>.flex-1xMQg5>.size14-e6ZScH {
display: none;
}
/* ------------- */
/* Server boosts */
/* ------------- */
/* Server dropdown */
div[class*=" colorPremium-"] {
display: none;
}
div[id="guild-header-popout"]>div>div[role="separator"] {
display: none;
}
div[id="guild-header-popout"]>div>div[role="separator"]~div[role="separator"] {
display: block;
}
/* Server settings */
/* TODO: fully hide Boost customization options */
div[class^="serverBoostTabItem"] {
display: none;
}
div[class^="serverBoostTabItem"]+div[class^="separator"] {
display: none;
}
div[aria-controls="vanity_url-tab"] {
display: none;
}
/* Display settings in Overview */
div[id="overview-tab"]>div>div+div>div:last-child {
display: none;
}
/* Thread archive times */
span[class*=" disabledOptionLabel-"] {
display: none;
}
div[class^="availabilityIndicator"] {
display: none;
}
.checkboxWrapperDisabled-36r8NK {
display: none;
}
/* Boosted server badge */
div[class^="guildIconContainer"] {
display: none;
}
/* Boost progress bar */
ul[aria-label="Channels"]>div+div+div[class^="container-"] {
display: none;
}
/* Server boost profile badge */
div[class^="clickable-"][aria-label^="Server boosting"] {
display: none;
}
/* Boost in chat bar */
button[aria-label="Boost this server"] {
display: none;
}
/* Bugfix laggy server scroll */
div[data-dnd-name]>div[class^="wrapper"] svg {
overflow: hidden;
}
/* Hide Help button */
div[aria-label="Help"] {
display: none;
}
[src="/assets/439112b388adcac969dc066d30767b76.png"] {
content: url("/assets/36d4b341723daffd4a372e1b19591da1.png");
}
.characterBackground-1BPOOJ {
background: url(/assets/backgroundlogin.svg);
background-size: cover;
background-position: center;
}
.characterBackground-1BPOOJ .artwork-L5TAwQ {
display: none;
}
.logo-2Rw1Ex {
background: url("/assets/4f004ac9be168ac6ee18fc442a52ab53.svg") no-repeat !important;
}
</style>
</body>
</style>
</body>
</html>

View File

@ -42,7 +42,7 @@
<nav class="headerInner-3WwzEA">
<div class="headerLogo-TcWpbY">
<div>
<a tabindex="0" href="https://%BASE_URL%/">
<a tabindex="0" href="/">
<div style="flex-shrink:1;flex-grow:1;flex-basis:auto"
class="flex-21ywRf flexHorizontal-2e8SIr flexJustifyStart-3Hopvt flexAlignStretch-2lwI1M flexNowrap-2g1HIq">
<svg class="clyde-2-VPBZ logo-1U_ovC flexChild-FMspoG" viewBox="0 0 33 36"
@ -79,17 +79,17 @@
</div>
<ul class="headerNav-IBNU4s" role="menubar">
<li class="listItemInactive-396Xk8 listItem-1ra-Bk" role="none">
<a tabindex="0" role="menuitem" href="https://%BASE_URL%/download">
<a tabindex="0" role="menuitem" href="/download">
<span class="mainNavLink-Z3uwQ7 navLink-DPGG6D">Download</span>
</a>
</li>
<li class="listItemInactive-396Xk8 listItem-1ra-Bk" role="none">
<a tabindex="0" role="menuitem" href="https://%BASE_URL%/nitro">
<a tabindex="0" role="menuitem" href="/nitro">
<span class="mainNavLink-Z3uwQ7 navLink-DPGG6D">Source Code</span>
</a>
</li>
<li class="listItemInactive-396Xk8 listItem-1ra-Bk" role="none">
<a tabindex="0" role="menuitem" href="https://%BASE_URL%/jobs">
<a tabindex="0" role="menuitem" href="/jobs">
<span class="mainNavLink-Z3uwQ7 navLink-DPGG6D">Instance Information</span>
</a>
</li>
@ -107,7 +107,7 @@
<header class="header-3aRurq mobileHeader-2xB92D">
<nav class="headerInner-2w4ICT">
<div class="headerLogo-tb03Nu">
<a class="logoWrapper-3agQ6A" tabindex="0" href="https://%BASE_URL%/">
<a class="logoWrapper-3agQ6A" tabindex="0" href="/">
<img class="logo-3FcuSx" src="/assets/c4e681296681c48b7a9be5e461fa9101.svg" alt="Discord"
itemprop="logo">
</a>
@ -117,17 +117,17 @@
</div>
<ul class="headerNav-QStAAj">
<li role="none">
<a tabindex="-1" role="menuitem" href="https://%BASE_URL%/download">
<a tabindex="-1" role="menuitem" href="/download">
<span class="mainNavLink-1SwQrC">Download</span>
</a>
</li>
<li role="none">
<a tabindex="-1" role="menuitem" href="https://%BASE_URL%/nitro">
<a tabindex="-1" role="menuitem" href="/nitro">
<span class="mainNavLink-1SwQrC">Nitro</span>
</a>
</li>
<li role="none">
<a tabindex="-1" role="menuitem" href="https://%BASE_URL%/jobs">
<a tabindex="-1" role="menuitem" href="/jobs">
<span class="mainNavLink-1SwQrC">Jobs</span>
</a>
</li>
@ -636,16 +636,6 @@ html, body {
</div>
</div>
</div>
<script nonce="">
window.GLOBAL_ENV = {
API_ENDPOINT: '//%BASE_URL%/api',
WEBAPP_ENDPOINT: '//%BASE_URL%',
CDN_HOST: '%BASE_URL%',
MARKETING_ENDPOINT: '//%BASE_URL%',
RELEASE_CHANNEL: 'stable',
};
</script>
</body>
</html>

Binary file not shown.

After

Width:  |  Height:  |  Size: 26 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 22 KiB

View File

@ -22,6 +22,7 @@ import { Router } from "express";
import { Server, ServerOptions } from "lambert-server";
import morgan from "morgan";
import path from "path";
import fs from "fs/promises";
import express from "express";
import { red } from "picocolors";
import { initInstance } from "./util/handlers/Instance";
@ -164,8 +165,19 @@ export class SpacebarServer extends Server {
});
// caca
app.get(/^(?!\/(api|\.well-known)).*$/, (req, res) => {
res.sendFile(path.join(PUBLIC_ASSETS_FOLDER, "index.html"));
app.get(/^(?!\/(api|\.well-known)).*$/, async (req, res) => {
let html = await fs.readFile(
path.join(PUBLIC_ASSETS_FOLDER, "index.html"),
"utf8"
);
html = html
.replaceAll("%BASE_URL%", Config.get().api.endpointPublic?.split("/api")[0] ?? "")
.replaceAll("%GATEWAY_URL%", Config.get().gateway.endpointPublic ?? "")
.replaceAll("%CDN_URL%", Config.get().cdn.endpointPublic ?? "")
.replaceAll("%VAPID_KEY%", Config.get().webPush.publicVapidKey ?? "");
res.type("html").send(html);
});
this.app.use(ErrorHandler);

View File

@ -183,7 +183,6 @@ export class ReadyGuildDTO implements IReadyGuildDTO {
this.premium_subscription_count = guild.premium_subscription_count;
Object.assign(this, {
...this,
name: guild.name,
description: guild.description,
icon: guild.icon,