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,12 +1,14 @@
<!DOCTYPE html> <!DOCTYPE html>
<html> <html>
<head> <head>
<meta charset="utf-8"> <meta charset="utf-8">
<meta content="width=device-width, initial-scale=1.0, maximum-scale=1, user-scalable=no" name="viewport"> <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:type" content="website">
<meta property="og:site_name" content="Discord"> <meta property="og:site_name" content="Discord">
<meta property="og:title" content="Discord - A New Way to Chat with Friends & Communities"> <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: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 property="og:image" content="https://discord.com/assets/ee7c382d9257652a88c8f7b7f22a994d.png">
<meta name="twitter:card" content="summary_large_image"> <meta name="twitter:card" content="summary_large_image">
<meta name="twitter:site" content="@discord"> <meta name="twitter:site" content="@discord">
@ -30,7 +32,6 @@
<script> <script>
(function () { (function () {
window.GLOBAL_ENV = {};
window.__OVERLAY__ = /overlay/.test(location.pathname) window.__OVERLAY__ = /overlay/.test(location.pathname)
window.__BILLING_STANDALONE__ = /^\/billing/.test(location.pathname) window.__BILLING_STANDALONE__ = /^\/billing/.test(location.pathname)
@ -41,77 +42,36 @@
window.AUTH_TOKEN = null; window.AUTH_TOKEN = null;
window.localStorage_ = localStorage; window.localStorage_ = localStorage;
function protocolRelative(url) {
if (!url) return "";
return "//" + url.replace(/^https?:\/\//, "").replace(/\/$/, "");
}
async function loadGlobalEnv() {
try {
const res = await fetch("/.well-known/spacebar/client");
const data = await res.json();
window.GLOBAL_ENV = { window.GLOBAL_ENV = {
API_ENDPOINT: protocolRelative(data.api.baseUrl) + "/api", API_ENDPOINT: "%BASE_URL%/api",
API_VERSION: 9, API_VERSION: 9,
WEBAPP_ENDPOINT: protocolRelative(data.api.baseUrl), WEBAPP_ENDPOINT: "%BASE_URL%",
CDN_HOST: protocolRelative(data.cdn.baseUrl), CDN_HOST: "%CDN_URL%",
ASSET_ENDPOINT: protocolRelative(data.cdn.baseUrl), ASSET_ENDPOINT: "%CDN_URL%",
MEDIA_PROXY_ENDPOINT: protocolRelative(data.cdn.baseUrl), MEDIA_PROXY_ENDPOINT: "%CDN_URL%",
WIDGET_ENDPOINT: "//discord.com/widget", WIDGET_ENDPOINT: "//discord.com/widget",
INVITE_HOST: "discord.gg", INVITE_HOST: "discord.gg",
GUILD_TEMPLATE_HOST: "discord.new", GUILD_TEMPLATE_HOST: "discord.new",
GIFT_CODE_HOST: "discord.gift", GIFT_CODE_HOST: "discord.gift",
RELEASE_CHANNEL: "stable", RELEASE_CHANNEL: "stable",
MARKETING_ENDPOINT: protocolRelative(data.api.baseUrl), MARKETING_ENDPOINT: "%BASE_URL%",
BRAINTREE_KEY: "production_5st77rrc_49pp2rp4phym7387", BRAINTREE_KEY: "production_5st77rrc_49pp2rp4phym7387",
STRIPE_KEY: "pk_live_CUQtlpQUF0vufWpnpUmQvcdi", STRIPE_KEY: "pk_live_CUQtlpQUF0vufWpnpUmQvcdi",
NETWORKING_ENDPOINT: protocolRelative(data.api.baseUrl), NETWORKING_ENDPOINT: "%BASE_URL%",
RTC_LATENCY_ENDPOINT: protocolRelative(data.api.baseUrl), RTC_LATENCY_ENDPOINT: "%BASE_URL%",
ACTIVITY_APPLICATION_HOST: protocolRelative(data.api.baseUrl), ACTIVITY_APPLICATION_HOST: "%BASE_URL%",
PROJECT_ENV: "production", PROJECT_ENV: "production",
REMOTE_AUTH_ENDPOINT: "//remote-auth-gateway.discord.gg", REMOTE_AUTH_ENDPOINT: "//remote-auth-gateway.discord.gg",
SENTRY_TAGS: { buildId: "9af39da", buildType: "normal" }, SENTRY_TAGS: { buildId: "9af39da", buildType: "normal" },
MIGRATION_SOURCE_ORIGIN: protocolRelative(data.api.baseUrl), MIGRATION_SOURCE_ORIGIN: "%BASE_URL%",
MIGRATION_DESTINATION_ORIGIN: protocolRelative(data.api.baseUrl), MIGRATION_DESTINATION_ORIGIN: "%BASE_URL%",
HTML_TIMESTAMP: Date.now(), HTML_TIMESTAMP: Date.now(),
ALGOLIA_KEY: "aca0d7082e4e63af5ba5917d5e96bed0", ALGOLIA_KEY: "aca0d7082e4e63af5ba5917d5e96bed0",
GATEWAY_ENDPOINT: data.gateway.baseUrl, GATEWAY_ENDPOINT: "%GATEWAY_URL%",
VAPID_KEY: data.vapid.publicKey, VAPID_KEY: "%VAPID_KEY%",
GATEWAY_URL: data.gateway.baseUrl GATEWAY_URL: "%GATEWAY_URL"
}; };
const customScripts = [
"/assets/custom/utils.js",
"/assets/custom/pushMessages.js",
"/assets/custom/rtcPatcher.js",
"/assets/custom/web/switch.js",
"/assets/custom/web/main.js",
]
const normalScripts = [
"/assets/053574d0f6edc579c71e.js",
"/assets/771dcd97bfd5f9b77ef6.js",
"/assets/0ffb9e3c90aa88720fc7.js",
"/assets/cbc98c97c3635bf34da3.js",
];
const scripts = [
...normalScripts,
...customScripts
];
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);
}
}
localStorage.setItem("exerimentOverrides", JSON.stringify({ localStorage.setItem("exerimentOverrides", JSON.stringify({
"2022-03_text_in_voice": { "2022-03_text_in_voice": {
type: "guild", type: "guild",
@ -120,14 +80,26 @@
override: true override: true
} }
})); }));
loadGlobalEnv();
})(); })();
</script> </script>
</head> </head>
<body> <body>
<div id="app-mount"></div> <div id="app-mount"></div>
<!-- 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>
<!-- 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>
<style> <style>
[class^="qrCodeOverlay"] { [class^="qrCodeOverlay"] {
all: unset; all: unset;
@ -136,14 +108,26 @@
width: 100%; width: 100%;
height: 100%; height: 100%;
} }
[class*="qrCode-"][class*="spinner-"] { display: none; }
button[aria-label="Send a gift"], a[href="/store"] { display: none; } [class*="qrCode-"][class*="spinner-"] {
.platform-win .notice-3bPHh- { display: none; } 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="Discord Nitro-tab"],
div[aria-controls="Nitro Server Boost-tab"], div[aria-controls="Nitro Server Boost-tab"],
.theme-dark, .theme-light { .theme-dark,
.theme-light {
--font-primary: Whitney; --font-primary: Whitney;
--font-display: Whitney, "Helvetica Neue", Helvetica, Arial, sans-serif !important; --font-display: Whitney, "Helvetica Neue", Helvetica, Arial, sans-serif !important;
--text-positive: hsl(152.6, calc(var(--saturation-factor, 1) * 46%), 48.6%); --text-positive: hsl(152.6, calc(var(--saturation-factor, 1) * 46%), 48.6%);
@ -231,25 +215,31 @@
background-position: center; background-position: center;
background-repeat: no-repeat; background-repeat: no-repeat;
} }
.scroller-3X7KbA .tutorialContainer-1pL9QS .childWrapper-1j_1ub>svg path { .scroller-3X7KbA .tutorialContainer-1pL9QS .childWrapper-1j_1ub>svg path {
display: none; display: none;
} }
.scroller-3X7KbA .tutorialContainer-1pL9QS .childWrapper-1j_1ub>svg rect { .scroller-3X7KbA .tutorialContainer-1pL9QS .childWrapper-1j_1ub>svg rect {
fill: none; fill: none;
} }
.theme-dark .scroller-3X7KbA .tutorialContainer-1pL9QS .childWrapper-1j_1ub > svg, .guilds-2JjMmN.theme-dark .scroller-3X7KbA .tutorialContainer-1pL9QS .childWrapper-1j_1ub > svg {
.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"); background-image: url("/assets/89576a4bb71f927eb20e8aef987b499b.svg");
} }
.theme-light .homeIcon-r0w4ny { .theme-light .homeIcon-r0w4ny {
--text-normal: #000; --text-normal: #000;
} }
.wrapper-3kah-n.selected-1Drb7Z .childWrapper-1j_1ub .homeIcon-r0w4ny, .wrapper-3kah-n.selected-1Drb7Z .childWrapper-1j_1ub .homeIcon-r0w4ny,
.wrapper-3kah-n:hover .childWrapper-1j_1ub .homeIcon-r0w4ny { .wrapper-3kah-n:hover .childWrapper-1j_1ub .homeIcon-r0w4ny {
--text-normal: #fff; --text-normal: #fff;
} }
.scroller-3X7KbA .tutorialContainer-1pL9QS .wrapper-3kah-n.selected-1Drb7Z .childWrapper-1j_1ub>svg { .scroller-3X7KbA .tutorialContainer-1pL9QS .wrapper-3kah-n.selected-1Drb7Z .childWrapper-1j_1ub>svg {
background-image: url(/assets/89576a4bb71f927eb20e8aef987b499b-119c935d.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"] { .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"] {
@ -281,91 +271,187 @@ div[aria-controls="library-inventory-tab"] {
} }
/* Chatbox buttons */ /* Chatbox buttons */
div[aria-label="Start an Activity"] { display: none; } div[aria-label="Start an Activity"] {
display: none;
}
/* Join more than 100 servers upsell */ /* Join more than 100 servers upsell */
/* TODO also hide the button when it appears sometimes */ /* TODO also hide the button when it appears sometimes */
.tutorialContainer-11ICd5 + .listItem-2Ig28I > .listItemWrapper-2MsAsM { display: none; } .tutorialContainer-11ICd5+.listItem-2Ig28I>.listItemWrapper-2MsAsM {
.nitroUpsell-27TJ8P { display: none; } display: none;
}
.nitroUpsell-27TJ8P {
display: none;
}
/* Hide Nitro separator in settings */ /* Hide Nitro separator in settings */
deiv[aria-label="User Settings"] > div[class^="separator"] { display: none; } deiv[aria-label="User Settings"]>div[class^="separator"] {
deiv[aria-label="User Settings"] > div[class^="separator"] ~ div[class^="separator"] { display: block; } display: none;
}
deiv[aria-label="User Settings"]>div[class^="separator"]~div[class^="separator"] {
display: block;
}
/* Hide Nitro tabs in Settings */ /* 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[aria-label="User Settings"] > div[aria-label="Nitro"] + div { display: none; } 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; } 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 */ /* 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="Connections"]+div[class^="item-"]+div[class^="separator-"]+div[class^="header-"] {
div[aria-label="User Settings"] > div[aria-label="Gift Inventory"] + div[class^="item-"] + div[class^="separator-"] { display: none; } display: none;
}
div[aria-label="User Settings"]>div[aria-label="Gift Inventory"]+div[class^="item-"]+div[class^="separator-"] {
display: none;
}
/* Hide profile customization upsells */ /* Hide profile customization upsells */
button[class^="shinyButton"] { display: none; } button[class^="shinyButton"] {
svg[class^="nitro"] { display: none; } 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; } 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 */ /* Per server avatar */
/* TODO find a way to hide "Unlock Avatar"*/ /* TODO find a way to hide "Unlock Avatar"*/
div[class^="upsellContainer"] { display: none; } div[class^="upsellContainer"] {
div[class*=" disabled-"] { display: none; } display: none;
}
div[class*=" disabled-"] {
display: none;
}
/* Hide message size upsells */ /* Hide message size upsells */
div[class*=" upsell-"] { display: none; } div[class*=" upsell-"] {
display: none;
}
/* Hide Go Live quality upsells */ /* Hide Go Live quality upsells */
button[class*=" selectorButtonPremiumRequired-"] { display: none; } button[class*=" selectorButtonPremiumRequired-"] {
display: none;
}
/* Hide ad in profile banners */ /* Hide ad in profile banners */
div[class^="premiumIconWrapper"] { display: none; } div[class^="premiumIconWrapper"] {
display: none;
}
.emojiSection-3Fb9ix > .flex-1xMQg5 > .flex-1xMQg5 > .size14-e6ZScH { display: none; } .emojiSection-3Fb9ix>.flex-1xMQg5>.flex-1xMQg5>.size14-e6ZScH {
display: none;
}
/* ------------- */ /* ------------- */
/* Server boosts */ /* Server boosts */
/* ------------- */ /* ------------- */
/* Server dropdown */ /* Server dropdown */
div[class*=" colorPremium-"] { display: none; } div[class*=" colorPremium-"] {
div[id="guild-header-popout"] > div > div[role="separator"] { display: none; } display: none;
div[id="guild-header-popout"] > div > div[role="separator"] ~ div[role="separator"] { display: block; } }
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 */ /* Server settings */
/* TODO: fully hide Boost customization options */ /* TODO: fully hide Boost customization options */
div[class^="serverBoostTabItem"] { display: none; } div[class^="serverBoostTabItem"] {
div[class^="serverBoostTabItem"] + div[class^="separator"] { display: none; } display: none;
div[aria-controls="vanity_url-tab"] { display: none; } }
div[class^="serverBoostTabItem"]+div[class^="separator"] {
display: none;
}
div[aria-controls="vanity_url-tab"] {
display: none;
}
/* Display settings in Overview */ /* Display settings in Overview */
div[id="overview-tab"] > div > div + div > div:last-child{ display: none; } div[id="overview-tab"]>div>div+div>div:last-child {
display: none;
}
/* Thread archive times */ /* Thread archive times */
span[class*=" disabledOptionLabel-"] { display: none; } span[class*=" disabledOptionLabel-"] {
div[class^="availabilityIndicator"] { display: none; } display: none;
.checkboxWrapperDisabled-36r8NK { display: none; } }
div[class^="availabilityIndicator"] {
display: none;
}
.checkboxWrapperDisabled-36r8NK {
display: none;
}
/* Boosted server badge */ /* Boosted server badge */
div[class^="guildIconContainer"] { display: none; } div[class^="guildIconContainer"] {
display: none;
}
/* Boost progress bar */ /* Boost progress bar */
ul[aria-label="Channels"] > div + div + div[class^="container-"] { display: none; } ul[aria-label="Channels"]>div+div+div[class^="container-"] {
display: none;
}
/* Server boost profile badge */ /* Server boost profile badge */
div[class^="clickable-"][aria-label^="Server boosting"] { display: none; } div[class^="clickable-"][aria-label^="Server boosting"] {
display: none;
}
/* Boost in chat bar */ /* Boost in chat bar */
button[aria-label="Boost this server"] { display: none; } button[aria-label="Boost this server"] {
display: none;
}
/* Bugfix laggy server scroll */ /* Bugfix laggy server scroll */
div[data-dnd-name] > div[class^="wrapper"] svg { overflow: hidden; } div[data-dnd-name]>div[class^="wrapper"] svg {
overflow: hidden;
}
/* Hide Help button */ /* Hide Help button */
div[aria-label="Help"] { display: none; } div[aria-label="Help"] {
display: none;
}
[src="/assets/439112b388adcac969dc066d30767b76.png"] { [src="/assets/439112b388adcac969dc066d30767b76.png"] {
@ -377,6 +463,7 @@ div[aria-label="Help"] { display: none; }
background-size: cover; background-size: cover;
background-position: center; background-position: center;
} }
.characterBackground-1BPOOJ .artwork-L5TAwQ { .characterBackground-1BPOOJ .artwork-L5TAwQ {
display: none; display: none;
} }
@ -384,7 +471,7 @@ div[aria-label="Help"] { display: none; }
.logo-2Rw1Ex { .logo-2Rw1Ex {
background: url("/assets/4f004ac9be168ac6ee18fc442a52ab53.svg") no-repeat !important; background: url("/assets/4f004ac9be168ac6ee18fc442a52ab53.svg") no-repeat !important;
} }
</style> </style>
</body> </body>
</html> </html>

View File

@ -42,7 +42,7 @@
<nav class="headerInner-3WwzEA"> <nav class="headerInner-3WwzEA">
<div class="headerLogo-TcWpbY"> <div class="headerLogo-TcWpbY">
<div> <div>
<a tabindex="0" href="https://%BASE_URL%/"> <a tabindex="0" href="/">
<div style="flex-shrink:1;flex-grow:1;flex-basis:auto" <div style="flex-shrink:1;flex-grow:1;flex-basis:auto"
class="flex-21ywRf flexHorizontal-2e8SIr flexJustifyStart-3Hopvt flexAlignStretch-2lwI1M flexNowrap-2g1HIq"> 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" <svg class="clyde-2-VPBZ logo-1U_ovC flexChild-FMspoG" viewBox="0 0 33 36"
@ -79,17 +79,17 @@
</div> </div>
<ul class="headerNav-IBNU4s" role="menubar"> <ul class="headerNav-IBNU4s" role="menubar">
<li class="listItemInactive-396Xk8 listItem-1ra-Bk" role="none"> <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> <span class="mainNavLink-Z3uwQ7 navLink-DPGG6D">Download</span>
</a> </a>
</li> </li>
<li class="listItemInactive-396Xk8 listItem-1ra-Bk" role="none"> <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> <span class="mainNavLink-Z3uwQ7 navLink-DPGG6D">Source Code</span>
</a> </a>
</li> </li>
<li class="listItemInactive-396Xk8 listItem-1ra-Bk" role="none"> <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> <span class="mainNavLink-Z3uwQ7 navLink-DPGG6D">Instance Information</span>
</a> </a>
</li> </li>
@ -107,7 +107,7 @@
<header class="header-3aRurq mobileHeader-2xB92D"> <header class="header-3aRurq mobileHeader-2xB92D">
<nav class="headerInner-2w4ICT"> <nav class="headerInner-2w4ICT">
<div class="headerLogo-tb03Nu"> <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" <img class="logo-3FcuSx" src="/assets/c4e681296681c48b7a9be5e461fa9101.svg" alt="Discord"
itemprop="logo"> itemprop="logo">
</a> </a>
@ -117,17 +117,17 @@
</div> </div>
<ul class="headerNav-QStAAj"> <ul class="headerNav-QStAAj">
<li role="none"> <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> <span class="mainNavLink-1SwQrC">Download</span>
</a> </a>
</li> </li>
<li role="none"> <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> <span class="mainNavLink-1SwQrC">Nitro</span>
</a> </a>
</li> </li>
<li role="none"> <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> <span class="mainNavLink-1SwQrC">Jobs</span>
</a> </a>
</li> </li>
@ -636,16 +636,6 @@ html, body {
</div> </div>
</div> </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> </body>
</html> </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 { Server, ServerOptions } from "lambert-server";
import morgan from "morgan"; import morgan from "morgan";
import path from "path"; import path from "path";
import fs from "fs/promises";
import express from "express"; import express from "express";
import { red } from "picocolors"; import { red } from "picocolors";
import { initInstance } from "./util/handlers/Instance"; import { initInstance } from "./util/handlers/Instance";
@ -164,8 +165,19 @@ export class SpacebarServer extends Server {
}); });
// caca // caca
app.get(/^(?!\/(api|\.well-known)).*$/, (req, res) => { app.get(/^(?!\/(api|\.well-known)).*$/, async (req, res) => {
res.sendFile(path.join(PUBLIC_ASSETS_FOLDER, "index.html")); 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); this.app.use(ErrorHandler);

View File

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