Spaces:
Running
Running
Surf Studio commited on
Commit ·
536264d
1
Parent(s): 94b4ce6
实时搜索 + Telegram 账号登录 + 企业微信推送 + 5 分钟巡检
Browse files- X:登录后可实时搜索关键词(GraphQL SearchTimeline,query id 自动发现)
- Telegram:改为手机号登录用户会话,可读取私有频道/群
- 通知:发现还有名额的赠链立即推送企业微信,每个赠链只推一次
- 定时:每 5 分钟检查 Telegram 新消息与赠链名额,每 15 分钟刷新 X,每 6 小时全量
- 安全:可选管理密码(ADMIN_KEY)保护修改类接口;密钥不再写死在代码里
Files changed (9)
- README.md+23-7
- frontend/src/components/SourcePanel.tsx+48-1
- frontend/tsconfig.tsbuildinfo
- lib/auth.jsAdded+27
- lib/notify.js+3-5
- lib/xauth.js+178-7
- routes/telegram.js+31-7
- routes/tracker.js+4-3
- routes/xauth.js+4-3
13 unmodified lines141516171819202122232425262728293031323313 unmodified lines## 功能- **X**:每 15 分钟读取分享者的主页最新帖子(并解析短链确认是赠链);登录 X 后可实时搜索关键词- **Telegram**:用手机号登录 Telegram 账号后,可以读取**私有频道 / 私有群**里的赠链消息;未登录时读取公开频道- **名额检查**:每 5 分钟调用赠链接口复查剩余名额- **推送**:一旦发现有「还有名额」的赠链,立刻推送到企业微信机器人(每个赠链只推一次)- **界面**:收录列表、来源筛选、还有名额的赠链一键复制、倒计时## 需要的配置| 名称 | 类型 | 说明 || --- | --- | --- || `SURF_API_KEY` | Secret | Surf 平台密钥(数据接口 + 数据库) || `SURF_API_BASE_URL` | Variable | `https://api.asksurf.ai/gateway/v1` |企业微信机器人地址、X Cookie、Telegram 登录都在页面「数据源设置」里配置,保存在数据库里。## 本地运行13 unmodified lines14151617181920212223242526272829303132333435363738394041424344454647484913 unmodified lines## 功能- **X**- 每 15 分钟读取分享者的主页最新帖子(自动解析短链确认是不是赠链)- 登录 X 后可以**实时搜索关键词**,拿到比网页索引更新的帖子(含搜索结果里的新账号)- **Telegram**- 用手机号登录 Telegram 账号(验证码 + 两步验证),可以读取**私有频道 / 私有群**里的赠链消息- 未登录时以公开模式读取公开频道- **名额检查**:每 5 分钟调用赠链接口复查剩余名额- **企业微信推送**:一旦发现有「还有名额」的赠链,立刻推送到群机器人(每个赠链只推一次)- **界面**:收录列表、来源筛选(X / Telegram)、还有名额的赠链一键复制、倒计时## 运行配置| 名称 | 类型 | 说明 || --- | --- | --- || `SURF_API_KEY` | Secret | Surf 平台密钥(数据接口 + 数据库),必需 || `SURF_API_BASE_URL` | Variable | `https://api.asksurf.ai/gateway/v1` || `WECOM_WEBHOOK` | Secret | 可选。企业微信机器人地址,也可以直接在页面「数据源设置」里填写 || `ADMIN_KEY` | Secret | 可选。设置后,所有修改类操作需要在页面输入这个密码,防止公开页面被乱改 |X Cookie、Telegram 登录、企业微信地址都保存在数据库里,可以在页面「数据源设置」里随时修改。## 接口- `GET /api/tracker` — 收录的帖子与统计- `POST /api/tracker/quick` — 立即抓取一次(X + Telegram + 名额检查 + 推送)- `POST /api/tracker/add` — 手动添加一条 X 帖子或赠链码- `GET /api/telegram/status`、`POST /api/telegram/login/start`、`/login/code`、`/logout`- `POST /api/telegram/channels` — 添加频道(支持私有邀请链接)- `POST /api/telegram/notify/test` — 发一条企业微信测试消息- `GET /api/xauth/status`、`POST /api/xauth/connect` — X 登录(粘贴 Cookie)## 本地运行
65 unmodified lines666768697071727320 unmodified lines949596979899100101154 unmodified lines256257258259260261368 unmodified lines63063163263363463565 unmodified linesconst [notice, setNotice] = useState<string | null>(null)const [error, setError] = useState<string | null>(null)const [link, setLink] = useState('')useEffect(() => {void loadStatuses()}, [])20 unmodified linessetError(null)setNotice(null)try {const res = await fetch(api(path), { headers: { 'Content-Type': 'application/json' }, ...init })const body = await res.json()if (!res.ok) throw new Error(body?.error || `HTTP ${res.status}`)setNotice(successMessage(body))return body154 unmodified lines}}async function testPush() {await call('notify-test', 'telegram/notify/test', { method: 'POST' }, () => '测试消息已推送到企业微信')}368 unmodified lines</button></div>{(notice || error) && (<divclassName={`flex items-start gap-2 rounded-[10px] border px-3 py-2 text-xs ${65 unmodified lines66676869707172737475767778798081828320 unmodified lines104105106107108109110111112113114115116117118154 unmodified lines273274275276277278279280281282283284285286287288289290368 unmodified lines65966066166266366466566666766866967067167267367467567667767867968068168265 unmodified linesconst [notice, setNotice] = useState<string | null>(null)const [error, setError] = useState<string | null>(null)const [link, setLink] = useState('')const [adminKey, setAdminKey] = useState('')const [keyDraft, setKeyDraft] = useState('')const [needsKey, setNeedsKey] = useState(false)useEffect(() => {try {const saved = localStorage.getItem('surf_admin_key') || ''setAdminKey(saved)setKeyDraft(saved)} catch {/* private mode */}void loadStatuses()}, [])20 unmodified linessetError(null)setNotice(null)try {const res = await fetch(api(path), {headers: {'Content-Type': 'application/json',...(adminKey ? { 'x-admin-key': adminKey } : {}),},...init,})const body = await res.json()if (res.status === 401 && body?.needsKey) setNeedsKey(true)if (!res.ok) throw new Error(body?.error || `HTTP ${res.status}`)setNotice(successMessage(body))return body154 unmodified lines}}function saveAdminKey() {const value = keyDraft.trim()try {localStorage.setItem('surf_admin_key', value)} catch {/* ignore */}setAdminKey(value)setNeedsKey(false)setNotice(value ? '管理密码已保存,可以继续操作了' : '已清除管理密码')}async function testPush() {await call('notify-test', 'telegram/notify/test', { method: 'POST' }, () => '测试消息已推送到企业微信')}368 unmodified lines</button></div>{needsKey && (<div className="flex flex-wrap items-center gap-2 rounded-[10px] border border-[var(--destructive)]/40 px-3 py-2"><span className="text-[11px] text-fg-muted">这个页面开启了管理密码,请填写后重试(保存在本机浏览器)</span><inputtype="password"value={keyDraft}onChange={(event) => setKeyDraft(event.target.value)}placeholder="管理密码"className={`${inputClass} max-w-[200px]`}/><button type="button" onClick={saveAdminKey} className={ghostButton}>保存</button></div>)}{(notice || error) && (<divclassName={`flex items-start gap-2 rounded-[10px] border px-3 py-2 text-xs ${
123456789101112131415161718192021222324252627/** * Optional admin lock for the mutating endpoints. * * The tracker is often deployed on a public URL, so anyone could otherwise * clear channels, log accounts out or inject posts. When a key is configured * (settings table `admin_key` or the ADMIN_KEY env var) every write needs it. * No key configured = open, so existing installs keep working. */const { getSetting } = require('./settings')
async function adminKey() { return (await getSetting('admin_key')) || process.env.ADMIN_KEY || null}
async function requireKey(req, res, next) { try { const key = await adminKey() if (!key) return next() const provided = req.get('x-admin-key') || req.query.key || req.body?.key if (provided && String(provided) === String(key)) return next() return res.status(401).json({ error: '需要管理密码', needsKey: true }) } catch (err) { return res.status(500).json({ error: err.message }) }}
module.exports = { requireKey, adminKey }6 unmodified lines789101112131415161718192021226 unmodified linesconst { dbQuery } = require('@surf-ai/sdk/db')const { getSetting } = require('./settings')const DEFAULT_WEBHOOK ='https://qyapi.weixin.qq.com/cgi-bin/webhook/send?key=8e3758b3-f951-46ab-aefa-9e0255f0e850'async function webhookUrl() {return (await getSetting('wecom_webhook')) || DEFAULT_WEBHOOK}async function send(payload) {const url = await webhookUrl()if (!url) throw new Error('还没有配置企业微信推送地址')const res = await fetch(url, {method: 'POST',headers: { 'content-type': 'application/json' },6 unmodified lines78910111213141516171819206 unmodified linesconst { dbQuery } = require('@surf-ai/sdk/db')const { getSetting } = require('./settings')/** Webhook comes from the settings table (set in the UI) or the env var. */async function webhookUrl() {return (await getSetting('wecom_webhook')) || process.env.WECOM_WEBHOOK || null}async function send(payload) {const url = await webhookUrl()if (!url) throw new Error('还没有配置企业微信推送地址,请在「数据源设置」里填写')const res = await fetch(url, {method: 'POST',headers: { 'content-type': 'application/json' },
101 unmodified lines10210310410510610710848 unmodified lines15715815916016116216316416516616716816917017117215 unmodified lines1881891901911921931947 unmodified lines202203204205206207101 unmodified lineslet searchCount = 0let searchError = nulltry {const tweets = await xtimeline.fetchSearchTweets('"asksurf.ai/mystery-box"', cookieHeader(jar))searchCount = tweets.length} catch (err) {searchError = err.message48 unmodified linesreturn Boolean(await getSetting('x_cookies'))}/** Live search with the stored session. */async function search(query, { limit = 20 } = {}) {const cookies = await getSetting('x_cookies')if (!cookies) {const err = new Error('X 未登录')err.status = 400throw err}const tweets = await xtimeline.fetchSearchTweets(query, cookies)return tweets.slice(0, limit)}/** Remember that the stored session stopped working. */15 unmodified lineslet searchCount = 0let searchError = nulltry {const tweets = await xtimeline.fetchSearchTweets('"asksurf.ai/mystery-box"', cookies)searchCount = tweets.length} catch (err) {searchError = err.message7 unmodified linesmodule.exports = {connect,disconnect,status,isConnected,101 unmodified lines10210310410510610710848 unmodified lines15715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134215 unmodified lines3583593603613623633647 unmodified lines372373374375376377378101 unmodified lineslet searchCount = 0let searchError = nulltry {const tweets = await searchWith(cookieHeader(jar), '"asksurf.ai/mystery-box"', { limit: 20 })searchCount = tweets.length} catch (err) {searchError = err.message48 unmodified linesreturn Boolean(await getSetting('x_cookies'))}/* ------------------------------------------------------------ graphql -- *//** Public web bearer — the same one x.com's own bundle ships. */const FALLBACK_BEARER ='AAAAAAAAAAAAAAAAAAAAANRILgAAAAAAnNwIzUejRCOuH5E6I8xnZz4puTs%3D1Zv7ttfk8LF81IUq16cHjhLTvJu4FA33AGWWjCpTnA'/** Feature switches SearchTimeline expects (superset is fine). */const FEATURES = ['rweb_video_screen_enabled','rweb_cashtags_enabled','profile_label_improvements_pcf_label_in_post_enabled','responsive_web_profile_redirect_enabled','rweb_tipjar_consumption_enabled','verified_phone_label_enabled','creator_subscriptions_tweet_preview_api_enabled','responsive_web_graphql_timeline_navigation_enabled','premium_content_api_read_enabled','communities_web_enable_tweet_community_results_fetch','c9s_tweet_anatomy_moderator_badge_enabled','responsive_web_grok_analyze_button_fetch_trends_enabled','responsive_web_grok_analyze_post_followups_enabled','rweb_cashtags_composer_attachment_enabled','responsive_web_jetfuel_frame','rweb_sports_post_context_enabled','x_elections_post_context_enabled','responsive_web_grok_share_attachment_enabled','responsive_web_grok_annotations_enabled','articles_preview_enabled','responsive_web_edit_tweet_api_enabled','graphql_is_translatable_rweb_tweet_is_translatable_enabled','view_counts_everywhere_api_enabled','longform_notetweets_consumption_enabled','responsive_web_twitter_article_tweet_consumption_enabled','content_disclosure_indicator_enabled','content_disclosure_ai_generated_indicator_enabled','responsive_web_grok_show_grok_translated_post','responsive_web_grok_analysis_button_from_backend','post_ctas_fetch_enabled','freedom_of_speech_not_reach_fetch_enabled','standardized_nudges_misinfo','tweet_with_visibility_results_prefer_gql_limited_actions_policy_enabled','longform_notetweets_rich_text_read_enabled','longform_notetweets_inline_media_enabled','responsive_web_grok_image_annotation_enabled','responsive_web_grok_community_note_auto_translation_is_enabled','responsive_web_enhance_cards_enabled',]/*** x.com rotates the SearchTimeline query id between deployments. Pull the* current one (and the bearer) straight out of the web app's own bundle.*/async function discoverQueryId(cookies) {const headers = { 'user-agent': xtimeline.UA, accept: 'text/html', cookie: cookies }const home = await fetch('https://x.com/home', {headers,signal: AbortSignal.timeout(25000),})const html = home.status === 200 ? await home.text() : ''const bundles = [...new Set(html.match(/https:\/\/abs\.twimg\.com\/responsive-web\/client-web\/[^"'\s>]+\.js/g) || []),]let queryId = nulllet bearer = nullfor (const url of bundles.slice(0, 4)) {try {const res = await fetch(url, { headers: { 'user-agent': xtimeline.UA }, signal: AbortSignal.timeout(45000) })if (!res.ok) continueconst js = await res.text()const match = /queryId:"([^"]+)",operationName:"SearchTimeline"/.exec(js)if (match) queryId = match[1]const token = /Bearer ([A-Za-z0-9%_-]{60,140})/.exec(js)if (token) bearer = token[1]if (queryId) break} catch {/* try the next bundle */}}if (queryId) await setSetting('x_query_id', queryId)if (bearer) await setSetting('x_bearer', bearer)return { queryId, bearer }}function ct0Of(cookies) {return /(?:^|;\s*)ct0=([^;]+)/.exec(cookies || '')?.[1] || ''}/** One SearchTimeline call. Throws on a stale query id so the caller retries. */async function callSearch(query, { cookies, queryId, bearer, count }) {const body = {variables: {rawQuery: query,count,querySource: 'typed_query',product: 'Latest',withGrokTranslatedBio: false,},features: Object.fromEntries(FEATURES.map((name) => [name, true])),fieldToggles: {withArticleRichContentState: true,withArticlePlainText: false,withGrokAnalyze: false,withDisallowedReplyControls: false,},queryId,}const res = await fetch(`https://x.com/i/api/graphql/${queryId}/SearchTimeline`, {method: 'POST',headers: {authorization: `Bearer ${bearer}`,'x-csrf-token': ct0Of(cookies),cookie: cookies,'content-type': 'application/json','x-twitter-auth-type': 'OAuth2Session','x-twitter-active-user': 'yes','x-twitter-client-language': 'en','user-agent': xtimeline.UA,referer: 'https://x.com/search?q=search&f=live',},body: JSON.stringify(body),signal: AbortSignal.timeout(30000),})if (res.status === 401 || res.status === 403) {const err = new Error('X 登录已失效,请重新复制 Cookie')err.status = 401throw err}if (res.status === 404 || res.status === 400) {const err = new Error(`SearchTimeline 请求被拒绝(HTTP ${res.status})`)err.staleQueryId = truethrow err}if (!res.ok) throw new Error(`X 搜索失败:HTTP ${res.status}`)const json = await res.json().catch(() => null)if (!json) throw new Error('X 搜索返回了无法解析的内容')return xtimeline.tweetsFrom([json])}/** Live search with a given session — GraphQL first, SSR page as fallback. */async function searchWith(cookies, query, { limit = 20 } = {}) {if (!cookies) {const err = new Error('X 未登录')err.status = 400throw err}let queryId = await getSetting('x_query_id')let bearer = (await getSetting('x_bearer')) || FALLBACK_BEARERif (!queryId) {const found = await discoverQueryId(cookies)queryId = found.queryIdbearer = found.bearer || bearer}if (queryId) {try {const tweets = await callSearch(query, { cookies, queryId, bearer, count: limit })if (tweets.length > 0) return tweets.slice(0, limit)} catch (err) {if (!err.staleQueryId) throw err// Query id rotated — rediscover once and retry.const found = await discoverQueryId(cookies)if (found.queryId) {bearer = found.bearer || bearerconst tweets = await callSearch(query, { cookies, queryId: found.queryId, bearer, count: limit })if (tweets.length > 0) return tweets.slice(0, limit)}}}// Fallback: whatever the search page server-renders.return (await xtimeline.fetchSearchTweets(query, cookies)).slice(0, limit)}async function search(query, options) {return searchWith(await getSetting('x_cookies'), query, options)}/** Remember that the stored session stopped working. */15 unmodified lineslet searchCount = 0let searchError = nulltry {const tweets = await searchWith(cookies, '"asksurf.ai/mystery-box"', { limit: 20 })searchCount = tweets.length} catch (err) {searchError = err.message7 unmodified linesmodule.exports = {connect,searchWith,disconnect,status,isConnected,
1 unmodified line2345678 unmodified lines161718192021221 unmodified line242526272829305 unmodified lines363738394041423 unmodified lines464748495051522 unmodified lines555657585960611 unmodified line636465666768695 unmodified lines757677787980811 unmodified lineconst telegram = require('../lib/telegram')const telegramUser = require('../lib/telegramUser')const notify = require('../lib/notify')const { UPSERT_SQL, upsertParams, checkInvites } = require('../lib/mystery')const router = express.Router()8 unmodified lines/* ---- login (user account, so private channels are readable) ---- */router.post('/login/start', async (req, res) => {try {res.json({ ok: true, ...(await telegramUser.startLogin(req.body || {})) })} catch (err) {1 unmodified line}})router.post('/login/code', async (req, res) => {try {const result = await telegramUser.submitCode(req.body || {})if (!result.ok && result.needPassword) {5 unmodified lines}})router.post('/logout', async (_req, res) => {try {res.json({ ok: true, ...(await telegramUser.logout()) })} catch (err) {3 unmodified lines/* ---------------------------- channels / sync ---------------------------- */router.post('/channels', async (req, res) => {try {const result = await telegram.addChannel(req.body?.channel)res.json({ ok: true, ...result })2 unmodified lines}})router.delete('/channels/:channel', async (req, res) => {try {res.json({ ok: true, channels: await telegram.removeChannel(req.params.channel) })} catch (err) {1 unmodified line}})router.post('/sync', async (_req, res) => {try {const result = await telegram.sync({ upsert: UPSERT_SQL, upsertParams })const invites = await checkInvites()5 unmodified lines/* -------------------------------- alerts -------------------------------- */router.post('/notify/test', async (_req, res) => {try {await notify.sendTest()res.json({ ok: true })1 unmodified line234567898 unmodified lines181920212223241 unmodified line262728293031325 unmodified lines383940414243443 unmodified lines484950515253542 unmodified lines575859606162631 unmodified line656667686970715 unmodified lines77787980818283848586878889909192939495969798991001011021031041051 unmodified lineconst telegram = require('../lib/telegram')const telegramUser = require('../lib/telegramUser')const notify = require('../lib/notify')const { requireKey } = require('../lib/auth')const { setSetting } = require('../lib/settings')const { UPSERT_SQL, upsertParams, checkInvites } = require('../lib/mystery')const router = express.Router()8 unmodified lines/* ---- login (user account, so private channels are readable) ---- */router.post('/login/start', requireKey, async (req, res) => {try {res.json({ ok: true, ...(await telegramUser.startLogin(req.body || {})) })} catch (err) {1 unmodified line}})router.post('/login/code', requireKey, async (req, res) => {try {const result = await telegramUser.submitCode(req.body || {})if (!result.ok && result.needPassword) {5 unmodified lines}})router.post('/logout', requireKey, async (_req, res) => {try {res.json({ ok: true, ...(await telegramUser.logout()) })} catch (err) {3 unmodified lines/* ---------------------------- channels / sync ---------------------------- */router.post('/channels', requireKey, async (req, res) => {try {const result = await telegram.addChannel(req.body?.channel)res.json({ ok: true, ...result })2 unmodified lines}})router.delete('/channels/:channel', requireKey, async (req, res) => {try {res.json({ ok: true, channels: await telegram.removeChannel(req.params.channel) })} catch (err) {1 unmodified line}})router.post('/sync', requireKey, async (_req, res) => {try {const result = await telegram.sync({ upsert: UPSERT_SQL, upsertParams })const invites = await checkInvites()5 unmodified lines/* -------------------------------- alerts -------------------------------- */router.get('/notify/config', async (_req, res) => {try {const url = await notify.webhookUrl()res.json({ configured: Boolean(url), hint: url ? `${url.slice(0, 60)}…` : null })} catch (err) {res.status(500).json({ error: err.message })}})router.post('/notify/config', requireKey, async (req, res) => {try {const url = String(req.body?.webhook || '').trim()if (url && !/^https:\/\/qyapi\.weixin\.qq\.com\/cgi-bin\/webhook\/send\?key=/.test(url)) {return res.status(400).json({ error: '请填写企业微信机器人的完整 Webhook 地址' })}await setSetting('wecom_webhook', url)res.json({ ok: true, configured: Boolean(url) })} catch (err) {res.status(400).json({ error: err.message })}})router.post('/notify/test', requireKey, async (_req, res) => {try {await notify.sendTest()res.json({ ok: true })
1234551 unmodified lines575859606162633 unmodified lines676869707172733 unmodified lines77787980818283const express = require('express')const { dbQuery } = require('@surf-ai/sdk/db')const {refresh,quickRefresh,51 unmodified lines}})router.post('/refresh', async (_req, res) => {try {const result = await refresh()res.json({ ok: true, ...result })3 unmodified lines})// Add a post / gift link the user found by searching X manually.router.post('/add', async (req, res) => {try {const result = await ingestManual(req.body?.url)res.json({ ok: true, ...result })3 unmodified lines})// Cheap pass: known-sharer timelines + invite seat checks (no Surf credits).router.post('/quick', async (_req, res) => {try {const result = await quickRefresh()res.json({ ok: true, ...result })12345651 unmodified lines585960616263643 unmodified lines686970717273743 unmodified lines78798081828384const express = require('express')const { dbQuery } = require('@surf-ai/sdk/db')const { requireKey } = require('../lib/auth')const {refresh,quickRefresh,51 unmodified lines}})router.post('/refresh', requireKey, async (_req, res) => {try {const result = await refresh()res.json({ ok: true, ...result })3 unmodified lines})// Add a post / gift link the user found by searching X manually.router.post('/add', requireKey, async (req, res) => {try {const result = await ingestManual(req.body?.url)res.json({ ok: true, ...result })3 unmodified lines})// Cheap pass: known-sharer timelines + invite seat checks (no Surf credits).router.post('/quick', requireKey, async (_req, res) => {try {const result = await quickRefresh()res.json({ ok: true, ...result })
123455 unmodified lines111213141516171 unmodified line192021222324251 unmodified line27282930313233const express = require('express')const xauth = require('../lib/xauth')const router = express.Router()5 unmodified lines}})router.post('/connect', async (req, res) => {try {res.json({ ok: true, ...(await xauth.connect(req.body || {})) })} catch (err) {1 unmodified line}})router.post('/verify', async (_req, res) => {try {res.json({ ok: true, ...(await xauth.verify()) })} catch (err) {1 unmodified line}})router.delete('/', async (_req, res) => {try {res.json({ ok: true, ...(await xauth.disconnect()) })} catch (err) {1234565 unmodified lines121314151617181 unmodified line202122232425261 unmodified line28293031323334const express = require('express')const xauth = require('../lib/xauth')const { requireKey } = require('../lib/auth')const router = express.Router()5 unmodified lines}})router.post('/connect', requireKey, async (req, res) => {try {res.json({ ok: true, ...(await xauth.connect(req.body || {})) })} catch (err) {1 unmodified line}})router.post('/verify', requireKey, async (_req, res) => {try {res.json({ ok: true, ...(await xauth.verify()) })} catch (err) {1 unmodified line}})router.delete('/', requireKey, async (_req, res) => {try {res.json({ ok: true, ...(await xauth.disconnect()) })} catch (err) {
README.md+23-7
frontend/src/components/SourcePanel.tsx+48-1
frontend/tsconfig.tsbuildinfo
lib/auth.jsAdded+27
lib/notify.js+3-5
lib/xauth.js+178-7
routes/telegram.js+31-7
routes/tracker.js+4-3
routes/xauth.js+4-3