Initial commit, my theme + changes + about.md

This commit is contained in:
Eir Sunny 2024-12-17 21:21:34 -06:00
parent da09fbcaf5
commit ec60cfc24d
21 changed files with 218 additions and 95 deletions

BIN
public/css/fonts/Hack-Bold.ttf Executable file

Binary file not shown.

Binary file not shown.

BIN
public/css/fonts/Hack-Italic.ttf Executable file

Binary file not shown.

BIN
public/css/fonts/Hack-Regular.ttf Executable file

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

99
public/css/themes/eir.css Executable file
View File

@ -0,0 +1,99 @@
@font-face {
font-family: hack;
src: url("../fonts/Hack-Regular.ttf");
}
@font-face {
font-family: hack;
src: url("../fonts/Hack-Bold.ttf");
font-weight: bold;
}
@font-face {
font-family: hack;
src: url("../fonts/Hack-Italic.ttf");
font-style: italic;
}
@font-face {
font-family: hack;
src: url("../fonts/Hack-BoldItalic.ttf");
font-weight: bold;
font-style: italic;
}
@font-face {
font-family: Terminess;
src: url("../fonts/TerminessNerdFontMono-Regular.ttf");
}
@font-face {
font-family: Terminess;
src: url("../fonts/TerminessNerdFontMono-Bold.ttf");
font-weight: bold;
}
@font-face {
font-family: Terminess;
src: url("../fonts/TerminessNerdFontMono-Italic.ttf");
font-style: italic;
}
@font-face {
font-family: Terminess;
src: url("../fonts/TerminessNerdFontMono-BoldItalic.ttf");
font-weight: bold;
font-style: italic;
}
body {
background: linear-gradient(rgba(130, 88, 88, 0.875), rgba(130, 88, 88, 0.5)), url("https://eir-nya.gay/res/images/cubes.png");
background: -webkit-linear-gradient(rgba(130, 88, 88, 0.875), rgba(130, 88, 88, 0.5)), url("https://eir-nya.gay/res/images/cubes.png");
background: -moz-linear-gradient(rgba(130, 88, 88, 0.875), rgba(130, 88, 88, 0.5)), url("https://eir-nya.gay/res/images/cubes.png");
background: -o-linear-gradient(rgba(130, 88, 88, 0.875), rgba(130, 88, 88, 0.5)), url("https://eir-nya.gay/res/images/cubes.png");
background: -ms-linear-gradient(rgba(130, 88, 88, 0.875), rgba(130, 88, 88, 0.5)), url("https://eir-nya.gay/res/images/cubes.png");
background-attachment: fixed;
font-family: Terminess, hack, 'Courier New', courier, monospace;
}
.tweet-content {
font-family: hack, 'Courier New', courier, monospace;
}
.show-more {
background-color: transparent;
}
body {
--bg_color: transparent; /*#282a36;*/
--fg_color: #f8f8f2;
--fg_faded: #818eb6;
--fg_dark: var(--fg_faded);
--fg_nav: var(--accent);
--bg_panel: rgba(0.9803921568627451, 0.6666666666666666, 0.6705882352941176, 0.875); /*#343746;*/
--bg_elements: #292b36;
--bg_overlays: #20202080; /*#44475a;*/
--bg_hover: #2f323f;
--grey: var(--fg_faded);
--dark_grey: #44475a;
--darker_grey: #3d4051;
--darkest_grey: #363948;
--border_grey: #44475a;
--accent: #faaaab;
--accent_light: #facdce;
--accent_dark: #ab7475;
--accent_border: #e36f7196;
--play_button: #ffb86c;
--play_button_hover: #ffc689;
--more_replies_dots: #bd93f9;
--error_red: #ff5555;
--verified_blue: var(--accent);
--icon_text: ##F8F8F2;
--tab: #6272a4;
--tab_selected: var(--accent);
--profile_stat: #919cbf;
}
.search-bar > form input::placeholder{
color: var(--fg_faded);
}

7
public/js/eirResources.js Executable file
View File

@ -0,0 +1,7 @@
let eirTheme = document.querySelector("link[href='/css/themes/eir.css']");
if (eirTheme != null) {
let cursorScr = document.createElement("script");
cursorScr.src = "/res/js/cursors.js";
cursorScr.defer = "";
document.getElementsByTagName("head")[0].appendChild(cursorScr);
}

0
public/js/hls.min.js → public/js/hls.light.min.js vendored Normal file → Executable file
View File

View File

@ -1,81 +1,89 @@
# About # My instance
Nitter is a free and open source alternative Twitter front-end focused on
privacy and performance. The source is available on GitHub at
<https://github.com/zedeus/nitter>
**This instance is running a fork, whose source can be found at** **This instance is running a fork, whose source can be found at**
<https://gitlab.com/Cynosphere/nitter> <https://git.eir-nya.gay/eir/nitter>.
* No JavaScript or ads My fork is based on [Cynthia Foxwell's fork](https://gitlab.com/Cynosphere/nitter).
* All requests go through the backend, client never talks to Twitter Nitter is created by Zedeus, whose source can be found at <https://github.com/zedeus/nitter>.
* Prevents Twitter from tracking your IP or JavaScript fingerprint
* Uses Twitter's unofficial API (no rate limits or developer account required)
* Lightweight (for [@nim_lang](/nim_lang), 60KB vs 784KB from twitter.com)
* RSS feeds
* Themes
* Mobile support (responsive design)
* AGPLv3 licensed, no proprietary instances permitted
Nitter's GitHub wiki contains The rest of this page is copied from Cynthia's fork:
[instances](https://github.com/zedeus/nitter/wiki/Instances) and
[browser extensions](https://github.com/zedeus/nitter/wiki/Extensions)
maintained by the community.
### Fork features > # About
>
* Localized following via cookies (list exportable and editable in preferences) > Nitter is a free and open source alternative Twitter front-end focused on
* Image zooming/carousel (requires JavaScript) > privacy and performance.
* Up to date Twitter features, e.g. Community Notes >
* Embeds for chat services on-par with services like [FxTwitter](https://github.com/FixTweet/FxTwitter) and [vxTwitter](https://github.com/dylanpdx/BetterTwitFix) > * No JavaScript or ads
> * All requests go through the backend, client never talks to Twitter
## Why use Nitter? > * Prevents Twitter from tracking your IP or JavaScript fingerprint
> * Uses Twitter's unofficial API (no rate limits or developer account required)
It's impossible to use Twitter without JavaScript enabled. For privacy-minded > * Lightweight (for [@nim_lang](/nim_lang), 60KB vs 784KB from twitter.com)
folks, preventing JavaScript analytics and IP-based tracking is important, but > * RSS feeds
apart from using a VPN and uBlock/uMatrix, it's impossible. Despite being behind > * Themes
a VPN and using heavy-duty adblockers, you can get accurately tracked with your > * Mobile support (responsive design)
[browser's fingerprint](https://restoreprivacy.com/browser-fingerprinting/), > * AGPLv3 licensed, no proprietary instances permitted (source code below)
[no JavaScript required](https://noscriptfingerprint.com/). This all became >
particularly important after Twitter [removed the > Nitter's GitHub wiki contains
ability](https://www.eff.org/deeplinks/2020/04/twitter-removes-privacy-option-and-shows-why-we-need-strong-privacy-laws) > [instances](https://github.com/zedeus/nitter/wiki/Instances) and
for users to control whether their data gets sent to advertisers. > [browser extensions](https://github.com/zedeus/nitter/wiki/Extensions)
> maintained by the community.
Using an instance of Nitter (hosted on a VPS for example), you can browse >
Twitter without JavaScript while retaining your privacy. In addition to > ### Fork features by Cynthia Foxwell
respecting your privacy, Nitter is on average around 15 times lighter than >
Twitter, and in most cases serves pages faster (eg. timelines load 2-4x faster). > * Localized following via cookies (list exportable and editable in preferences)
> * Image zooming/carousel (requires JavaScript)
## Donating > * Up to date Twitter features, e.g. Community Notes
> * Embeds for chat services on-par with services like [FxTwitter](https://github.com/FixTweet/FxTwitter) and [vxTwitter](https://github.com/dylanpdx/BetterTwitFix)
Even though I could be selfish and point people to donate to me instead of >
Zedeus, it would be disrespectful. > ## Why use Nitter?
>
GitHub Sponsors: <https://github.com/sponsors/zedeus> \ > It's impossible to use Twitter without JavaScript enabled. For privacy-minded
Liberapay: <https://liberapay.com/zedeus> \ > folks, preventing JavaScript analytics and IP-based tracking is important, but
Patreon: <https://patreon.com/nitter> \ > apart from using a VPN and uBlock/uMatrix, it's impossible. Despite being behind
BTC: bc1qp7q4qz0fgfvftm5hwz3vy284nue6jedt44kxya \ > a VPN and using heavy-duty adblockers, you can get accurately tracked with your
ETH: 0x66d84bc3fd031b62857ad18c62f1ba072b011925 \ > [browser's fingerprint](https://restoreprivacy.com/browser-fingerprinting/),
LTC: ltc1qhsz5nxw6jw9rdtw9qssjeq2h8hqk2f85rdgpkr \ > [no JavaScript required](https://noscriptfingerprint.com/). This all became
XMR: 42hKayRoEAw4D6G6t8mQHPJHQcXqofjFuVfavqKeNMNUZfeJLJAcNU19i1bGdDvcdN6romiSscWGWJCczFLe9RFhM3d1zpL > particularly important after Twitter [removed the
> ability](https://www.eff.org/deeplinks/2020/04/twitter-removes-privacy-option-and-shows-why-we-need-strong-privacy-laws)
## Credits > for users to control whether their data gets sent to advertisers.
>
* Zedeus for this project > Using an instance of Nitter (hosted on a VPS for example), you can browse
* PrivacyDevel, cmj, and taskylizard for keeping this project alive with forks after the main repo went inactive > Twitter without JavaScript while retaining your privacy. In addition to
* Every other contributors who've committed to the main repo in the past > respecting your privacy, Nitter is on average around 15 times lighter than
> Twitter, and in most cases serves pages faster (eg. timelines load 2-4x faster).
## To any law enforcement agencies and copyright holders >
> ## Donating
**All illegal content should be reported to Twitter directly.** This service is >
merely a proxy of Twitter and no content is hosted on this server. Do not waste > Even though I could be selfish and point people to donate to me instead of
your time contacting internet service providers, hosting providers and/or domain > Zedeus, it would be disrespectful.
registrars. >
> GitHub Sponsors: <https://github.com/sponsors/zedeus> \
If you would like more context, you can read about this exact issue happening to > Donations go to zedeus, original creator of Nitter.
[PussTheCat.org's instance](https://pussthecat.org/nitter/). >
> Liberapay: <https://liberapay.com/zedeus> \
I emplore all Nitter instance hosts to not enable media proxying, even if it > Patreon: <https://patreon.com/nitter> \
"phones home" to Twitter's CDN (which doesn't really pose a tracking risk and > BTC: bc1qp7q4qz0fgfvftm5hwz3vy284nue6jedt44kxya \
breaks videos anyways), as it [has been used as an attack vector to take down > ETH: 0x66d84bc3fd031b62857ad18c62f1ba072b011925 \
nitter.net](https://github.com/zedeus/nitter/issues/1150#issuecomment-1890855255). > LTC: ltc1qhsz5nxw6jw9rdtw9qssjeq2h8hqk2f85rdgpkr \
> XMR: 42hKayRoEAw4D6G6t8mQHPJHQcXqofjFuVfavqKeNMNUZfeJLJAcNU19i1bGdDvcdN6romiSscWGWJCczFLe9RFhM3d1zpL
>
> ## Credits
>
> * Zedeus for this project
> * PrivacyDevel, cmj, and taskylizard for keeping this project alive with forks after the main repo went inactive
> * Every other contributors who've committed to the main repo in the past
>
> ## To any law enforcement agencies and copyright holders
>
> **All illegal content should be reported to Twitter directly.** This service is
> merely a proxy of Twitter and no content is hosted on this server. Do not waste
> your time contacting internet service providers, hosting providers and/or domain
> registrars.
>
> If you would like more context, you can read about this exact issue happening to
> [PussTheCat.org's instance](https://pussthecat.org/nitter/).
>
> I emplore all Nitter instance hosts to not enable media proxying, even if it
> "phones home" to Twitter's CDN (which doesn't really pose a tracking risk and
> breaks videos anyways), as it [has been used as an attack vector to take down
> nitter.net](https://github.com/zedeus/nitter/issues/1150#issuecomment-1890855255).

View File

@ -1,6 +1,6 @@
{ {
"name": "Nitter", "name": "Kitter",
"short_name": "Nitter", "short_name": "Kitter",
"icons": [ "icons": [
{ {
"src": "/android-chrome-192x192.png", "src": "/android-chrome-192x192.png",
@ -18,7 +18,7 @@
"type": "image/png" "type": "image/png"
} }
], ],
"theme_color": "#333333", "theme_color": "#faaaab",
"background_color": "#333333", "background_color": "#faaaab",
"display": "standalone" "display": "standalone"
} }

View File

@ -22,6 +22,7 @@ proc getConfig*(path: string): (Config, parseCfg.Config) =
httpMaxConns: cfg.get("Server", "httpMaxConnections", 100), httpMaxConns: cfg.get("Server", "httpMaxConnections", 100),
staticDir: cfg.get("Server", "staticDir", "./public"), staticDir: cfg.get("Server", "staticDir", "./public"),
title: cfg.get("Server", "title", "Nitter"), title: cfg.get("Server", "title", "Nitter"),
oembedColor: cfg.get("Server", "oembedColor", "#1F1F1F"),
hostname: cfg.get("Server", "hostname", "nitter.net"), hostname: cfg.get("Server", "hostname", "nitter.net"),
# Cache # Cache

View File

@ -14,7 +14,7 @@ import routes/[
activityspoof] activityspoof]
const instancesUrl = "https://github.com/zedeus/nitter/wiki/Instances" const instancesUrl = "https://github.com/zedeus/nitter/wiki/Instances"
const issuesUrl = "https://gitlab.com/Cynosphere/nitter/issues" const issuesUrl = "https://git.eir-nya.gay/eir/nitter/issues"
#let accountsPath = getEnv("NITTER_ACCOUNTS_FILE", "./guest_accounts.json") #let accountsPath = getEnv("NITTER_ACCOUNTS_FILE", "./guest_accounts.json")

View File

@ -59,6 +59,9 @@ genPrefs:
theme(select, "Nitter"): theme(select, "Nitter"):
"Theme" "Theme"
eirResources(checkbox, true):
"Some extra silly js I added, like cursors :3"
infiniteScroll(checkbox, false): infiniteScroll(checkbox, false):
"Infinite scrolling (experimental, requires JavaScript)" "Infinite scrolling (experimental, requires JavaScript)"

View File

@ -110,7 +110,7 @@ proc createActivityPubRouter*(cfg: Config) =
let image = getUrlPrefix(cfg) & getPicUrl(imageObj.url) let image = getUrlPrefix(cfg) & getPicUrl(imageObj.url)
var mediaObj = newJObject() var mediaObj = newJObject()
mediaObj["id"] = %"150745989836308480" # idk if discord even parses this snowflake, but its my user id why not mediaObj["id"] = %"138733266285887488" # idk if discord even parses this snowflake, but its my user id why not
mediaObj["type"] = %"image" mediaObj["type"] = %"image"
mediaObj["url"] = %image mediaObj["url"] = %image
mediaObj["preview_url"] = %image mediaObj["preview_url"] = %image
@ -134,7 +134,7 @@ proc createActivityPubRouter*(cfg: Config) =
if videoObj.description.len > 0: if videoObj.description.len > 0:
description = videoObj.description description = videoObj.description
mediaObj["id"] = %"150745989836308480" mediaObj["id"] = %"138733266285887488"
mediaObj["type"] = %"video" mediaObj["type"] = %"video"
mediaObj["url"] = %videoUrl mediaObj["url"] = %videoUrl
mediaObj["preview_url"] = %videoPreview mediaObj["preview_url"] = %videoPreview
@ -153,7 +153,7 @@ proc createActivityPubRouter*(cfg: Config) =
gifPreview = getUrlPrefix(cfg) & getPicUrl(gif.thumb) gifPreview = getUrlPrefix(cfg) & getPicUrl(gif.thumb)
var mediaObj = newJObject() var mediaObj = newJObject()
mediaObj["id"] = %"150745989836308480" mediaObj["id"] = %"138733266285887488"
mediaObj["type"] = %"video" mediaObj["type"] = %"video"
mediaObj["url"] = %gifUrl mediaObj["url"] = %gifUrl
mediaObj["preview_url"] = %gifPreview mediaObj["preview_url"] = %gifPreview
@ -321,19 +321,19 @@ proc createActivityPubRouter*(cfg: Config) =
var nodeinfo = newJObject() var nodeinfo = newJObject()
nodeinfo["version"] = %"2.1" nodeinfo["version"] = %"2.1"
nodeinfo["software"] = %*{ nodeinfo["software"] = %*{
"name": "Nitter", "name": cfg.title,
"repository": "https://gitlab.com/Cynosphere/nitter" "repository": "https://git.eir-nya.gay/eir/nitter"
} }
var metadata = newJObject() var metadata = newJObject()
metadata["features"] = newJArray() metadata["features"] = newJArray()
metadata["federation"] = newJObject() metadata["federation"] = newJObject()
metadata["nodeDescription"] = %"Alternative Twitter front-end (ActivityPub support added for Discord)" metadata["nodeDescription"] = %"Alternative Twitter front-end (ActivityPub support added for Discord)"
metadata["nodeName"] = %"Nitter" metadata["nodeName"] = %cfg.title
metadata["private"] = %true metadata["private"] = %true
metadata["maintainer"] = %*{ metadata["maintainer"] = %*{
"name": "Cynthia", "name": "Eir",
"email": "gamers@riseup.net" "email": "eir@eir-nya.gay"
} }
nodeinfo["metadata"] = metadata nodeinfo["metadata"] = metadata

View File

@ -286,6 +286,7 @@ type
useHttps*: bool useHttps*: bool
httpMaxConns*: int httpMaxConns*: int
title*: string title*: string
oembedColor*: string
hostname*: string hostname*: string
staticDir*: string staticDir*: string

View File

@ -5,7 +5,7 @@ import karax/[karaxdsl, vdom]
const const
date = staticExec("git show -s --format=\"%cd\" --date=format:\"%Y.%m.%d\"") date = staticExec("git show -s --format=\"%cd\" --date=format:\"%Y.%m.%d\"")
hash = staticExec("git show -s --format=\"%h\"") hash = staticExec("git show -s --format=\"%h\"")
link = "https://gitlab.com/Cynosphere/nitter/commit/" & hash link = "https://git.eir-nya.gay/eir/nitter/commit/" & hash
version = &"{date}-{hash}" version = &"{date}-{hash}"
var aboutHtml: string var aboutHtml: string

View File

@ -23,11 +23,11 @@ proc renderVideoEmbed*(tweet: Tweet; cfg: Config; req: Request): string =
result = doctype & $node result = doctype & $node
proc generateOembed*(cfg: Config; typ, title, user, url, provider: string): JsonNode = proc generateOembed*(cfg: Config; typ, title, user, url: string, provider: string): JsonNode =
%*{ %*{
"type": typ, "type": typ,
"version": "1.0", "version": "1.0",
"provider_name": provider, "provider_name": provider, #cfg.title,
"provider_url": getUrlPrefix(cfg), "provider_url": getUrlPrefix(cfg),
"title": title, "title": title,
"author_name": user, "author_name": user,

View File

@ -86,6 +86,10 @@ proc renderHead*(prefs: Prefs; cfg: Config; req: Request; titleText=""; desc="";
if prefs.infiniteScroll: if prefs.infiniteScroll:
script(src="/js/infiniteScroll.js", `defer`="") script(src="/js/infiniteScroll.js", `defer`="")
# Eir: load custom js
if prefs.eirResources:
script(src="/js/eirResources.js", `defer`="")
title: title:
if titleText.len > 0: if titleText.len > 0:
text titleText & " | " & cfg.title text titleText & " | " & cfg.title
@ -96,7 +100,7 @@ proc renderHead*(prefs: Prefs; cfg: Config; req: Request; titleText=""; desc="";
let finalizedDesc = stripHtml(desc) let finalizedDesc = stripHtml(desc)
meta(name="viewport", content="width=device-width, initial-scale=1.0") meta(name="viewport", content="width=device-width, initial-scale=1.0")
meta(name="theme-color", content="#1F1F1F") meta(name="theme-color", content=cfg.oembedColor)
meta(property="og:type", content=ogType) meta(property="og:type", content=ogType)
if video.len > 0 and len(finalizedDesc) <= 67: if video.len > 0 and len(finalizedDesc) <= 67:
meta(property="og:title", content=finalizedDesc) meta(property="og:title", content=finalizedDesc)
@ -106,7 +110,7 @@ proc renderHead*(prefs: Prefs; cfg: Config; req: Request; titleText=""; desc="";
meta(property="og:locale", content="en_US") meta(property="og:locale", content="en_US")
meta(name="referrer", content="no-referrer") meta(name="referrer", content="no-referrer")
var siteName = "Nitter" var siteName = cfg.title
if time.isSome: if time.isSome:
let timeObj = time.get let timeObj = time.get
let timeStr = $timeObj let timeStr = $timeObj
@ -114,7 +118,7 @@ proc renderHead*(prefs: Prefs; cfg: Config; req: Request; titleText=""; desc="";
if not isDiscord: if not isDiscord:
let formattedTime = timeObj.format("yyyy/MM/dd HH:mm:ss") let formattedTime = timeObj.format("yyyy/MM/dd HH:mm:ss")
siteName &= &" • {formattedTime}" siteName = &"{siteName} • {formattedTime}"
if stats.len > 0: if stats.len > 0:
siteName &= "\n" & stats siteName &= "\n" & stats