Establish secure account and managed AI backend

Provide the production foundation for Apple identity, immutable credits, referrals, integrity checks, managed providers, and hardened Docker deployment.
This commit is contained in:
Rocky
2026-08-16 14:46:23 +08:00
commit 0af35d44f4
124 changed files with 21052 additions and 0 deletions
@@ -0,0 +1,17 @@
{
"applinks": {
"details": [
{
"appIDs": [
"{{APPLE_APP_ID}}"
],
"components": [
{
"/": "/i/*",
"comment": "Open first-party OSG invitation links in the app"
}
]
}
]
}
}
+184
View File
@@ -0,0 +1,184 @@
<!doctype html>
<html lang="zh-CN">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<meta name="robots" content="noindex,nofollow,noarchive">
<meta name="color-scheme" content="light dark">
<title>OSG 邀请 / Invitation</title>
<style nonce="{{CSP_NONCE}}">
:root {
color-scheme: light dark;
font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
background: #f5f5f7;
color: #1d1d1f;
}
* { box-sizing: border-box; }
body {
min-height: 100vh;
margin: 0;
display: grid;
place-items: center;
padding: max(20px, env(safe-area-inset-top)) max(20px, env(safe-area-inset-right))
max(20px, env(safe-area-inset-bottom)) max(20px, env(safe-area-inset-left));
}
main {
width: min(100%, 460px);
padding: clamp(24px, 7vw, 40px);
border: 1px solid #dedee3;
border-radius: 24px;
background: #fff;
text-align: center;
box-shadow: 0 16px 48px rgb(0 0 0 / 8%);
}
.language-switcher {
display: flex;
justify-content: flex-end;
gap: 6px;
margin: -8px -8px 20px 0;
}
.language-button {
min-height: 36px;
padding: 7px 11px;
border: 1px solid #d2d2d7;
border-radius: 999px;
background: transparent;
color: inherit;
font: inherit;
font-size: .82rem;
cursor: pointer;
}
.language-button[aria-pressed="true"] {
border-color: #1d1d1f;
background: #1d1d1f;
color: #fff;
}
h1 { margin: 0 0 12px; font-size: clamp(1.65rem, 7vw, 2.25rem); line-height: 1.15; }
p { margin: 10px 0; color: #6e6e73; line-height: 1.55; }
code {
display: block;
margin: 24px 0;
padding: 17px 10px;
overflow-wrap: anywhere;
border: 1px solid #e5e5ea;
border-radius: 14px;
background: #f5f5f7;
color: #1d1d1f;
font-family: ui-monospace, "SFMono-Regular", Menlo, monospace;
font-size: clamp(1rem, 4.8vw, 1.35rem);
letter-spacing: .05em;
user-select: all;
}
.actions { display: grid; gap: 12px; }
.action {
display: grid;
min-height: 50px;
place-items: center;
padding: 13px 18px;
border: 1px solid transparent;
border-radius: 14px;
font: inherit;
font-weight: 650;
cursor: pointer;
text-decoration: none;
}
.primary { background: #0071e3; color: #fff; }
.secondary { border-color: #d2d2d7; background: #fff; color: #1d1d1f; }
.store-link { background: #1d1d1f; color: #fff; }
.action:focus-visible, .language-button:focus-visible {
outline: 3px solid #69aaf5;
outline-offset: 3px;
}
.hint { margin-top: 22px; font-size: .88rem; }
#copy-status { min-height: 1.4em; margin-bottom: 0; font-size: .9rem; }
[data-language] { display: none; }
html[lang="zh-CN"] [data-language="zh-CN"],
html[lang="en"] [data-language="en"] { display: inline; }
@media (prefers-color-scheme: dark) {
:root { background: #101214; color: #f4f5f7; }
main { border-color: #30343a; background: #1a1d21; box-shadow: none; }
p { color: #b5bbc4; }
code { border-color: #3a3f46; background: #282c32; color: #f4f5f7; }
.language-button { border-color: #555b64; }
.language-button[aria-pressed="true"] { border-color: #f4f5f7; background: #f4f5f7; color: #17191c; }
.secondary { border-color: #555b64; background: #282c32; color: #f4f5f7; }
.store-link { background: #f4f5f7; color: #17191c; }
}
@media (prefers-reduced-motion: reduce) {
*, *::before, *::after { scroll-behavior: auto !important; }
}
</style>
</head>
<body>
<main>
<nav class="language-switcher" aria-label="Language / 语言">
<button class="language-button" id="language-zh" type="button" aria-pressed="true">中文</button>
<button class="language-button" id="language-en" type="button" aria-pressed="false">English</button>
</nav>
<h1>
<span data-language="zh-CN">加入 OSG</span>
<span data-language="en">Join OSG</span>
</h1>
<p>
<span data-language="zh-CN">使用此邀请码开始体验。</span>
<span data-language="en">Use this invitation code to get started.</span>
</p>
<code id="invite-code" aria-label="邀请码 / Invitation code">{{INVITE_CODE}}</code>
<div class="actions">
<button class="action primary" id="copy-button" type="button">
<span data-language="zh-CN">复制邀请码</span>
<span data-language="en">Copy invitation code</span>
</button>
<a class="action secondary" href="{{UNIVERSAL_LINK}}" rel="noopener">
<span data-language="zh-CN">打开 App</span>
<span data-language="en">Open App</span>
</a>
<a class="action store-link" href="{{APP_STORE_URL}}" rel="noopener noreferrer">
<span data-language="zh-CN">前往 App Store</span>
<span data-language="en">Download on the App Store</span>
</a>
</div>
<p id="copy-status" role="status" aria-live="polite"></p>
<p class="hint">
<span data-language="zh-CN">若“打开 App”仍停留在浏览器,请从信息或邮件中再次轻点原邀请链接。</span>
<span data-language="en">If “Open App” stays in the browser, tap the original invitation link again from Messages or Mail.</span>
</p>
</main>
<script nonce="{{CSP_NONCE}}">
const copyButton = document.getElementById("copy-button");
const inviteCode = document.getElementById("invite-code").textContent;
const copyStatus = document.getElementById("copy-status");
const zhButton = document.getElementById("language-zh");
const enButton = document.getElementById("language-en");
let language = navigator.language.toLowerCase().startsWith("zh") ? "zh-CN" : "en";
function setLanguage(nextLanguage) {
language = nextLanguage;
document.documentElement.lang = language;
zhButton.setAttribute("aria-pressed", String(language === "zh-CN"));
enButton.setAttribute("aria-pressed", String(language === "en"));
copyStatus.textContent = "";
}
zhButton.addEventListener("click", () => setLanguage("zh-CN"));
enButton.addEventListener("click", () => setLanguage("en"));
setLanguage(language);
copyButton.addEventListener("click", async () => {
try {
await navigator.clipboard.writeText(inviteCode);
copyStatus.textContent = language === "zh-CN" ? "已复制" : "Copied";
} catch {
const selection = window.getSelection();
const range = document.createRange();
range.selectNodeContents(document.getElementById("invite-code"));
selection.removeAllRanges();
selection.addRange(range);
copyStatus.textContent = language === "zh-CN"
? "无法自动复制,邀请码已选中"
: "Automatic copy failed; the code is selected";
}
});
</script>
</body>
</html>