apply patches from the old upstream and cleanup
Some checks failed
docker / nitter (push) Failing after 2m29s
docker / session (push) Successful in 1m20s

Signed-off-by: ngn <ngn@ngn.tf>
This commit is contained in:
ngn
2025-05-23 00:53:45 +03:00
parent 9808c6a543
commit d221df59df
54 changed files with 1294 additions and 871 deletions

View File

@ -1,6 +1,5 @@
# SPDX-License-Identifier: AGPL-3.0-only
import asyncdispatch, strformat, logging
import config
from net import Port
from htmlgen import a
from os import getEnv
@ -13,7 +12,13 @@ import routes/[
preferences, timeline, status, media, search, rss, list, debug,
unsupported, embed, resolver, router_utils]
initAccountPool(cfg)
let
configPath = getEnv("NITTER_CONF_FILE", "./nitter.conf")
(cfg, fullCfg) = getConfig(configPath)
sessionsPath = getEnv("NITTER_SESSIONS_FILE", "./sessions.jsonl")
initSessionPool(cfg, sessionsPath)
if not cfg.enableDebug:
# Silence Jester's query warning
@ -66,7 +71,7 @@ routes:
error InternalError:
echo error.exc.name, ": ", error.exc.msg
const link = a("https://git.ngn.tf/ngn/nitter", href = "https://git.ngn.tf/ngn/nitter")
const link = a("ngn@ngn.tf", href = "mailto:ngn@ngn.tf")
resp Http500, showError(
&"An error occurred, please report to {link}", cfg)
@ -78,6 +83,11 @@ routes:
resp Http429, showError(
&"Instance has been rate limited.", cfg)
error NoSessionsError:
const link = a("another instance", href = instancesUrl)
resp Http429, showError(
&"Instance has no auth tokens, or is fully rate limited.<br>Use {link} or try again later.", cfg)
extend rss, ""
extend status, ""
extend search, ""