Change farm password to 1722

This commit is contained in:
Muse committed 2026-12-01 22:50:36 +07:00
1 parent c957a0ffe3
commit 2efe74998c
7 files changed
+790 -8

No files matched your search

+79 -5
View File
@@ -76,9 +76,9 @@
<button id="refreshBtn" type="button">Refresh</button>
<button id="startAllBtn" type="button" class="primary">Start semua</button>
<button id="stopAllBtn" type="button">Stop semua</button>
<button id="syncBtn" type="button" title="Saat ON, kendalikan 1 browser dan semua browser lain ikut (klik, scroll, ketik).">Sinkron: OFF</button>
<button id="syncBtn" type="button" title="Saat ON, kendalikan 1 browser dan semua browser lain ikut (klik, scroll, ketik, paste).">Sinkron: OFF</button>
</header>
<p class="note"><b>Cara pakai:</b> login sekali dengan password farm &mdash; semua browser langsung terhubung otomatis. Tiap cell adalah browser Chromium sendiri (profil, cookie, dan IP terpisah). Settings mengubah User-Agent &amp; proxy, lalu browser restart otomatis. <b>Sinkron:</b> nyalakan tombol di atas, lalu klik/ketik di satu browser — semua browser lain ikut melakukan hal yang sama. Browser yang terakhir kamu sentuh jadi Master (badge kuning).</p>
<p class="note"><b>Cara pakai:</b> login sekali dengan password farm &mdash; semua browser langsung terhubung otomatis. Tiap cell adalah browser Chromium sendiri (profil, cookie, dan IP terpisah). Settings mengubah User-Agent &amp; proxy, lalu browser restart otomatis. <b>Sinkron:</b> nyalakan tombol di atas, lalu klik/ketik/paste di satu browser — semua browser lain ikut melakukan hal yang sama. Browser yang terakhir kamu sentuh jadi Master (badge kuning).</p>
<div class="banner" id="banner"></div>
<main class="grid" id="grid"></main>
@@ -367,10 +367,14 @@
function handler(e) { onCellInput(id, e); }
// Mouse + wheel + keyboard: exactly the events the Overlay listens
// Mouse + wheel + keyboard + paste: the events the Overlay listens
// to. (The Overlay uses mouse events, not pointer events, so we
// mirror mouse events — a PointerEvent would be ignored by it.)
['mousemove', 'mousedown', 'wheel', 'keydown', 'keyup'].forEach(function (type) {
// Paste is mirrored too: the Overlay reads the pasted text from the
// paste event's clipboardData (see mirrorInput), and a Ctrl+V
// keydown alone never pastes — the Overlay swallows the 'v' key and
// waits for the paste event.
['mousemove', 'mousedown', 'wheel', 'keydown', 'keyup', 'paste'].forEach(function (type) {
input.addEventListener(type, handler, false);
});
// mouseup can happen outside the textarea (the Overlay itself
@@ -419,7 +423,77 @@
if (!master || !master.inputEl) return;
var type = e.type;
if (type !== 'mousemove' && type !== 'mousedown' && type !== 'mouseup' &&
type !== 'wheel' && type !== 'keydown' && type !== 'keyup') return;
type !== 'wheel' && type !== 'keydown' && type !== 'keyup' &&
type !== 'paste') return;
// Paste: Neko's Overlay reads the pasted text from the paste event's
// clipboardData (client/core/src/overlay.ts: it listens for 'paste'
// on the textarea and calls onPaste(clipboardData.getData('text/plain')),
// which sets the remote clipboard via preparePaste and then sends a
// Ctrl+V keystroke). A mirrored Ctrl+V keydown alone never pastes —
// the Overlay swallows the 'v' key — so the text itself has to be
// carried over: read it once from the master's paste event and
// dispatch an equivalent paste into every follower's textarea, so
// each follower's Overlay processes it exactly like a real paste.
// (The synthetic events have isTrusted=false, so each follower's own
// grid listener ignores them — no feedback loop.)
if (type === 'paste') {
var text = '';
try {
text = (e.clipboardData && e.clipboardData.getData('text/plain')) || '';
} catch (err) { text = ''; }
// Empty clipboard (no text, or no clipboard permission): do
// nothing rather than dispatching an empty paste that would make
// followers send preparePaste('') + Ctrl+V to their remotes.
if (!text) return;
Object.keys(cells).forEach(function (fid) {
if (fid === masterId) return;
var f = cells[fid];
if (!f || !f.inputEl) return;
if (!f._browser || f._browser.status !== 'running') return;
try {
var fwin = f.inputEl.ownerDocument.defaultView;
if (!fwin) return;
var dt = null;
try {
if (typeof fwin.DataTransfer === 'function') {
dt = new fwin.DataTransfer();
dt.setData('text/plain', text);
}
} catch (err) { dt = null; }
if (!dt) {
// No DataTransfer in this engine: a minimal clipboardData-like
// object. Neko only calls getData('text/plain').
dt = {
getData: function (t) { return t === 'text/plain' ? text : ''; },
setData: function () {},
types: ['text/plain'],
};
}
var ev = null;
try {
if (typeof fwin.ClipboardEvent === 'function') {
ev = new fwin.ClipboardEvent('paste', {
bubbles: true, cancelable: true, clipboardData: dt,
});
}
} catch (err) { ev = null; }
if (!ev) ev = new fwin.Event('paste', { bubbles: true, cancelable: true });
// Make sure the dispatched event actually carries the text even
// when the ClipboardEvent constructor ignored the clipboardData
// init: shadow the prototype getter on the instance.
try {
var got = (ev.clipboardData && ev.clipboardData.getData)
? ev.clipboardData.getData('text/plain') : null;
if (got !== text) Object.defineProperty(ev, 'clipboardData', { value: dt });
} catch (err) { /* ignore */ }
f.inputEl.dispatchEvent(ev);
} catch (err) {
// A follower that is not ready must never break the grid.
}
});
return;
}
// Throttle mousemove mirroring (~60fps) so a fast drag does not
// flood the followers with synthetic events. Clicks, wheel and keys
+1 -1
View File
@@ -27,7 +27,7 @@ const CONFIG_PATH = path.join(__dirname, 'config.json');
const GENERATE_SCRIPT = path.join(__dirname, '..', 'scripts', 'generate.js');
// Single password for the whole farm: the grid login AND every Neko
// instance's password. Must match FARM_PASSWORD in scripts/install.sh.
const FARM_PASSWORD = process.env.FARM_PASSWORD || 'pendol1722';
const FARM_PASSWORD = process.env.FARM_PASSWORD || '1722';
const NEKO_LOGIN_USER = 'pend';
const TOKEN_TTL_MS = 55 * 60 * 1000; // Neko tokens are re-fetched every 55 min
const SESSION_TTL_MS = 7 * 24 * 60 * 60 * 1000; // farm login lasts 7 days