shadok-ai 0.19.71 → 0.19.72

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/server.js CHANGED
@@ -153,6 +153,15 @@ if (!instanceLock.ok) {
153
153
  }
154
154
  process.on("exit", () => releaseInstanceLock());
155
155
  const app = express();
156
+ // Nothing a cockpit serves belongs in a search index: the login page and the
157
+ // share card are public on purpose (a link preview needs them), but a
158
+ // preview bot ignores this header while a search crawler honours it. A
159
+ // header rather than robots.txt: a robots.txt Disallow would also stop the
160
+ // preview bots that respect it, and the preview is the point.
161
+ app.use((_req, res, next) => {
162
+ res.setHeader("X-Robots-Tag", "noindex, nofollow");
163
+ next();
164
+ });
156
165
  app.use(express.json({ limit: "1mb" }));
157
166
  /** A screenshot is a few hundred kB, but any file can be pasted now (a PDF
158
167
  * easily tops 12 MB); past this a paste is really an upload it shouldn't be. */
@@ -1135,6 +1144,13 @@ function passwordMatches(input) {
1135
1144
  * The login page. A shared link lands here for anyone without a session — and
1136
1145
  * so does a chat app's preview bot, which is why it names the instance and
1137
1146
  * carries the `og:*` tags. The mascot is the same drawing as the share card's.
1147
+ *
1148
+ * Its typeface is a Latin-1 WOFF2 subset of Inter (~34 KB a weight), not the
1149
+ * full TTFs: those are ~410 KB each and exist for the share card's server-side
1150
+ * rasteriser, which needs every glyph. A character outside the subset falls
1151
+ * back to the system font, glyph by glyph. `swap`: the form is usable at once.
1152
+ * Regenerated from the TTFs with the `subset-font` package (U+0020–007E,
1153
+ * U+00A0–00FF and the typographic punctuation ‘’“”–—…·•→), target `woff2`.
1138
1154
  */
1139
1155
  function loginHtml(v) {
1140
1156
  const e = escapeXml;
@@ -1153,8 +1169,9 @@ function loginHtml(v) {
1153
1169
  : '<input id=pw type=password placeholder="Password" autofocus autocomplete=current-password>';
1154
1170
  const title = v.invite ? `${e(name)} — choose a password` : `${e(name)} — sign in`;
1155
1171
  return `<!doctype html><meta charset=utf8><meta name=viewport content="width=device-width,initial-scale=1">
1172
+ <meta name=robots content="noindex,nofollow"><link rel=icon href="/icons/icon-192.png">
1156
1173
  <title>${title}</title>${v.meta ? "\n" + v.meta : ""}
1157
- <style>@font-face{font-family:Inter;src:url(/fonts/Inter-Regular.ttf);font-weight:400}@font-face{font-family:Inter;src:url(/fonts/Inter-Bold.ttf);font-weight:700}
1174
+ <style>@font-face{font-family:Inter;src:url(/fonts/inter-latin-400.woff2) format("woff2");font-weight:400;font-display:swap}@font-face{font-family:Inter;src:url(/fonts/inter-latin-700.woff2) format("woff2");font-weight:700;font-display:swap}
1158
1175
  :root{--accent:${accent}}
1159
1176
  body{margin:0;min-height:100vh;display:flex;align-items:center;justify-content:center;background:radial-gradient(circle at 50% 28%,color-mix(in srgb,var(--accent) 16%,transparent),transparent 55%),#12151c;color:#e8e8ea;font-family:Inter,system-ui,sans-serif}
1160
1177
  form{background:#1b1f29;border:1px solid #2c3140;padding:30px;border-radius:16px;box-shadow:0 20px 60px rgba(0,0,0,.55);width:min(340px,88vw);text-align:center}