Compare commits

..
160 changed files with 115 additions and 3818 deletions

View file

@ -44,11 +44,3 @@ test('publication comparison, artifact upload and deployment require canonical m
if (name !== 'Trigger deployment after successful CI') assert.doesNotMatch(body, /DUNEREALMS_DEPLOY_KEY|ssh .*dunedeploy@/);
}
});
test('deployment uses the verified dedicated host and its pinned SSH key', () => {
const deploy = step('Trigger deployment after successful CI');
assert.ok(deploy.includes('95.216.100.187 ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAICdHgR/5lVFKbOpAYR2+/Bi5LSg+8nDCSm77mJOmJKRg'));
assert.ok(deploy.includes('dunedeploy@95.216.100.187'));
assert.ok(!deploy.includes('91.107.196.242'));
});

View file

@ -87,7 +87,7 @@ jobs:
printf '%s\n' "$DEPLOY_KEY" > ~/.ssh/deploy_key
chmod 600 ~/.ssh/deploy_key
trap 'rm -f ~/.ssh/deploy_key' EXIT
printf '%s\n' '95.216.100.187 ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAICdHgR/5lVFKbOpAYR2+/Bi5LSg+8nDCSm77mJOmJKRg' >> ~/.ssh/known_hosts
ssh -p 22 -i ~/.ssh/deploy_key -o IdentitiesOnly=yes -o BatchMode=yes -o StrictHostKeyChecking=yes dunedeploy@95.216.100.187 "$GITHUB_SHA"
printf '%s\n' '91.107.196.242 ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIC8x/XocsIz41fWHGty0DbZhSvafSQFt9jaHHgzdr55W root@ubuntu-4gb-fsn1-1' >> ~/.ssh/known_hosts
ssh -p 22 -i ~/.ssh/deploy_key -o IdentitiesOnly=yes -o BatchMode=yes -o StrictHostKeyChecking=yes dunedeploy@91.107.196.242 "$GITHUB_SHA"
rm -f ~/.ssh/deploy_key

View file

@ -18,6 +18,3 @@ EXCHANGE_READ_TOKEN=
# Optional private read-only PostgreSQL role for CP inventory/sales.
# Never use the game writer role or publish this URL to browser code.
DUNE_INVENTORY_DATABASE_URL=
# Enable only after the paired native Guild travel release is installed.
GUILD_OPEN_TRAVEL=false

View file

@ -1 +1 @@
export function clanCPDocument(source){return source.replace('<title>DuneRealms · Account Centre</title>','<title>DuneRealms · Clan CP</title>').replace(/<header class="dune-site-header"[^>]*>[\s\S]*?<\/header>/,'').replace(/<footer class="site-footer"><\/footer>/,'').replace(/<script src="https:\/\/www\.dunerealms\.com\/portal-navigation\.js" defer><\/script>/,'').replace(/<link rel="stylesheet" href="https:\/\/www\.dunerealms\.com\/portal-navigation\.css">/,'').replace(/<body\b[^>]*>/,'<body data-cp-mode="clan" class="clan-cp-shell">').replace(/<section class="command-banner">[\s\S]*?<\/section>/,'').replace('</head>','<link rel="stylesheet" href="/v2/cp-v2-clan-shell.css?v=single-scroll-3"><link rel="stylesheet" href="/v2/cp-v2-claims.css"></head>').replace('</body>','<script type="module" src="/v2/cp-v2-clan-size.mjs"></script></body>');}
export function clanCPDocument(source){return source.replace('<title>DuneRealms · Account Centre</title>','<title>DuneRealms · Clan CP</title>').replace(/<header class="dune-site-header"[^>]*>[\s\S]*?<\/header>/,'').replace(/<footer class="site-footer"><\/footer>/,'').replace(/<script src="https:\/\/www\.dunerealms\.com\/portal-navigation\.js" defer><\/script>/,'').replace(/<link rel="stylesheet" href="https:\/\/www\.dunerealms\.com\/portal-navigation\.css">/,'').replace(/<body\b[^>]*>/,'<body data-cp-mode="clan" class="clan-cp-shell">').replace(/<section class="command-banner">[\s\S]*?<\/section>/,'').replace('</head>','<link rel="stylesheet" href="/v2/cp-v2-clan-shell.css?v=single-scroll-2"><link rel="stylesheet" href="/v2/cp-v2-claims.css"></head>').replace('</body>','<script type="module" src="/v2/cp-v2-clan-size.mjs"></script></body>');}

View file

@ -1,5 +1,5 @@
import {isClandestineInstitution} from '../node/clandestine-identity.mjs';
import {membershipRequest,membershipReview,MembershipError,clanAcceptanceStatements} from '../node/membership-recruitment.mjs';
import {membershipRequest,membershipReview,MembershipError} from '../node/membership-recruitment.mjs';
import {JarvisError} from '../node/jarvis-listings.mjs';
import {JARVIS_CLAN_REQUEST_SCHEMA} from '../node/jarvis-clan-requests.mjs';
import {clanRecruitmentQuote} from '../node/jarvis-recruitment-policy.mjs';
@ -104,7 +104,9 @@ export function createClans(db,{origin='https://cp.dunerealms.com',authenticate=
if(role==='owner')return json({message:'Transfer ownership or archive the clan before leaving.'},409);
await db.batch([lock(),checked(db.prepare('DELETE FROM site_clan_members WHERE clan_id=? AND user_id=?').bind(record.id,user.id)),audit(record.id,{})]);
}else if(action==='review'){
await db.batch(await membershipReview({db,kind:'clan',user,record,body,now,canReview:['owner','officer'].includes(role)||deedRights.canManage,lock,audit:details=>audit(record.id,details),integration:requestIntegration,access,accept:async({target,link})=>clanAcceptanceStatements({db,record,target,link,now})}));await requestIntegration?.afterReview?.().catch(()=>console.error('Recruitment completion pending reconciliation'));
await db.batch(await membershipReview({db,kind:'clan',user,record,body,now,canReview:['owner','officer'].includes(role)||deedRights.canManage,lock,audit:details=>audit(record.id,details),integration:requestIntegration,access,accept:async({target,link})=>{
return [{async run(connection){const sql="SELECT c.active,COALESCE(ch.charter_kind,'basic') charter_kind,(SELECT COUNT(*) FROM site_clan_members m WHERE m.clan_id=c.id) member_count FROM site_clans c LEFT JOIN site_clan_charters ch ON ch.clan_id=c.id WHERE c.id=?";const current=connection?(await connection.execute(sql,[record.id]))[0][0]:await db.prepare(sql).bind(record.id).first();if(!current||!current.active)throw new Conflict('The clan is unavailable.');const limit=clanMemberLimit(current.charter_kind);if(Number(current.member_count)>=limit)throw new Conflict(`This clan has at most ${limit} members, including the owner. An outside Consort remains a member of their own clan.`);return {success:true,meta:{changes:0}};}} ,db.prepare("INSERT INTO site_clan_members(user_id,minecraft_uuid,clan_id,clan_role,joined_at) VALUES(?,?,?,'member',?)").bind(target.user_id,link.minecraft_uuid,record.id,now),db.prepare("UPDATE site_clan_requests SET status='withdrawn',updated_at=? WHERE user_id=? AND status='pending' AND clan_id<>?").bind(now,target.user_id,record.id)];
}}));await requestIntegration?.afterReview?.().catch(()=>console.error('Recruitment completion pending reconciliation'));
}else{
if(!deedRights.canManage)return json({message:'Only this clan’s owner can perform that action.'},403);
if(action==='motd'){

Binary file not shown.

Before

Width:  |  Height:  |  Size: 183 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 592 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 184 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 675 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 181 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 549 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 184 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 574 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 185 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 658 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 183 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 796 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 182 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 551 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 187 KiB

Some files were not shown because too many files have changed in this diff Show more