Skip to content
This repository was archived by the owner on Jul 8, 2026. It is now read-only.

Commit 5d5d12c

Browse files
author
Drrakendu78
committed
feat(migration): build d'adieu StarTrad 4.4.0 -> bascule vers Stelliverse
StarTrad a ete reecrit et rebaptise Stelliverse (depot GitLab). Cette version finale migre les utilisateurs vers Stelliverse. - MigrationGate : popup BLOQUANT "StarTrad devient Stelliverse" + bouton qui telecharge/installe la derniere Stelliverse depuis GitLab. Variante Microsoft Store sobre, sans bouton (regles du Store). - migration.ts : derniere release via l'API GitLab Stelliverse, puis lance l'updater (reutilise le flow admin/install-differee existant). - launch_updater : allowlist elargie aux releases GitLab Stelliverse. - updater : embarque la cle publique STELLIVERSE (verifie les releases Stelliverse malgre les cles differentes), relance Stelliverse, puis AUTO-DESINSTALLE StarTrad (PowerShell detache + uninstaller NSIS /S). - CSP : + gitlab.com. Version 4.3.6 -> 4.4.0. Compte + sauvegardes deja partages (meme Supabase) -> reconnexion dans Stelliverse et tout est la.
1 parent b2dafe3 commit 5d5d12c

9 files changed

Lines changed: 427 additions & 14 deletions

File tree

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"name": "startradfr",
33
"private": true,
4-
"version": "4.3.6",
4+
"version": "4.4.0",
55
"type": "module",
66
"proxy": "https://multitool.onivoid.fr",
77
"scripts": {

src-tauri/Cargo.lock

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src-tauri/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[package]
22
name = "startradfr"
3-
version = "4.3.6"
3+
version = "4.4.0"
44
description = "StarTrad FR - Traduction française pour Star Citizen"
55
authors = ["Drrakendu78"]
66
edition = "2021"

src-tauri/src/scripts/updater_functions.rs

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,15 @@
11
use tauri::{command, AppHandle};
22

3-
const ALLOWED_URL_PREFIX: &str = "https://github.com/drrakendu78/TradSC/releases/";
3+
// Sources autorisees : releases GitHub StarTrad (historique) + releases GitLab
4+
// Stelliverse (migration : la build finale telecharge Stelliverse depuis GitLab).
5+
const ALLOWED_URL_PREFIXES: &[&str] = &[
6+
"https://github.com/drrakendu78/TradSC/releases/",
7+
"https://gitlab.com/drrakendu78/Stelliverse/-/releases/",
8+
];
9+
10+
fn url_allowed(u: &str) -> bool {
11+
ALLOWED_URL_PREFIXES.iter().any(|p| u.starts_with(p))
12+
}
413

514
/// Lance l'updater standalone et ferme l'application principale.
615
/// L'updater gere le telechargement, la verification de signature, l'installation et le relancement.
@@ -11,7 +20,7 @@ pub async fn launch_updater(
1120
name: String,
1221
app_handle: AppHandle,
1322
) -> Result<(), String> {
14-
if !url.starts_with(ALLOWED_URL_PREFIX) || !sig_url.starts_with(ALLOWED_URL_PREFIX) {
23+
if !url_allowed(&url) || !url_allowed(&sig_url) {
1524
return Err("URL de mise à jour non autorisée.".to_string());
1625
}
1726
// Trouver l'updater.exe a cote de l'exe principal

src-tauri/tauri.conf.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"$schema": "https://schema.tauri.app/config/2",
33
"productName": "StarTrad FR",
4-
"version": "4.3.6",
4+
"version": "4.4.0",
55
"identifier": "com.drrakendu78.startradfr",
66
"build": {
77
"beforeDevCommand": "npm run dev",
@@ -22,7 +22,7 @@
2222
}
2323
],
2424
"security": {
25-
"csp": "default-src \u0027self\u0027 https://startradfr.vercel.app; script-src \u0027self\u0027 https://startradfr.vercel.app https://www.youtube.com \u0027unsafe-inline\u0027; style-src \u0027self\u0027 https://startradfr.vercel.app \u0027unsafe-inline\u0027; img-src \u0027self\u0027 data: https:; font-src \u0027self\u0027 data: https:; connect-src \u0027self\u0027 https://startradfr.vercel.app https://api.github.com https://api.allorigins.win https://leonick.se https://www.star-citizen-characters.com https://*.supabase.co https://supabase.co https://cdn.discordapp.com https://www.youtube.com https://contestedzonetimers.com; frame-src \u0027self\u0027 https://www.erkul.games https://maps.adi.sc https://www.youtube.com https://finder.cstone.space https://survey.cstone.space https://www.spviewer.eu https://ratjack.net https://www.sccrafter.com https://verseguide.com https://scmdb.net https://uexcorp.space https://schaulers.space https://sc-cargo.space https://mining.getallsky.net https://www.protixit.com https://scdb.space https://sc-craft.tools https://hauler.thespacecoder.space https://sc-trade-routes.streamerforge.com;"
25+
"csp": "default-src \u0027self\u0027 https://startradfr.vercel.app; script-src \u0027self\u0027 https://startradfr.vercel.app https://www.youtube.com \u0027unsafe-inline\u0027; style-src \u0027self\u0027 https://startradfr.vercel.app \u0027unsafe-inline\u0027; img-src \u0027self\u0027 data: https:; font-src \u0027self\u0027 data: https:; connect-src \u0027self\u0027 https://startradfr.vercel.app https://api.github.com https://gitlab.com https://api.allorigins.win https://leonick.se https://www.star-citizen-characters.com https://*.supabase.co https://supabase.co https://cdn.discordapp.com https://www.youtube.com https://contestedzonetimers.com; frame-src \u0027self\u0027 https://www.erkul.games https://maps.adi.sc https://www.youtube.com https://finder.cstone.space https://survey.cstone.space https://www.spviewer.eu https://ratjack.net https://www.sccrafter.com https://verseguide.com https://scmdb.net https://uexcorp.space https://schaulers.space https://sc-cargo.space https://mining.getallsky.net https://www.protixit.com https://scdb.space https://sc-craft.tools https://hauler.thespacecoder.space https://sc-trade-routes.streamerforge.com;"
2626
}
2727
},
2828
"bundle": {
Lines changed: 222 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,222 @@
1+
import { useEffect, useState } from "react";
2+
import { createPortal } from "react-dom";
3+
import { getBuildInfo } from "@/utils/buildInfo";
4+
import openExternal from "@/utils/external";
5+
import {
6+
migrateToStelliverse,
7+
STELLIVERSE_GITLAB_URL,
8+
STELLIVERSE_RELEASES_URL,
9+
} from "@/utils/migration";
10+
11+
// ─────────────────────────────────────────────────────────────────────────────
12+
// MigrationGate — overlay d'adieu de StarTrad. L'app a été réécrite et rebaptisée
13+
// « Stelliverse ». Cette build finale verrouille l'app derrière un popup BLOQUANT
14+
// (non fermable, façon BanGate) avec un bouton qui télécharge + installe la
15+
// dernière Stelliverse depuis GitLab.
16+
//
17+
// Exception Microsoft Store : on ne peut pas pousser d'install externe (règles du
18+
// Store) → variante sobre, SANS bouton de téléchargement, qui explique et renvoie
19+
// vers le lien. Elle reste fermable (l'app Store doit rester utilisable).
20+
// ─────────────────────────────────────────────────────────────────────────────
21+
22+
const FONTS_HREF =
23+
"https://fonts.googleapis.com/css2?family=Oswald:wght@300;400;500;600;700&family=Rajdhani:wght@400;500;600;700&family=Geist+Mono:wght@400;500&display=swap";
24+
25+
const CSS = `
26+
.mig-gate{position:fixed;inset:0;z-index:2147483647;display:flex;align-items:center;justify-content:center;padding:24px;
27+
background:rgba(5,8,15,.93);backdrop-filter:blur(4px);font-family:'Rajdhani',sans-serif;color:#eaf2ff;user-select:none}
28+
.mig-card{position:relative;width:480px;max-width:100%;overflow:hidden;border-radius:18px;
29+
background:linear-gradient(180deg,rgba(16,23,37,.98),rgba(8,13,22,.98));
30+
border:1px solid rgba(132,176,224,.32);box-shadow:0 30px 80px rgba(2,6,14,.7)}
31+
.mig-card::before{content:"";position:absolute;left:0;right:0;top:0;height:2px;background:linear-gradient(90deg,transparent,#54e6ff,transparent);opacity:.8}
32+
.mig-inner{padding:30px 30px 26px;text-align:center}
33+
.mig-eyebrow{font-family:'Geist Mono',monospace;font-size:9px;letter-spacing:.28em;text-transform:uppercase;color:#54e6ff}
34+
.mig-rename{display:flex;align-items:center;justify-content:center;gap:14px;margin:16px 0 6px;flex-wrap:wrap}
35+
.mig-old{font-family:'Oswald',sans-serif;font-weight:500;font-size:21px;color:#5d6f88;text-decoration:line-through;text-decoration-color:rgba(255,122,122,.55);text-decoration-thickness:2px}
36+
.mig-arr{color:#5d6f88;font-size:18px}
37+
.mig-new{font-family:'Oswald',sans-serif;font-weight:700;font-size:34px;color:#fff;line-height:1}
38+
.mig-new b{color:#54e6ff}
39+
.mig-h1{font-family:'Oswald',sans-serif;font-weight:300;font-size:25px;color:#fff;margin-top:14px}
40+
.mig-h1 b{font-weight:600}
41+
.mig-body{margin-top:12px;font-size:14.5px;line-height:1.6;color:#9fb2cc}
42+
.mig-body b{color:#eaf2ff;font-weight:600}
43+
.mig-body .mig-hl{color:#54e6ff;font-weight:600}
44+
.mig-assure{margin-top:16px;display:flex;align-items:flex-start;gap:10px;text-align:left;
45+
background:rgba(84,230,255,.05);border:1px solid rgba(84,230,255,.18);border-radius:12px;padding:12px 14px}
46+
.mig-assure svg{flex:none;width:18px;height:18px;stroke:#54e6ff;stroke-width:1.8;fill:none;margin-top:1px}
47+
.mig-assure .mig-t{font-size:13px;line-height:1.5;color:#9fb2cc}
48+
.mig-assure .mig-t b{color:#fff;font-weight:600}
49+
.mig-btn{margin-top:22px;width:100%;display:inline-flex;align-items:center;justify-content:center;gap:10px;cursor:pointer;
50+
font-family:'Oswald',sans-serif;font-weight:600;font-size:16px;letter-spacing:.04em;text-transform:uppercase;
51+
color:#04121a;background:linear-gradient(180deg,#5ce0ff,#21bdec);border:none;border-radius:12px;padding:15px 20px;transition:.15s}
52+
.mig-btn:hover{filter:brightness(1.06)}
53+
.mig-btn:disabled{opacity:.7;cursor:default}
54+
.mig-btn svg{width:18px;height:18px;stroke:#04121a;stroke-width:2.2;fill:none;stroke-linecap:round;stroke-linejoin:round}
55+
.mig-foot{margin-top:13px;font-family:'Geist Mono',monospace;font-size:9px;letter-spacing:.07em;color:#5d6f88}
56+
.mig-brand{margin-top:20px;padding-top:16px;border-top:1px solid rgba(132,176,224,.16);font-family:'Geist Mono',monospace;font-size:8.5px;letter-spacing:.1em;text-transform:uppercase;color:#5d6f88}
57+
.mig-link{color:#54e6ff;cursor:pointer;text-decoration:underline;text-underline-offset:3px}
58+
/* variante Store (sobre) */
59+
.mig-card.mig-store{width:430px;border-color:rgba(132,176,224,.22)}
60+
.mig-card.mig-store::before{background:linear-gradient(90deg,transparent,#5d6f88,transparent);opacity:.5}
61+
.mig-store .mig-new b{color:#9fb2cc}
62+
.mig-store-close{margin-top:20px;font-family:'Geist Mono',monospace;font-size:10px;letter-spacing:.1em;text-transform:uppercase;
63+
color:#9fb2cc;cursor:pointer;background:none;border:1px solid rgba(132,176,224,.3);border-radius:9px;padding:9px 18px;transition:.15s}
64+
.mig-store-close:hover{color:#fff;border-color:#9fb2cc}
65+
`;
66+
67+
function injectAssets() {
68+
if (typeof document === "undefined") return;
69+
if (!document.getElementById("mig-fonts")) {
70+
const link = document.createElement("link");
71+
link.id = "mig-fonts";
72+
link.rel = "stylesheet";
73+
link.href = FONTS_HREF;
74+
document.head.appendChild(link);
75+
}
76+
if (!document.getElementById("mig-style")) {
77+
const style = document.createElement("style");
78+
style.id = "mig-style";
79+
style.textContent = CSS;
80+
document.head.appendChild(style);
81+
}
82+
}
83+
84+
export function MigrationGate() {
85+
const [isStore, setIsStore] = useState<boolean | null>(null);
86+
const [storeDismissed, setStoreDismissed] = useState(false);
87+
const [migrating, setMigrating] = useState(false);
88+
89+
useEffect(() => {
90+
injectAssets();
91+
let cancelled = false;
92+
getBuildInfo()
93+
.then((info) => {
94+
if (!cancelled) setIsStore(info.distribution === "microsoft-store");
95+
})
96+
.catch(() => {
97+
if (!cancelled) setIsStore(false);
98+
});
99+
return () => {
100+
cancelled = true;
101+
};
102+
}, []);
103+
104+
// Tant qu'on ne sait pas (build info en cours), on n'affiche rien.
105+
if (isStore === null) return null;
106+
107+
const onMigrate = async () => {
108+
setMigrating(true);
109+
try {
110+
await migrateToStelliverse();
111+
} finally {
112+
// si on est toujours là (échec / fallback navigateur), on réactive le bouton
113+
setMigrating(false);
114+
}
115+
};
116+
117+
// ── Variante Microsoft Store : sobre, sans bouton de téléchargement, fermable ──
118+
if (isStore) {
119+
if (storeDismissed) return null;
120+
return createPortal(
121+
<div className="mig-gate" onContextMenu={(e) => e.preventDefault()}>
122+
<div className="mig-card mig-store">
123+
<div className="mig-inner">
124+
<div className="mig-eyebrow">Changement de nom</div>
125+
<div className="mig-rename">
126+
<span className="mig-old">StarTrad FR</span>
127+
<span className="mig-arr"></span>
128+
<span className="mig-new">
129+
Stelli<b>verse</b>
130+
</span>
131+
</div>
132+
<h1 className="mig-h1">
133+
StarTrad devient <b>Stelliverse</b>
134+
</h1>
135+
<div className="mig-body">
136+
L'app a été réécrite et rebaptisée <span className="mig-hl">Stelliverse</span>.
137+
La version Microsoft Store ne peut pas l'installer à ta place — tu la
138+
retrouveras en cherchant{" "}
139+
<b>« Stelliverse »</b> dans le Microsoft Store, ou ici :
140+
<br />
141+
<span
142+
className="mig-link"
143+
onClick={() => openExternal(STELLIVERSE_GITLAB_URL)}
144+
>
145+
gitlab.com/drrakendu78/Stelliverse
146+
</span>
147+
</div>
148+
<button className="mig-store-close" onClick={() => setStoreDismissed(true)}>
149+
J'ai compris
150+
</button>
151+
<div className="mig-brand">Stelliverse · par Djamel Lazreg</div>
152+
</div>
153+
</div>
154+
</div>,
155+
document.body
156+
);
157+
}
158+
159+
// ── Variante normale : popup BLOQUANT (non fermable) + bouton de migration ──
160+
return createPortal(
161+
<div className="mig-gate" onContextMenu={(e) => e.preventDefault()}>
162+
<div className="mig-card">
163+
<div className="mig-inner">
164+
<div className="mig-eyebrow">Changement de nom</div>
165+
<div className="mig-rename">
166+
<span className="mig-old">StarTrad FR</span>
167+
<span className="mig-arr"></span>
168+
<span className="mig-new">
169+
Stelli<b>verse</b>
170+
</span>
171+
</div>
172+
<h1 className="mig-h1">
173+
StarTrad devient <b>Stelliverse</b>
174+
</h1>
175+
<div className="mig-body">
176+
L'app a été <b>entièrement réécrite et modernisée</b>, puis rebaptisée{" "}
177+
<span className="mig-hl">Stelliverse</span>. Cette version est la{" "}
178+
<b>toute dernière de StarTrad</b> — la suite se passe sur Stelliverse.
179+
</div>
180+
<div className="mig-assure">
181+
<svg viewBox="0 0 24 24">
182+
<path d="M9 12l2 2 4-4" />
183+
<path d="M21 12a9 9 0 1 1-18 0 9 9 0 0 1 18 0z" />
184+
</svg>
185+
<div className="mig-t">
186+
<b>Rien n'est perdu.</b> Ton compte et tes sauvegardes sont conservés : tu
187+
te reconnectes avec le même Discord et tout est là.
188+
</div>
189+
</div>
190+
<button className="mig-btn" onClick={onMigrate} disabled={migrating}>
191+
{migrating ? (
192+
"Téléchargement…"
193+
) : (
194+
<>
195+
<svg viewBox="0 0 24 24">
196+
<path d="M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4" />
197+
<path d="M7 10l5 5 5-5" />
198+
<path d="M12 15V3" />
199+
</svg>
200+
Télécharger Stelliverse
201+
</>
202+
)}
203+
</button>
204+
<div className="mig-foot">
205+
Téléchargement &amp; installation automatiques · puis Stelliverse se lance
206+
</div>
207+
<div className="mig-brand">
208+
<span
209+
className="mig-link"
210+
onClick={() => openExternal(STELLIVERSE_RELEASES_URL)}
211+
>
212+
Ou télécharger manuellement
213+
</span>
214+
</div>
215+
</div>
216+
</div>
217+
</div>,
218+
document.body
219+
);
220+
}
221+
222+
export default MigrationGate;

src/main.tsx

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ import { ThemeProvider } from "@/components/utils/theme-provider";
88
import { BorderBeam } from "@/components/magicui/border-beam";
99
import { SecurityWarning } from "@/components/custom/SecurityWarning";
1010
import { BanGate } from "@/components/custom/BanGate";
11+
import { MigrationGate } from "@/components/custom/MigrationGate";
1112
import AdminElevateButton from "@/components/custom/AdminElevateButton";
1213
import { ErrorBoundary } from "@/components/custom/ErrorBoundary";
1314
import { SplashScreen } from "@/components/custom/SplashScreen";
@@ -171,6 +172,9 @@ function App() {
171172
{/* Garde de ban : overlay plein écran si le compte connecté est banni
172173
(check au boot + Realtime). Self-gating : null si pas banni. */}
173174
{!isOverlay && <BanGate />}
175+
{/* Build d'adieu : migration StarTrad → Stelliverse. Popup bloquant
176+
(ou variante Store sobre). Toujours affiché dans cette version finale. */}
177+
{!isOverlay && <MigrationGate />}
174178
{/* On masque les widgets fixed (admin button, BorderBeam) quand le
175179
wizard est actif : ils s'affichent par-dessus et bloquent les
176180
clics sur le footer du wizard ("Suivant"). */}

0 commit comments

Comments
 (0)