Update MineGeo domain and harden process supervision
All checks were successful
Deploy MineGeo to Dokploy / deploy (push) Successful in 5m57s
All checks were successful
Deploy MineGeo to Dokploy / deploy (push) Successful in 5m57s
This commit is contained in:
@@ -5,11 +5,11 @@ const require = createRequire(import.meta.url);
|
||||
const { isInternal, isExternal } = require("../desktop/navigation.cjs");
|
||||
|
||||
test("desktop navigation confines remote content to the production origin", () => {
|
||||
assert.equal(isInternal("https://minegeo.vercel.app/play?map=1"), true);
|
||||
assert.equal(isInternal("https://minegeo.site/play?map=1"), true);
|
||||
for (const url of [
|
||||
"http://minegeo.vercel.app",
|
||||
"https://minegeo.vercel.app.evil.test",
|
||||
"https://minegeo.vercel.app@evil.test",
|
||||
"http://minegeo.site",
|
||||
"https://minegeo.site.evil.test",
|
||||
"https://minegeo.site@evil.test",
|
||||
"file:///C:/Windows",
|
||||
"javascript:alert(1)",
|
||||
"not a URL",
|
||||
|
||||
@@ -21,7 +21,7 @@ function request(
|
||||
authorization = `Bearer ${token}`,
|
||||
method = "GET",
|
||||
) {
|
||||
return new Request(`https://minegeo.vercel.app/api/dev/v1/${path}`, {
|
||||
return new Request(`https://minegeo.site/api/dev/v1/${path}`, {
|
||||
method,
|
||||
headers: { authorization, cookie: "admin=ignored" },
|
||||
});
|
||||
|
||||
@@ -36,7 +36,7 @@ const source = {
|
||||
limit: 8,
|
||||
};
|
||||
test("closed Discord parties turn red, lose their join prompt, and delete idempotently", async () => {
|
||||
const payload = closedPartyMessage("https://minegeo.vercel.app", target);
|
||||
const payload = closedPartyMessage("https://minegeo.site", target);
|
||||
assert.equal(payload.embeds[0].color, 0xed4245);
|
||||
assert.ok(payload.embeds[0].description.includes("five minutes"));
|
||||
assert.ok(!JSON.stringify(payload).includes("Join this party"));
|
||||
@@ -59,7 +59,7 @@ test("closed Discord parties turn red, lose their join prompt, and delete idempo
|
||||
await client.closeParty(
|
||||
channel,
|
||||
messageId,
|
||||
"https://minegeo.vercel.app",
|
||||
"https://minegeo.site",
|
||||
target,
|
||||
),
|
||||
true,
|
||||
@@ -73,7 +73,7 @@ test("closed Discord parties turn red, lose their join prompt, and delete idempo
|
||||
await missing.closeParty(
|
||||
channel,
|
||||
messageId,
|
||||
"https://minegeo.vercel.app",
|
||||
"https://minegeo.site",
|
||||
target,
|
||||
),
|
||||
false,
|
||||
@@ -94,7 +94,7 @@ test("closed Discord parties turn red, lose their join prompt, and delete idempo
|
||||
});
|
||||
test("Discord config requires a public HTTPS site and valid channel IDs without exposing a public token", () => {
|
||||
const env = {
|
||||
MINEGEO_URL: "https://minegeo.vercel.app",
|
||||
MINEGEO_URL: "https://minegeo.site",
|
||||
DISCORD_BOT_TOKEN: "test-token",
|
||||
DISCORD_PARTIES_CHANNEL_ID: channel,
|
||||
};
|
||||
@@ -123,20 +123,20 @@ test("Discord announcements use fixed public links, bounded escaped text, suppre
|
||||
const body = announcementMessage(
|
||||
job.id,
|
||||
"party",
|
||||
"https://minegeo.vercel.app",
|
||||
"https://minegeo.site",
|
||||
source,
|
||||
);
|
||||
assert.deepEqual(body.allowed_mentions, { parse: [] });
|
||||
assert.equal(
|
||||
body.embeds[0].url,
|
||||
`https://minegeo.vercel.app/multiplayer/${target}`,
|
||||
`https://minegeo.site/multiplayer/${target}`,
|
||||
);
|
||||
assert.ok(!body.embeds[0].title.includes("[click]("));
|
||||
assert.equal(body.nonce.length, 24);
|
||||
assert.equal(body.enforce_nonce, true);
|
||||
assert.equal(
|
||||
body.nonce,
|
||||
announcementMessage(job.id, "party", "https://minegeo.vercel.app", source)
|
||||
announcementMessage(job.id, "party", "https://minegeo.site", source)
|
||||
.nonce,
|
||||
);
|
||||
assert.notEqual(
|
||||
@@ -144,11 +144,11 @@ test("Discord announcements use fixed public links, bounded escaped text, suppre
|
||||
announcementMessage(
|
||||
"another",
|
||||
"party",
|
||||
"https://minegeo.vercel.app",
|
||||
"https://minegeo.site",
|
||||
source,
|
||||
).nonce,
|
||||
);
|
||||
const map = announcementMessage(job.id, "map", "https://minegeo.vercel.app", {
|
||||
const map = announcementMessage(job.id, "map", "https://minegeo.site", {
|
||||
...source,
|
||||
name: "A".repeat(500),
|
||||
locations: 10,
|
||||
@@ -160,7 +160,7 @@ test("Discord REST sends the bot token only to Discord, confirms message and cha
|
||||
const payload = announcementMessage(
|
||||
job.id,
|
||||
"party",
|
||||
"https://minegeo.vercel.app",
|
||||
"https://minegeo.site",
|
||||
source,
|
||||
);
|
||||
const client = new DiscordClient("private-token", async (url, init) => {
|
||||
@@ -221,7 +221,7 @@ test("durable delivery skips unavailable parties, records acknowledged sends and
|
||||
await deliverDiscordAnnouncement(
|
||||
{ ...job, attempts: options.attempts ?? 1 },
|
||||
{
|
||||
origin: "https://minegeo.vercel.app",
|
||||
origin: "https://minegeo.site",
|
||||
channel,
|
||||
now: () => 1000,
|
||||
load: async () => options.source,
|
||||
|
||||
@@ -105,11 +105,11 @@ test("scrape returns Prometheus text on success and fails closed during database
|
||||
|
||||
test("copyable YAML scopes bearer credentials to the HTTPS metrics target and disallows malformed setup", () => {
|
||||
const config = prometheusConfig(
|
||||
"https://minegeo.vercel.app/api/metrics",
|
||||
"https://minegeo.site/api/metrics",
|
||||
token,
|
||||
);
|
||||
assert.match(config, /metrics_path: "\/api\/metrics"/);
|
||||
assert.match(config, /targets: \["minegeo.vercel.app"\]/);
|
||||
assert.match(config, /targets: \["minegeo.site"\]/);
|
||||
assert.match(config, /follow_redirects: false/);
|
||||
assert.match(config, /type: Bearer/);
|
||||
assert.match(config, /scrape_interval: 60s/);
|
||||
|
||||
Reference in New Issue
Block a user