From fbba0efe682b331fe5074d3e70df25ff020e173f Mon Sep 17 00:00:00 2001
From: unimatrixgit <95320811+unimatrixgit@users.noreply.github.com>
Date: Mon, 2 Nov 2026 10:14:07 +0100
Subject: [PATCH] Publish appeal decision cards and prioritised Support Center
requests
---
website/PUBLIC-MODERATION-20261102.md | 12 +++++++
website/content/support-center-guide.md | 35 +++++++++++++++++++
.../osticket/SUPPORT-HOME-20261102.md | 15 ++++++++
.../integrations/osticket/authenticate.php | 2 +-
.../osticket/dune-support-home.css | 2 ++
.../osticket/dune-support-home.php | 33 +++++++++++++++++
.../osticket/support-home-test.php | 13 +++++++
.../integrations/osticket/support-index.php | 7 ++++
website/node/public-bans.mjs | 19 +++++++---
website/node/server.mjs | 3 +-
website/scripts/build-home-news.mjs | 2 +-
website/tests/header-badge-metadata.test.mjs | 11 ++++++
website/tests/homepage-source.test.mjs | 4 +--
website/tests/public-appeals.test.mjs | 19 ++++++++++
website/web/home-news.css | 4 +++
website/web/home-news.js | 3 ++
website/web/index.html | 2 +-
website/web/portal-navigation.css | 3 ++
website/web/portal-navigation.js | 2 +-
website/web/public-bans.css | 4 +++
website/web/public-bans.js | 2 +-
21 files changed, 184 insertions(+), 13 deletions(-)
create mode 100644 website/PUBLIC-MODERATION-20261102.md
create mode 100644 website/content/support-center-guide.md
create mode 100644 website/integrations/osticket/SUPPORT-HOME-20261102.md
create mode 100644 website/integrations/osticket/dune-support-home.css
create mode 100644 website/integrations/osticket/dune-support-home.php
create mode 100644 website/integrations/osticket/support-home-test.php
create mode 100644 website/integrations/osticket/support-index.php
create mode 100644 website/tests/header-badge-metadata.test.mjs
create mode 100644 website/tests/public-appeals.test.mjs
diff --git a/website/PUBLIC-MODERATION-20261102.md b/website/PUBLIC-MODERATION-20261102.md
new file mode 100644
index 00000000..32f1fad8
--- /dev/null
+++ b/website/PUBLIC-MODERATION-20261102.md
@@ -0,0 +1,12 @@
+# Public moderation display — 2 November 2026
+
+Owner explicitly requested immediate execution as an exception to the scheduled backlog.
+
+- Homepage: Latest bans contains 12 real public active records, excluding demo and unresolved legacy identities before the limit. Latest appeal decisions sits immediately below, six per page, approved/denied only, with original public ban fields and CSS imperial sand/gold decision seals.
+- Public ban list: 50/page, includes inactive records with appeals, separate actual Active/Unbanned state and latest appeal decision. Pending derives from an open native ticket; closing an undecided ticket does not fabricate approval, and a fresh appeal supersedes the previous public decision. Explicit approved/denied decisions survive native ticket closure.
+- Privacy: no requester IDs, evidence, private decision reasons, ticket contents or Minecraft UUID field added. Existing unresolved legacy/demo exclusions remain. Decision-card endpoint returned 38 publishable records over seven pages at verification; excluded records are not made public merely because a system appeal exists.
+- Shared navigation: Home and Support center UPDATE badges; native Support link spacing matches public header. A misplaced badge entry briefly broke navigation tuple rendering during implementation; corrected, then added a regression test. Actual fresh browser verified all 11 navigation images loaded and both badges rendered.
+
+Checks: four focused Node tests passed, including real SQLite query execution with pending/denied/approved, closed ticket, reopened appeal, pagination boundaries, private fields and demo/legacy filtering. Live HTTP verified 12 latest bans, six first-page decisions/two on last page and 50 public-list rows. Browser clicked Next and confirmed page 2 with six different cards. Desktop six columns/no horizontal overflow. Support desktop nav width matched public nav at 1029.6px in the same 1280px viewport; mobile 390px menu opened correctly, no overflow.
+
+Deployment: backed up native web entry and modules at `/root/public-appeals-before-20261102`, surgically changed only the relevant embedded assets and routes/modules, restarted only `dunerealms-web`. No world, inventory engine, payment or game ban mutation in this display change. Rollback uses the backed-up entry plus both modules together. Existing Alpha release tag is unchanged.
diff --git a/website/content/support-center-guide.md b/website/content/support-center-guide.md
new file mode 100644
index 00000000..c7fe1887
--- /dev/null
+++ b/website/content/support-center-guide.md
@@ -0,0 +1,35 @@
+# Your guide to the DuneRealms Support Center
+
+Every journey encounters a blocked passage. The DuneRealms Support Center gives you one place to ask for help, request a review and follow the response from the right team.
+
+Open the [Support Center](https://support.dunerealms.com/) and choose the card that matches your request. The page now puts parental and privacy requests first, followed by general support, ban appeals and Alpha tester applications.
+
+## Parents and guardians
+
+Use Parental requests for consent questions or help concerning a child's account. A separate link handles requests to remove a child's account data. These requests go to the Legal department for manual review. Submitting a form does not automatically establish guardianship, grant consent or change access.
+
+Provide the relevant account or Minecraft username and explain what you need. Do not attach passwords, government identity documents or unrelated personal information. Staff will explain any further verification through the private ticket.
+
+## Privacy and account-data removal
+
+The GDPR data removal card opens a dedicated Legal request. Identify the account concerned and describe the data or account action you are requesting. The team checks ownership and the scope of the request before taking action. This is a request for review, not an automatic deletion button or a promise that every historical record will be erased.
+
+## General support
+
+For account, website or game problems, choose General support. Include what you expected, what happened instead, where and when it happened, and what you already tried. Exact error messages and relevant screenshots make reports easier to reproduce. Some gameplay requests require a verified Minecraft link; the form will explain the applicable requirements.
+
+## Ban appeals
+
+Open Appeal a ban and enter the ban ID. The form links your appeal to the original moderation record so staff can review the correct case. Explain the situation and provide relevant evidence. An appeal is private; evidence and ticket conversations are not published on the public ban list.
+
+Submitting an appeal does not remove an active ban. The public register shows PENDING while an appeal awaits a decision, then APPROVED or DENIED when that decision is recorded. The ban's Active or Unbanned status is shown separately. Other bans on the same player can still apply. Closing a ticket alone is not an approval.
+
+## Help test the Alpha
+
+Want to help improve the realms? The Alpha tester card accepts applications from Java and Bedrock players. Tell us what you would like to test and how you can help. Support reviews applications manually; applying does not automatically grant a role or reward.
+
+## Follow your request
+
+Use your DuneRealms account and the ticket-status link to return to existing requests. Keep follow-up information in the same ticket so the team has the full context. Requests are available to the requester and authorised staff; public moderation cards show only the public ban information and appeal status.
+
+[Choose a support request](https://support.dunerealms.com/) · [View the public ban register](https://www.dunerealms.com/bans.html)
diff --git a/website/integrations/osticket/SUPPORT-HOME-20261102.md b/website/integrations/osticket/SUPPORT-HOME-20261102.md
new file mode 100644
index 00000000..176bdc0f
--- /dev/null
+++ b/website/integrations/osticket/SUPPORT-HOME-20261102.md
@@ -0,0 +1,15 @@
+# Support homepage deployment — 2 November 2026
+
+Install `support-index.php` as the native osTicket `index.php`, alongside `dune-support-home.php` and `dune-support-home.css`. Keep native session, header and footer handling. The template resolves only the public topic catalogue; absent topics produce no broken or private-topic links.
+
+The live catalogue now has `GDPR data removal request` (topic 19), public, routed to Legal (department 6). It was cloned from the existing parental-removal topic's routing/SLA configuration, with team assignment cleared and only the standard Ticket Details form (form 2) attached. The parental-only form was not copied. Topic notes require manual ownership/scope review and prohibit passwords/government-ID uploads at intake. No automatic data deletion or new staff permissions were implemented. New topic creation was transactional and name-guarded; existing topics were not edited.
+
+The account integration adds this exact topic name to the existing Minecraft-link exemption for legal/parental/appeal requests. Existing DuneRealms sign-in and staff permission checks remain in place. It does not grant anonymous access to private tickets or bypass staff controls.
+
+Cards are ordered: parental requests, GDPR removal, general support, ban appeal, Alpha signup. The parental card also links to the existing child-data-removal topic. Old welcome content and the sidebar are omitted by the new index; the legacy Alpha invitation injector is avoided by the new root ID, so there is one Alpha card rather than two. Existing database landing-page text is preserved, not deleted.
+
+Verification: PHP routing/template test passed, all changed PHP files linted, live homepage displayed five cards in order, old welcome absent, no duplicate Alpha invitation, desktop and 390px mobile without horizontal overflow. Actual GDPR form opened with its topic selected; no test request or deletion was submitted. Native Legal routing was checked directly. Support desktop menu now matches public-site spacing and hides the hamburger; mobile menu opens as a grid without overflow.
+
+Private rollback: `/root/support-cards-before-20261102` contains previous native index/authentication files and topic/form configuration snapshots. Restore only the changed files/configuration after checking for subsequent edits. Disable the new topic if rolling back; do not overwrite live tickets or restore entire topic tables blindly.
+
+Published guide source: `website/content/support-center-guide.md`; public post ID `80e13e9f-846c-4d79-856d-fe6d6f5b23ee`, source key `manual:support-center-guide-20261102`, category Community. This is a new owner-authorized post; no existing article was overwritten.
diff --git a/website/integrations/osticket/authenticate.php b/website/integrations/osticket/authenticate.php
index a1e95f3e..157f7159 100644
--- a/website/integrations/osticket/authenticate.php
+++ b/website/integrations/osticket/authenticate.php
@@ -60,7 +60,7 @@ class DuneAccountsPlugin extends Plugin {
}
if($file==='open.php'&&($_SERVER['REQUEST_METHOD']??'')==='POST'&&!$identity['linked']&&empty($identity['gameLinkExempt'])){
$topic=Topic::lookup((int)($_POST['topicId']??0));
- if(!$topic||!in_array($topic->getName(),['Ban appeal','Parental consent request [Preview]','Parental data removal [Preview]'],true)){dune_account_required('support');}
+ if(!$topic||!in_array($topic->getName(),['Ban appeal','Parental consent request [Preview]','Parental data removal [Preview]','GDPR data removal request'],true)){dune_account_required('support');}
}
}
}
diff --git a/website/integrations/osticket/dune-support-home.css b/website/integrations/osticket/dune-support-home.css
new file mode 100644
index 00000000..0955bb41
--- /dev/null
+++ b/website/integrations/osticket/dune-support-home.css
@@ -0,0 +1,2 @@
+body.dune-support #dune-support-home.dune-support-home{display:block!important;width:100%!important;padding:20px!important;box-sizing:border-box}
+.dune-support-options{display:grid;gap:20px}.dune-support-card{display:grid;grid-template-columns:180px minmax(0,1fr);gap:28px;align-items:center;padding:26px;border:1px solid #aa8d48;border-radius:16px;background:linear-gradient(120deg,#203f32,#11291f);box-shadow:0 5px 20px #0002;color:#ebe3cf;box-sizing:border-box}.dune-support-card img{width:180px;height:120px;object-fit:contain;border-radius:10px}.dune-support-card h2{margin:10px 0 16px!important;color:#e6cb85!important;font:700 26px/1.3 system-ui!important}.dune-support-card .eyebrow{font:600 10px/1.4 system-ui;letter-spacing:.13em;color:#d7c496}.dune-support-card p{line-height:1.6;margin:0 0 12px}.dune-support-card a.button{display:inline-flex;padding:11px 18px;border:1px solid #c4a456;border-radius:8px;background:#10291f;color:#e8cf8d;font:700 14px/1.4 system-ui;text-decoration:none;box-shadow:0 3px 8px #0003}.dune-support-card a:hover{filter:brightness(1.15)}.dune-support-card a:focus-visible{outline:3px solid #e5cb82;outline-offset:4px}.dune-secondary-request{display:inline-block;margin:10px 16px;color:#e1c680}.dune-support-track{padding:18px;color:#bdcdbc;line-height:1.6}.dune-support-track a{color:#e4c784}@media(max-width:650px){body.dune-support #dune-support-home.dune-support-home{padding:12px!important}.dune-support-card{grid-template-columns:1fr;padding:20px;gap:14px}.dune-support-card img{width:130px;height:90px}.dune-support-card h2{font-size:23px!important}.dune-secondary-request{margin:16px 0;display:block}}
diff --git a/website/integrations/osticket/dune-support-home.php b/website/integrations/osticket/dune-support-home.php
new file mode 100644
index 00000000..0bce7193
--- /dev/null
+++ b/website/integrations/osticket/dune-support-home.php
@@ -0,0 +1,33 @@
+ $label) if ($label === $name) return '/open.php?topicId='.(int)$id;
+ return null;
+};
+$cards = [
+ ['Parental requests','FOR PARENTS & GUARDIANS','Request parental consent or ask about a child’s account. The Legal team reviews requests manually; this form does not automatically grant consent or change an account.','Parental consent request [Preview]','Open parental request','seals/department-legal-v2-150.png'],
+ ['GDPR data removal','PRIVACY & ACCOUNT DATA','Ask the Legal team to review deletion of your account data. Identify the relevant account and explain your request. Ownership and scope are verified before any action. Do not upload passwords or identity documents.','GDPR data removal request','Request data removal','seals/department-legal-150.png'],
+ ['General support','ACCOUNT, WEBSITE & GAME HELP','Tell Support what went wrong, where it happened, when it happened and what you tried. Include the error message or a relevant screenshot without passwords or unrelated personal information.','General support','Get support','nav-support-full-v2.webp'],
+ ['Appeal a ban','REQUEST A MODERATION REVIEW','Use the ban ID to open a private appeal linked to the original ban. Explain the situation and attach relevant evidence. A pending appeal does not itself remove a ban.','Ban appeal','Open ban appeal','seals/department-ban-appeals-150.png'],
+ ['Become an Alpha tester','HELP SHAPE THE REALMS','Java or Bedrock, new or experienced: tell us what you would like to test. Applications are reviewed privately by Support.','Alpha Tester Signup','Sign up for Alpha testing','news-community.webp'],
+];
+$esc = static fn($v) => htmlspecialchars((string)$v, ENT_QUOTES, 'UTF-8');
+?>
+
+
Check an existing ticket → · Requests are private to the requester and authorised staff. Submitting a request does not automatically change an account.
+
diff --git a/website/integrations/osticket/support-home-test.php b/website/integrations/osticket/support-home-test.php
new file mode 100644
index 00000000..74369b98
--- /dev/null
+++ b/website/integrations/osticket/support-home-test.php
@@ -0,0 +1,13 @@
+'General support',2=>'Ban appeal',14=>'Parental consent request [Preview]',15=>'Parental data removal [Preview]',18=>'Alpha Tester Signup',19=>'GDPR data removal request'];
+ static function getPublicHelpTopics(){return self::$topics;}
+}
+function render(){ob_start();include __DIR__.'/dune-support-home.php';return ob_get_clean();}
+function check($v){if(!$v)throw new RuntimeException('Support home regression');}
+$html=render();check(substr_count($html,'class="dune-support-card"')===5);
+$previous=-1;foreach(['Parental requests','GDPR data removal','General support','Appeal a ban','Become an Alpha tester'] as $name){$at=strpos($html,'
'.$name.'
');check($at!==false&&$at>$previous);$previous=$at;}
+foreach(['/open.php?topicId=14','/open.php?topicId=15','/open.php?topicId=19','/open.php?topicId=1','/appeal.php','/alpha-signup.php','/view.php'] as $url)check(str_contains($html,'href="'.$url.'"'));
+check(!str_contains($html,'Welcome to the Support Center'));check(str_contains($html,'does not automatically'));
+unset(Topic::$topics[19]);$without=render();check(!str_contains($without,'Request data removal'));check(substr_count($without,'class="dune-support-card"')===4);
+echo "Support home public-topic routing, priority, missing-topic and content checks passed\n";
diff --git a/website/integrations/osticket/support-index.php b/website/integrations/osticket/support-index.php
new file mode 100644
index 00000000..34e5da8d
--- /dev/null
+++ b/website/integrations/osticket/support-index.php
@@ -0,0 +1,7 @@
+'yousmp-legacy' AND source_key NOT LIKE 'demo:%' ORDER BY first_seen DESC,id DESC LIMIT 12").all();
return Response.json({bans:results.map(({source_key,...ban})=>({...ban,demo:source_key.startsWith('demo:')}))},{headers:{'Cache-Control':'no-store'}});
}
+const appealProjection="(SELECT CASE WHEN a.status IN ('approved','denied','approving') THEN a.status WHEN s.state='open' THEN 'pending' ELSE 'closed' END FROM native_ban_appeals a LEFT JOIN drsupport_ticket t ON t.ticket_id=a.ticket_id LEFT JOIN drsupport_ticket_status s ON s.id=t.status_id WHERE a.ban_id=moderation_bans.id ORDER BY a.opened_at DESC,a.id DESC LIMIT 1) AS appeal_status";
+const publicRecord=b=>({id:b.id,player:b.player_name,issuedBy:/^(console|0)$/i.test(String(b.banned_by).trim())?'Network':b.banned_by,reason:b.reason,scope:b.scope==='network'?'Network':b.scope,issued:b.created_text,expires:b.expires_text,status:Number(b.active)===0?'Unbanned':'Active',appealStatus:['pending','approving'].includes(b.appeal_status)?'pending':['approved','denied'].includes(b.appeal_status)?b.appeal_status:null});
+export async function publicAppealCards(db,request){
+ const raw=Number(new URL(request.url).searchParams.get('page')||1),requested=Number.isSafeInteger(raw)&&raw>0?Math.min(raw,100000):1;
+ const where="scope<>'yousmp-legacy' AND source_key NOT LIKE 'demo:%' AND (SELECT a.status FROM native_ban_appeals a WHERE a.ban_id=moderation_bans.id ORDER BY a.opened_at DESC,a.id DESC LIMIT 1) IN ('approved','denied')";
+ const total=Number((await db.prepare('SELECT COUNT(*) AS total FROM moderation_bans WHERE '+where).first())?.total||0),pages=Math.max(1,Math.ceil(total/6)),page=Math.min(requested,pages);
+ const {results}=await db.prepare('SELECT id,player_name,banned_by,reason,scope,created_text,expires_text,active,'+appealProjection+' FROM moderation_bans WHERE '+where+' ORDER BY (SELECT MAX(a.decided_at) FROM native_ban_appeals a WHERE a.ban_id=moderation_bans.id) DESC,id DESC LIMIT 6 OFFSET '+((page-1)*6)).all();
+ return Response.json({bans:results.map(publicRecord),page,pages,total,pageSize:6},{headers:{'Cache-Control':'no-store'}});
+}
export async function publicBanList(db,request){
const url=new URL(request.url),raw=Number(url.searchParams.get('page')||1),q=(url.searchParams.get('q')||'').trim().slice(0,80);
const requested=Number.isSafeInteger(raw)&&raw>0?Math.min(raw,100000):1;
- const where="active=1 AND scope<>'yousmp-legacy' AND source_key NOT LIKE 'demo:%'"+(q?' AND (player_name LIKE ? OR reason LIKE ? OR scope LIKE ?)':'');
+ const where="(active=1 OR EXISTS (SELECT 1 FROM native_ban_appeals a WHERE a.ban_id=moderation_bans.id)) AND scope<>'yousmp-legacy' AND source_key NOT LIKE 'demo:%'"+(q?' AND (player_name LIKE ? OR reason LIKE ? OR scope LIKE ?)':'');
const values=q?Array(3).fill('%'+q+'%'):[];
const count=await db.prepare('SELECT COUNT(*) AS total FROM moderation_bans WHERE '+where).bind(...values).first();
const total=Number(count?.total||0),pages=Math.max(1,Math.ceil(total/50)),page=Math.min(requested,pages);
- const {results}=await db.prepare('SELECT id,player_name,banned_by,reason,scope,created_text,expires_text FROM moderation_bans WHERE '+where+' ORDER BY REPLACE(created_text,"T"," ") DESC,id DESC LIMIT 50 OFFSET '+((page-1)*50)).bind(...values).all();
- const bans=results.map(b=>({id:b.id,player:b.player_name,issuedBy:/^(console|0)$/i.test(String(b.banned_by).trim())?'Network':b.banned_by,reason:b.reason,scope:b.scope==='network'?'Network':b.scope,issued:b.created_text,expires:b.expires_text}));
+ const {results}=await db.prepare('SELECT id,player_name,banned_by,reason,scope,created_text,expires_text,active,'+appealProjection+' FROM moderation_bans WHERE '+where+' ORDER BY REPLACE(created_text,\'T\',\' \') DESC,id DESC LIMIT 50 OFFSET '+((page-1)*50)).bind(...values).all();
+ const bans=results.map(publicRecord);
return Response.json({bans,page,pages,total,pageSize:50},{headers:{'Cache-Control':'no-store'}});
}
diff --git a/website/node/server.mjs b/website/node/server.mjs
index 979ab3ed..5e0eb10f 100644
--- a/website/node/server.mjs
+++ b/website/node/server.mjs
@@ -22,7 +22,7 @@ import {createContact} from './contact.mjs';
import {createGameLink} from './game-link.mjs';
import {createCommunityRewards} from './community-rewards.mjs';
import {createPublicNews,initializeNews} from './news.mjs';
-import {publicBanCards,publicBanList} from './public-bans.mjs';
+import {publicBanCards,publicBanList,publicAppealCards} from './public-bans.mjs';
const root=new URL('./public/',import.meta.url);
const security={'X-Content-Type-Options':'nosniff','Referrer-Policy':'strict-origin-when-cross-origin','Content-Security-Policy':"default-src 'self'; frame-src 'self' https://cp.dunerealms.com; img-src 'self' data: https://www.dunerealms.com https://cp.dunerealms.com; style-src 'self' https://www.dunerealms.com https://fonts.googleapis.com; font-src 'self' https://fonts.gstatic.com; script-src 'self' https://www.dunerealms.com; connect-src 'self' https://cp.dunerealms.com https://www.dunerealms.com; base-uri 'self'; object-src 'none'; frame-ancestors 'self'"};
export function createApplication(db,settings={}) {
@@ -46,6 +46,7 @@ export function createApplication(db,settings={}) {
if(url.pathname.startsWith('/api/community/'))return rewards(request);
if(url.pathname==='/api/game-link'||url.pathname.startsWith('/api/game-link/'))return gameLink(request);
if(url.pathname.startsWith('/api/contact/'))return contact(request);
+ if(url.pathname==='/api/public/appeals'&&request.method==='GET')return publicAppealCards(db,request);
if(url.pathname==='/api/public/ban-list'&&request.method==='GET')return publicBanList(db,request);
if(url.pathname==='/api/public/bans'&&request.method==='GET')return publicBanCards(db);
if(url.pathname==='/api/worlds')return request.method==='GET'?worldStatus().then(r=>{const h=new Headers(r.headers);h.set('Access-Control-Allow-Origin','*');return new Response(r.body,{status:r.status,headers:h});}):new Response('Method not allowed',{status:405});
diff --git a/website/scripts/build-home-news.mjs b/website/scripts/build-home-news.mjs
index 13835f84..8daeda51 100644
--- a/website/scripts/build-home-news.mjs
+++ b/website/scripts/build-home-news.mjs
@@ -4,7 +4,7 @@ const hero=html.match(//)?.[0],menu=html
if(!hero)throw Error('The original 01 / Get the plugin hero must be preserved');
function module(title,id,kind,archive=false){return '
';}
function assets(s){if(!s.includes('href="home-news.css"'))s=s.replace('','');return s;}
-html=assets(html).replace('','').replace(/[\s\S]*?<\/main>/,''+module('News from the realms','home-news','news')+hero+module('Latest forum posts','home-forum','forum')+menu+'
Latest bans & appeals
PUBLIC MODERATION REGISTER · LATEST 9
Loading moderation records…
');
+html=assets(html).replace('','').replace(/[\s\S]*?<\/main>/,''+module('News from the realms','home-news','news')+hero+module('Latest forum posts','home-forum','forum')+menu+'