1
0
mirror of https://github.com/spacebarchat/server.git synced 2024-11-10 04:32:35 +01:00

Fix server -> guild patch and add status.discord.com -> status.understars.dev patch

This commit is contained in:
Madeline 2022-10-24 18:46:04 +11:00
parent 94669d7911
commit ce14760c2b
2 changed files with 73 additions and 28 deletions

View File

@ -160,3 +160,26 @@ b5eb2f7d6b3f8cc9b60be4a5dcf28015.svg
8cdb96f2d79587fc380142dd132acf45.gif
81f855741b7bdf09d97f8ea644dac150.gif
1dabb8ee5d7cb5137c06f958e0091573.svg
63e3655bb034980e94b75c68c0317df1.png
aa48191cd1b1a1c70f5d6c97d267a596.svg
29cfa98a6ada50a07e009bae38dce3da.svg
3d941eb2606379c2ee9b753f7acf2845.svg
e6d6bd0c67e5c9a8a65406612240fa4c.svg
d84fd42fb2edf983cc5b5dc1007a33ca.svg
afbb21036aa2e7d8f15fa10dd6232fc0.svg
b21e574729a2e2b9243d811be7333677.svg
86548cb347b5acfb41bcb328c89b9bdc.svg
5656f17248cf747f56433a1d60c8c1bf.svg
86548cb347b5acfb41bcb328c89b9bdc.svg
5656f17248cf747f56433a1d60c8c1bf.svg
94ff6fdc535b6ecb7b1bc54f2dd56a10.svg
a49aa0af67106dfc5fed4d6ebfa011c9.svg
071e743e602763497a5e394510b68f28.svg
1097866274648af5edf0.js
6e98d426b375ee024fd2.js
3093c4e6a3ee8ef9d6ee62ffea283603.svg
dbdc2f57ed1a7f2f01a342ab2e6fb032.svg
02e604928e685344a86abbd473841a3d.svg
9a31e0f65d520cc12d7f42374d59a2d1.svg
d759f3acc6286c964cc8118d7f68b374.svg
eeacc28d3c62a7cf1154a2bc11968ad8.svg

View File

@ -25,43 +25,64 @@ const INDEX_SCRIPTS = [
const doPatch = (content) => {
//remove nitro references
content = content.replace(/Discord Nitro/g, `${INSTANCE_NAME} Premium`);
content = content.replace(/"Nitro"/g, '"Premium"');
content = content.replace(/Nitro /g, "Premium ");
content = content.replace(/ Nitro/g, " Premium");
content = content.replace(/\[Nitro\]/g, "[Premium]");
content = content.replace(/\*Nitro\*/g, "*Premium*");
content = content.replace(/\"Nitro \. /g, '"Premium. ');
content = content.replaceAll(/Discord Nitro/g, `${INSTANCE_NAME} Premium`);
content = content.replaceAll(/"Nitro"/g, '"Premium"');
content = content.replaceAll(/Nitro /g, "Premium ");
content = content.replaceAll(/ Nitro/g, " Premium");
content = content.replaceAll(/\[Nitro\]/g, "[Premium]");
content = content.replaceAll(/\*Nitro\*/g, "*Premium*");
content = content.replaceAll(/\"Nitro \. /g, '"Premium. ');
//remove discord references
content = content.replace(/ Discord /g, ` ${INSTANCE_NAME} `);
content = content.replace(/Discord /g, `${INSTANCE_NAME} `);
content = content.replace(/ Discord/g, ` ${INSTANCE_NAME}`);
content = content.replace(/Discord Premium/g, `${INSTANCE_NAME} Premium`);
content = content.replace(/Discord Nitro/g, `${INSTANCE_NAME} Premium`);
content = content.replace(/Discord's/g, `${INSTANCE_NAME}'s`);
//content = content.replace(/DiscordTag/g, "FosscordTag");
content = content.replace(/\*Discord\*/g, `*${INSTANCE_NAME}*`);
content = content.replaceAll(/ Discord /g, ` ${INSTANCE_NAME} `);
content = content.replaceAll(/Discord /g, `${INSTANCE_NAME} `);
content = content.replaceAll(/ Discord/g, ` ${INSTANCE_NAME}`);
content = content.replaceAll(/Discord Premium/g, `${INSTANCE_NAME} Premium`);
content = content.replaceAll(/Discord Nitro/g, `${INSTANCE_NAME} Premium`);
content = content.replaceAll(/Discord's/g, `${INSTANCE_NAME}'s`);
//content = content.replaceAll(/DiscordTag/g, "FosscordTag");
content = content.replaceAll(/\*Discord\*/g, `*${INSTANCE_NAME}*`);
//server -> guild
content = content.replace(/"Server"/g, '"Guild"');
content.replaceAll('server."', 'guild."');
content.replaceAll(" server ", " guild ");
content.replaceAll(" Server ", " Guild ");
content.replaceAll('"Server', '"Guild');
const serverVariations = [
['"Server"', '"Guild"'],
['"Server ', '"Guild '],
[' Server"', ' Guild"'],
[' Server ', ' Guild '],
// //change some vars
content = content.replace('dsn: "https://fa97a90475514c03a42f80cd36d147c4@sentry.io/140984"', "dsn: (/true/.test(localStorage.sentryOptIn)?'https://6bad92b0175d41a18a037a73d0cff282@sentry.thearcanebrony.net/12':'')");
content = content.replace('t.DSN = "https://fa97a90475514c03a42f80cd36d147c4@sentry.io/140984"', "t.DSN = (/true/.test(localStorage.sentryOptIn)?'https://6bad92b0175d41a18a037a73d0cff282@sentry.thearcanebrony.net/12':'')");
content = content.replace('--brand-experiment: hsl(235, calc(var(--saturation-factor, 1) * 85.6%), 64.7%);', '--brand-experiment: hsl(var(--brand-hue), calc(var(--saturation-factor, 1) * 85.6%), 50%);');
content = content.replaceAll(/--brand-experiment-(\d{1,4}): hsl\(235/g, '--brand-experiment-\$1: hsl(var(--brand-hue)');
['"Server."', '"Guild."'],
[' Server."', ' Guild."'],
['"Server."', '"Guild,"'],
[' Server,"', ' Guild,"'],
[' Server,', ' Guild,'],
['"Servers"', '"Guilds"'],
['"Servers ', '"Guilds '],
[' Servers"', ' Guilds"'],
[' Servers ', ' Guilds '],
['"Servers."', '"Guilds."'],
[' Servers."', ' Guilds,"'],
['"Servers,"', '"Guilds,"'],
[' Servers,"', ' Guilds,"'],
[' Servers,', ' Guilds,'],
];
serverVariations.forEach(x => serverVariations.push([x[0].toLowerCase(), x[1].toLowerCase()]));
serverVariations.forEach(x => content = content.replaceAll(x[0], x[1]));
// can't match \nServers for some reason
content = content.replaceAll('Servers in the Hub are student-run, but may include non-students."', 'Guilds in the Hub are student-run, but may include non-students."');
// sentry
content = content.replaceAll("https://fa97a90475514c03a42f80cd36d147c4@sentry.io/140984", "https://05e8e3d005f34b7d97e920ae5870a5e5@sentry.thearcanebrony.net/6");
//logos
content = content.replace(
content = content.replaceAll(
"M23.0212 1.67671C21.3107 0.879656 19.5079 0.318797 17.6584 0C17.4062 0.461742 17.1749 0.934541 16.9708 1.4184C15.003 1.12145 12.9974 1.12145 11.0283 1.4184C10.819 0.934541 10.589 0.461744 10.3368 0.00546311C8.48074 0.324393 6.67795 0.885118 4.96746 1.68231C1.56727 6.77853 0.649666 11.7538 1.11108 16.652C3.10102 18.1418 5.3262 19.2743 7.69177 20C8.22338 19.2743 8.69519 18.4993 9.09812 17.691C8.32996 17.3997 7.58522 17.0424 6.87684 16.6135C7.06531 16.4762 7.24726 16.3387 7.42403 16.1847C11.5911 18.1749 16.408 18.1749 20.5763 16.1847C20.7531 16.3332 20.9351 16.4762 21.1171 16.6135C20.41 17.0369 19.6639 17.3997 18.897 17.691C19.3052 18.4993 19.7718 19.2689 20.3021 19.9945C22.6677 19.2689 24.8929 18.1364 26.8828 16.6466H26.8893C27.43 10.9731 25.9665 6.04728 23.0212 1.67671ZM9.68041 13.6383C8.39754 13.6383 7.34085 12.4453 7.34085 10.994C7.34085 9.54272 8.37155 8.34973 9.68041 8.34973C10.9893 8.34973 12.0395 9.54272 12.0187 10.994C12.0187 12.4453 10.9828 13.6383 9.68041 13.6383ZM18.3161 13.6383C17.0332 13.6383 15.9765 12.4453 15.9765 10.994C15.9765 9.54272 17.0124 8.34973 18.3161 8.34973C19.6184 8.34973 20.6751 9.54272 20.6543 10.994C20.6543 12.4453 19.6184 13.6383 18.3161 13.6383Z",
"M 0,0 47.999993,2.7036528e-4 C 48.001796,3.3028172 47.663993,6.5968018 46.991821,9.8301938 43.116101,28.454191 28.452575,43.116441 9.8293509,46.992163 6.5960834,47.664163 3.3023222,48.001868 0,47.999992 Z m 9.8293509,28.735114 v 9.248482 C 22.673599,33.047696 32.857154,22.749268 37.63852,9.829938 H 9.8293509 v 8.679899 H 22.931288 c -3.554489,3.93617 -7.735383,7.257633 -12.373436,9.829938 -0.241031,0.133684 -0.483864,0.265492 -0.7285011,0.395339 z"
);
content = content.replace('width:n,height:o,viewBox:"0 0 28 20"', 'width:48,height:48,viewBox:"0 0 48 48"');
content = content.replaceAll('width:n,height:o,viewBox:"0 0 28 20"', 'width:48,height:48,viewBox:"0 0 48 48"');
//save some time on load resolving asset urls...
content = content.replaceAll(
@ -90,6 +111,8 @@ const doPatch = (content) => {
// ""
// )
content = content.replaceAll("status.discord.com", "status.understars.dev");
return content;
};
@ -98,7 +121,6 @@ const processFile = async (name) => {
agent,
});
if (res.status !== 200) {
console.log(name, res.status);
return [];
};