Choose even the first region in the browser; update Docker and Nix
A node now starts without any region (it only helps others connect, and prints a hint). The owner's sign-in link leads straight to the Regions page when none is followed, visitors get a notice instead of an empty search, and status always lists regions as an array. The Docker image no longer pins Bonn, the NixOS module no longer requires regions, and the VM test now starts without any, chooses the first region over the API and checks it survives a restart. README and the init hint follow. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01AeFqV96dVeBX94inzcgZKw
This commit is contained in:
Vendored
+51
-27
@@ -110,6 +110,9 @@ function sendOnCtrlEnter(area) {
|
||||
var de = {
|
||||
"app.tagline": "Wohnungen und H\xE4user, getragen von allen. Kostenlos, ohne Konzern.",
|
||||
"status.line": "{listings} Anzeigen \xB7 {peers} verbundene Knoten \xB7 Regionen: {regions}",
|
||||
"status.noRegions": "noch keine",
|
||||
"search.noRegions": "Dieser Knoten folgt noch keiner Region und hat deshalb keine Anzeigen. Wer ihn betreibt, w\xE4hlt Regionen unter \u201EMeine Anzeigen\u201C > \u201ERegionen\u201C.",
|
||||
"search.chooseRegions": "Regionen w\xE4hlen",
|
||||
"status.unreachable": "Dieser Knoten ist nicht erreichbar.",
|
||||
"filter.kind": "Angebot",
|
||||
"filter.category": "Art",
|
||||
@@ -359,6 +362,9 @@ var de = {
|
||||
var en = {
|
||||
"app.tagline": "Homes to rent and buy, run by everyone. Free, with no company behind it.",
|
||||
"status.line": "{listings} listings \xB7 {peers} connected nodes \xB7 regions: {regions}",
|
||||
"status.noRegions": "none yet",
|
||||
"search.noRegions": "This node follows no region yet, so it has no listings. Whoever runs it chooses regions under \u201CMy listings\u201D > \u201CRegions\u201D.",
|
||||
"search.chooseRegions": "Choose regions",
|
||||
"status.unreachable": "This node is not reachable.",
|
||||
"filter.kind": "Offer",
|
||||
"filter.category": "Type",
|
||||
@@ -617,6 +623,13 @@ function t(key, vars = {}) {
|
||||
}
|
||||
|
||||
// src/format.ts
|
||||
function statusLine(n) {
|
||||
return t("status.line", {
|
||||
listings: n.listings,
|
||||
peers: n.peers,
|
||||
regions: n.regions.length ? n.regions.join(", ") : t("status.noRegions")
|
||||
});
|
||||
}
|
||||
function money(cents) {
|
||||
return new Intl.NumberFormat(lang, { style: "currency", currency: "EUR" }).format(cents / 100);
|
||||
}
|
||||
@@ -761,7 +774,7 @@ function keepFresh(alive, run, ms = FOREGROUND_MS, doc = document) {
|
||||
schedule();
|
||||
}
|
||||
|
||||
// ../../web/node_modules/@noble/ciphers/utils.js
|
||||
// node_modules/@noble/ciphers/utils.js
|
||||
/*! noble-ciphers - MIT License (c) 2023 Paul Miller (paulmillr.com) */
|
||||
function isBytes(a) {
|
||||
return a instanceof Uint8Array || ArrayBuffer.isView(a) && a.constructor.name === "Uint8Array" && "BYTES_PER_ELEMENT" in a && a.BYTES_PER_ELEMENT === 1;
|
||||
@@ -940,7 +953,7 @@ function copyBytes(bytes2) {
|
||||
return Uint8Array.from(abytes(bytes2));
|
||||
}
|
||||
|
||||
// ../../web/node_modules/@noble/ciphers/_arx.js
|
||||
// node_modules/@noble/ciphers/_arx.js
|
||||
var encodeStr = (str) => Uint8Array.from(str.split(""), (c) => c.charCodeAt(0));
|
||||
var sigma16_32 = /* @__PURE__ */ (() => swap32IfBE(u32(encodeStr("expand 16-byte k"))))();
|
||||
var sigma32_32 = /* @__PURE__ */ (() => swap32IfBE(u32(encodeStr("expand 32-byte k"))))();
|
||||
@@ -1070,7 +1083,7 @@ function createCipher(core, opts) {
|
||||
};
|
||||
}
|
||||
|
||||
// ../../web/node_modules/@noble/ciphers/_poly1305.js
|
||||
// node_modules/@noble/ciphers/_poly1305.js
|
||||
function u8to16(a, i) {
|
||||
return a[i++] & 255 | (a[i++] & 255) << 8;
|
||||
}
|
||||
@@ -1321,7 +1334,7 @@ var Poly1305 = class {
|
||||
};
|
||||
var poly1305 = /* @__PURE__ */ wrapMacConstructor(32, (key) => new Poly1305(key));
|
||||
|
||||
// ../../web/node_modules/@noble/ciphers/chacha.js
|
||||
// node_modules/@noble/ciphers/chacha.js
|
||||
function chachaCore(s, k, n, out, cnt, rounds = 20) {
|
||||
let y00 = s[0], y01 = s[1], y02 = s[2], y03 = s[3], y04 = k[0], y05 = k[1], y06 = k[2], y07 = k[3], y08 = k[4], y09 = k[5], y10 = k[6], y11 = k[7], y12 = cnt, y13 = n[0], y14 = n[1], y15 = n[2];
|
||||
let x00 = y00, x01 = y01, x02 = y02, x03 = y03, x04 = y04, x05 = y05, x06 = y06, x07 = y07, x08 = y08, x09 = y09, x10 = y10, x11 = y11, x12 = y12, x13 = y13, x14 = y14, x15 = y15;
|
||||
@@ -1471,7 +1484,7 @@ var chacha20poly1305 = /* @__PURE__ */ wrapCipher(
|
||||
/* @__PURE__ */ _poly1305_aead(chacha20)
|
||||
);
|
||||
|
||||
// ../../web/node_modules/@noble/hashes/_u64.js
|
||||
// node_modules/@noble/hashes/_u64.js
|
||||
var U32_MASK64 = /* @__PURE__ */ (() => BigInt(2 ** 32 - 1))();
|
||||
var _32n = /* @__PURE__ */ BigInt(32);
|
||||
function fromBig(n, le = false) {
|
||||
@@ -1514,7 +1527,7 @@ var add4H = (low, Ah, Bh, Ch, Dh) => Ah + Bh + Ch + Dh + (low / 2 ** 32 | 0) | 0
|
||||
var add5L = (Al, Bl, Cl, Dl, El) => (Al >>> 0) + (Bl >>> 0) + (Cl >>> 0) + (Dl >>> 0) + (El >>> 0);
|
||||
var add5H = (low, Ah, Bh, Ch, Dh, Eh) => Ah + Bh + Ch + Dh + Eh + (low / 2 ** 32 | 0) | 0;
|
||||
|
||||
// ../../web/node_modules/@noble/hashes/utils.js
|
||||
// node_modules/@noble/hashes/utils.js
|
||||
function isBytes2(a) {
|
||||
return a instanceof Uint8Array || ArrayBuffer.isView(a) && a.constructor.name === "Uint8Array" && "BYTES_PER_ELEMENT" in a && a.BYTES_PER_ELEMENT === 1;
|
||||
}
|
||||
@@ -1679,7 +1692,7 @@ var oidNist = (suffix) => ({
|
||||
oid: Uint8Array.from([6, 9, 96, 134, 72, 1, 101, 3, 4, 2, suffix])
|
||||
});
|
||||
|
||||
// ../../web/node_modules/@noble/hashes/_md.js
|
||||
// node_modules/@noble/hashes/_md.js
|
||||
function Chi(a, b, c) {
|
||||
return a & b ^ ~a & c;
|
||||
}
|
||||
@@ -1810,7 +1823,7 @@ var SHA512_IV = /* @__PURE__ */ Uint32Array.from([
|
||||
327033209
|
||||
]);
|
||||
|
||||
// ../../web/node_modules/@noble/hashes/sha2.js
|
||||
// node_modules/@noble/hashes/sha2.js
|
||||
var SHA256_K = /* @__PURE__ */ Uint32Array.from([
|
||||
1116352408,
|
||||
1899447441,
|
||||
@@ -2207,7 +2220,7 @@ var sha512 = /* @__PURE__ */ createHasher(
|
||||
/* @__PURE__ */ oidNist(3)
|
||||
);
|
||||
|
||||
// ../../web/node_modules/@noble/curves/utils.js
|
||||
// node_modules/@noble/curves/utils.js
|
||||
/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */
|
||||
function aarray(item, title, inner = () => {
|
||||
}) {
|
||||
@@ -2328,7 +2341,7 @@ function validateObject(object, fields = {}, optFields = {}, title = "object") {
|
||||
iter(optFields, true);
|
||||
}
|
||||
|
||||
// ../../web/node_modules/@noble/curves/abstract/modular.js
|
||||
// node_modules/@noble/curves/abstract/modular.js
|
||||
/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */
|
||||
var _0n2 = /* @__PURE__ */ BigInt(0);
|
||||
var _1n2 = /* @__PURE__ */ BigInt(1);
|
||||
@@ -2758,7 +2771,7 @@ function Field(ORDER, opts = {}) {
|
||||
return new _Field(ORDER, opts);
|
||||
}
|
||||
|
||||
// ../../web/node_modules/@noble/curves/abstract/curve.js
|
||||
// node_modules/@noble/curves/abstract/curve.js
|
||||
/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */
|
||||
var _0n3 = /* @__PURE__ */ BigInt(0);
|
||||
var _1n3 = /* @__PURE__ */ BigInt(1);
|
||||
@@ -3146,7 +3159,7 @@ function createKeygen(randomSecretKey, getPublicKey) {
|
||||
};
|
||||
}
|
||||
|
||||
// ../../web/node_modules/@noble/curves/abstract/edwards.js
|
||||
// node_modules/@noble/curves/abstract/edwards.js
|
||||
/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */
|
||||
var _0n4 = /* @__PURE__ */ BigInt(0);
|
||||
var _1n4 = /* @__PURE__ */ BigInt(1);
|
||||
@@ -3598,7 +3611,7 @@ function eddsa(Point, cHash, eddsaOpts = {}) {
|
||||
});
|
||||
}
|
||||
|
||||
// ../../web/node_modules/@noble/curves/abstract/montgomery.js
|
||||
// node_modules/@noble/curves/abstract/montgomery.js
|
||||
/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */
|
||||
var _0n5 = /* @__PURE__ */ BigInt(0);
|
||||
var _1n5 = /* @__PURE__ */ BigInt(1);
|
||||
@@ -3746,7 +3759,7 @@ function montgomery(curveDef) {
|
||||
});
|
||||
}
|
||||
|
||||
// ../../web/node_modules/@noble/curves/ed25519.js
|
||||
// node_modules/@noble/curves/ed25519.js
|
||||
/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */
|
||||
var _0n6 = /* @__PURE__ */ BigInt(0);
|
||||
var _1n6 = /* @__PURE__ */ BigInt(1);
|
||||
@@ -3847,7 +3860,7 @@ var x25519 = /* @__PURE__ */ (() => {
|
||||
});
|
||||
})();
|
||||
|
||||
// ../../web/node_modules/@noble/hashes/hmac.js
|
||||
// node_modules/@noble/hashes/hmac.js
|
||||
var _HMAC = class {
|
||||
oHash;
|
||||
iHash;
|
||||
@@ -3924,7 +3937,7 @@ var hmac = /* @__PURE__ */ (() => {
|
||||
return hmac_;
|
||||
})();
|
||||
|
||||
// ../../web/node_modules/@noble/hashes/hkdf.js
|
||||
// node_modules/@noble/hashes/hkdf.js
|
||||
var HKDF_COUNTER = /* @__PURE__ */ Uint8Array.of(0);
|
||||
var EMPTY_BUFFER = /* @__PURE__ */ Uint8Array.of();
|
||||
function expand(hash, prk, info, length = 32, _recycled) {
|
||||
@@ -6022,9 +6035,7 @@ function showRegions(message = "") {
|
||||
const now = await setRegions(regions);
|
||||
if (state.node) state.node.regions = now;
|
||||
const statusEl2 = document.getElementById("status");
|
||||
if (statusEl2 && state.node) {
|
||||
statusEl2.textContent = t("status.line", { listings: state.node.listings, peers: state.node.peers, regions: now.join(", ") });
|
||||
}
|
||||
if (statusEl2 && state.node) statusEl2.textContent = statusLine(state.node);
|
||||
showRegions(t("reg.saved"));
|
||||
}
|
||||
});
|
||||
@@ -6200,7 +6211,19 @@ function showSearch(params) {
|
||||
const gen = state.generation;
|
||||
clear(app4);
|
||||
const results = h("div", { class: "results", "aria-live": "polite" });
|
||||
app4.append(h("p", { class: "tagline" }, t("app.tagline")), searchForm(params), results);
|
||||
app4.append(h("p", { class: "tagline" }, t("app.tagline")));
|
||||
if (state.node && state.node.regions.length === 0) {
|
||||
app4.append(
|
||||
h(
|
||||
"p",
|
||||
{ class: "notice", role: "status" },
|
||||
t("search.noRegions"),
|
||||
" ",
|
||||
getToken() ? h("a", { href: "#/mine/regions" }, t("search.chooseRegions")) : null
|
||||
)
|
||||
);
|
||||
}
|
||||
app4.append(searchForm(params), results);
|
||||
const prefix = params.get("geohash")?.trim().toLowerCase();
|
||||
if (prefix && !GEOHASH_PREFIX.test(prefix)) {
|
||||
results.append(h("p", { class: "error" }, t("filter.regionHint")));
|
||||
@@ -6336,8 +6359,13 @@ function route() {
|
||||
document.body.classList.remove("wide");
|
||||
if (login) {
|
||||
setToken(login[1]);
|
||||
history.replaceState(null, "", location.pathname + location.search + "#/mine");
|
||||
void showOwner();
|
||||
if (state.node && state.node.regions.length === 0) {
|
||||
history.replaceState(null, "", location.pathname + location.search + "#/mine/regions");
|
||||
showRegions();
|
||||
} else {
|
||||
history.replaceState(null, "", location.pathname + location.search + "#/mine");
|
||||
void showOwner();
|
||||
}
|
||||
} else if (m) void showDetail(m[1], m[2]);
|
||||
else if (c) void showConversation(c[1], c[2], c[3]);
|
||||
else if (path === "/messages") showInbox();
|
||||
@@ -6354,11 +6382,7 @@ async function boot() {
|
||||
document.getElementById("foot").textContent = t("footer.text");
|
||||
try {
|
||||
state.node = await getStatus();
|
||||
statusEl.textContent = t("status.line", {
|
||||
listings: state.node.listings,
|
||||
peers: state.node.peers,
|
||||
regions: state.node.regions.join(", ")
|
||||
});
|
||||
statusEl.textContent = statusLine(state.node);
|
||||
} catch {
|
||||
statusEl.textContent = t("status.unreachable");
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user