summarylogtreecommitdiffstats
diff options
context:
space:
mode:
authorsomini2020-06-14 00:14:36 +0100
committersomini2020-06-14 00:14:36 +0100
commit4ac859bc4c967131f828754dd34a3878af018810 (patch)
tree351227677cfb845df840f80649e2095d033e7ac3
downloadaur-4ac859bc4c967131f828754dd34a3878af018810.tar.gz
Initial release
-rw-r--r--.SRCINFO25
-rw-r--r--.gitignore4
-rw-r--r--PKGBUILD59
-rw-r--r--config.patch48
-rw-r--r--nitter.service10
-rwxr-xr-xnitter.sh3
-rw-r--r--tmpfilesd.conf1
7 files changed, 150 insertions, 0 deletions
diff --git a/.SRCINFO b/.SRCINFO
new file mode 100644
index 00000000000..fc199c0f073
--- /dev/null
+++ b/.SRCINFO
@@ -0,0 +1,25 @@
+pkgbase = nitter-git
+ pkgdesc = Alternative Twitter front-end
+ pkgver = latest
+ pkgrel = 1
+ url = https://github.com/zedeus/nitter
+ arch = x86_64
+ license = AGPL3
+ makedepends = git
+ makedepends = nim
+ makedepends = nimble
+ makedepends = libsass
+ depends = redis
+ source = nitter-git::git+https://github.com/zedeus/nitter.git#branch=master
+ source = config.patch
+ source = tmpfilesd.conf
+ source = nitter.sh
+ source = nitter.service
+ sha256sums = SKIP
+ sha256sums = 18399b0ea27d3750f4739e3d17327ba373f5247e4c8552051a50fa3e8e5631f1
+ sha256sums = 832d2963389270332e50da95082d43babbe40124dc2d7177bb19eefac9586891
+ sha256sums = 79469c5cfeacf38c7469a2240ba5c19670ddaf757e6d1b5286206a18a0718487
+ sha256sums = 3c09448a6e9da6afd2554e06c1718e02ed8f037375611057ef7ab52c3dc02371
+
+pkgname = nitter-git
+
diff --git a/.gitignore b/.gitignore
new file mode 100644
index 00000000000..e131e664e24
--- /dev/null
+++ b/.gitignore
@@ -0,0 +1,4 @@
+/nitter-git/
+/src/
+/pkg/
+*.tar.*
diff --git a/PKGBUILD b/PKGBUILD
new file mode 100644
index 00000000000..44f223bfaaa
--- /dev/null
+++ b/PKGBUILD
@@ -0,0 +1,59 @@
+# Maintainer: somini <dev@somini.xyz>
+pkgname=nitter-git
+pkgver=latest
+pkgrel=1
+pkgdesc="Alternative Twitter front-end"
+url="https://github.com/zedeus/nitter"
+depends=('redis')
+makedepends=('git' 'nim' 'nimble' 'libsass')
+license=('AGPL3')
+arch=('x86_64')
+source=("$pkgname::git+$url.git#branch=master"
+ "config.patch"
+ "tmpfilesd.conf"
+ "nitter.sh"
+ "nitter.service")
+sha256sums=('SKIP'
+ '18399b0ea27d3750f4739e3d17327ba373f5247e4c8552051a50fa3e8e5631f1'
+ '832d2963389270332e50da95082d43babbe40124dc2d7177bb19eefac9586891'
+ '79469c5cfeacf38c7469a2240ba5c19670ddaf757e6d1b5286206a18a0718487'
+ '3c09448a6e9da6afd2554e06c1718e02ed8f037375611057ef7ab52c3dc02371')
+
+pkgver() {
+ cd "$pkgname"
+ ( set -o pipefail
+ git describe --long 2>/dev/null | sed 's/\([^-]*-g\)/r\1/;s/-/./g' ||
+ printf "r%s.%s" "$(git rev-list --count HEAD)" "$(git rev-parse --short HEAD)"
+ )
+}
+
+build() {
+ cd "${srcdir}/$pkgname"
+
+ # Based on the Dockerfile
+ nimble build -y -d:release
+ strip -s nitter
+ nimble scss
+}
+
+package() {
+ # Create the cache directory
+ install -D -m644 tmpfilesd.conf "$pkgdir/usr/lib/tmpfiles.d/nitter.conf"
+ # SystemD service
+ install -D -m644 nitter.service -t "$pkgdir/usr/lib/systemd/system"
+ # Use a wrapper script as entrypoint
+ install -D -m755 nitter.sh "$pkgdir/usr/bin/nitter"
+
+ main_dir="$pkgdir/usr/share/nitter"
+ install -dD "$main_dir"
+
+ cd "${srcdir}/$pkgname"
+ # Main EXE
+ install -D -m755 nitter -t "$main_dir"
+ # Patched Configuration File
+ install -D -m600 nitter.conf -t "$pkgdir/etc"
+ ## Link it on the "working" directory
+ ln -sv "/etc/nitter.conf" "$main_dir/nitter.conf"
+ # Public Folder
+ cp -r --no-preserve=all public -t "$main_dir"
+}
diff --git a/config.patch b/config.patch
new file mode 100644
index 00000000000..0eca7245b57
--- /dev/null
+++ b/config.patch
@@ -0,0 +1,48 @@
+diff --git i/nitter.conf w/nitter.conf
+index 99b0d18..e1dbae1 100644
+--- i/nitter.conf
++++ w/nitter.conf
+@@ -1,13 +1,13 @@
+ [Server]
+-address = "0.0.0.0"
+-port = 8080
++address = "localhost" # Change this?
++port = 13500 # Change this?
+ https = false # disable to enable cookies when not using https
+-staticDir = "./public"
+-title = "nitter"
+-hostname = "nitter.net"
++staticDir = "/usr/share/nitter/public"
++title = "nitter" # Change this?
++hostname = "nitter.net" # Change this
+
+ [Cache]
+-directory = "./tmp"
++directory = "/var/cache/nitter"
+ listMinutes = 240 # how long to cache list info (not the tweets, so keep it high)
+ rssMinutes = 10 # how long to cache rss queries
+ redisHost = "localhost"
+@@ -19,8 +19,8 @@ redisMaxConnections = 30
+ # you receive tons of requests per second
+
+ [Config]
+-hmacKey = "secretkey" # random key for cryptographic signing of video urls
+-base64Media = false # use base64 encoding for proxied media urls
++hmacKey = "43179cf305cda132874f7a4d3fa4831a01528e516780157bebd564b0ca0297c2" # Regenerate e.g. `head -c 25 </dev/urandom | sha256sum`
++base64Media = true # use base64 encoding for proxied media urls
+ tokenCount = 10
+ # minimum amount of usable tokens. tokens are used to authorize API requests,
+ # but they expire after ~1 hour, and have a limit of 187 requests.
+@@ -30,9 +30,9 @@ tokenCount = 10
+
+ # Change default preferences here, see src/prefs_impl.nim for a complete list
+ [Preferences]
+-theme = "Nitter"
+-replaceTwitter = "nitter.net"
+-replaceYouTube = "invidio.us"
++theme = "twitter_dark" # Change this?
++replaceTwitter = "nitter.net" # Use the same "hostname" as above
++replaceYouTube = ""
+ replaceInstagram = ""
+ proxyVideos = true
+ hlsPlayback = false
diff --git a/nitter.service b/nitter.service
new file mode 100644
index 00000000000..ce2c1157152
--- /dev/null
+++ b/nitter.service
@@ -0,0 +1,10 @@
+[Unit]
+Description=Nitter Daemon
+Requires=redis.service
+After=redis.service
+
+[Service]
+ExecStart=/usr/bin/nitter
+
+[Install]
+WantedBy=multi-user.target
diff --git a/nitter.sh b/nitter.sh
new file mode 100755
index 00000000000..e7392e1b5c8
--- /dev/null
+++ b/nitter.sh
@@ -0,0 +1,3 @@
+#!/bin/sh
+cd /usr/share/nitter && \
+ exec ./nitter
diff --git a/tmpfilesd.conf b/tmpfilesd.conf
new file mode 100644
index 00000000000..52e78414b03
--- /dev/null
+++ b/tmpfilesd.conf
@@ -0,0 +1 @@
+d /var/cache/nitter 0750 root root