Gentoo Archives: gentoo-commits

From: Anna Vyalkova <cyber+gentoo@×××××.in>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] repo/proj/guru:dev commit in: www-apps/nitter/files/, www-apps/nitter/
Date: Tue, 05 Jul 2022 20:09:14
Message-Id: 1657051737.e1f7a22751c25fca201b13733c26810c10c31947.cybertailor@gentoo
1 commit: e1f7a22751c25fca201b13733c26810c10c31947
2 Author: Anna (cybertailor) Vyalkova <cyber+gentoo <AT> sysrq <DOT> in>
3 AuthorDate: Mon Jul 4 04:44:31 2022 +0000
4 Commit: Anna Vyalkova <cyber+gentoo <AT> sysrq <DOT> in>
5 CommitDate: Tue Jul 5 20:08:57 2022 +0000
6 URL: https://gitweb.gentoo.org/repo/proj/guru.git/commit/?id=e1f7a227
7
8 www-apps/nitter: new package, add 0.1.0_p20220624
9
10 Signed-off-by: Anna (cybertailor) Vyalkova <cyber+gentoo <AT> sysrq.in>
11
12 www-apps/nitter/Manifest | 1 +
13 www-apps/nitter/files/nitter.conf.example | 48 ++++++++++++++++++++
14 www-apps/nitter/files/nitter.initd | 30 +++++++++++++
15 www-apps/nitter/files/nitter.service | 12 +++++
16 www-apps/nitter/nitter-0.1.0_p20220624.ebuild | 64 +++++++++++++++++++++++++++
17 5 files changed, 155 insertions(+)
18
19 diff --git a/www-apps/nitter/Manifest b/www-apps/nitter/Manifest
20 new file mode 100644
21 index 000000000..cf6b2ddce
22 --- /dev/null
23 +++ b/www-apps/nitter/Manifest
24 @@ -0,0 +1 @@
25 +DIST nitter-0.1.0_p20220624.tar.gz 1177509 BLAKE2B 6aecaea8f0abd9d2568ddda6bb8e39f7fa92dedd1250622333fc8d61927501a40ecec5631484e4bb36e917c5bb51624055587e27e7bb5c367afaffcedf626320 SHA512 1b4dcdb06b0a8850fbc3e1a4ae8df9c35511e34dd41acf7e3c0e41943407ef7d21f2856b2996a7db73f8692f35acb481d4778b93996dfb7c494500032631e0f7
26
27 diff --git a/www-apps/nitter/files/nitter.conf.example b/www-apps/nitter/files/nitter.conf.example
28 new file mode 100644
29 index 000000000..277f55773
30 --- /dev/null
31 +++ b/www-apps/nitter/files/nitter.conf.example
32 @@ -0,0 +1,48 @@
33 +# This is an example. Copy this file to /etc/nitter/nitter.conf and edit to
34 +# match your preferences.
35 +
36 +[Server]
37 +address = "0.0.0.0"
38 +port = 8080
39 +https = false # disable to enable cookies when not using https
40 +httpMaxConnections = 100
41 +staticDir = "/usr/share/nitter/public"
42 +title = "nitter"
43 +hostname = "nitter.net"
44 +
45 +[Cache]
46 +listMinutes = 240 # how long to cache list info (not the tweets, so keep it high)
47 +rssMinutes = 10 # how long to cache rss queries
48 +redisHost = "localhost" # Change to "nitter-redis" if using docker-compose
49 +redisPort = 6379
50 +redisPassword = ""
51 +redisConnections = 20 # connection pool size
52 +redisMaxConnections = 30
53 +# max, new connections are opened when none are available, but if the pool size
54 +# goes above this, they're closed when released. don't worry about this unless
55 +# you receive tons of requests per second
56 +
57 +[Config]
58 +hmacKey = "secretkey" # random key for cryptographic signing of video urls
59 +base64Media = false # use base64 encoding for proxied media urls
60 +enableRSS = true # set this to false to disable RSS feeds
61 +enableDebug = false # enable request logs and debug endpoints
62 +proxy = "" # http/https url, SOCKS proxies are not supported
63 +proxyAuth = ""
64 +tokenCount = 10
65 +# minimum amount of usable tokens. tokens are used to authorize API requests,
66 +# but they expire after ~1 hour, and have a limit of 187 requests.
67 +# the limit gets reset every 15 minutes, and the pool is filled up so there's
68 +# always at least $tokenCount usable tokens. again, only increase this if
69 +# you receive major bursts all the time
70 +
71 +# Change default preferences here, see src/prefs_impl.nim for a complete list
72 +[Preferences]
73 +theme = "Nitter"
74 +replaceTwitter = "nitter.net"
75 +replaceYouTube = "piped.kavin.rocks"
76 +replaceReddit = "teddit.net"
77 +replaceInstagram = "bibliogram.art"
78 +proxyVideos = true
79 +hlsPlayback = false
80 +infiniteScroll = false
81
82 diff --git a/www-apps/nitter/files/nitter.initd b/www-apps/nitter/files/nitter.initd
83 new file mode 100644
84 index 000000000..1d26ed1cf
85 --- /dev/null
86 +++ b/www-apps/nitter/files/nitter.initd
87 @@ -0,0 +1,30 @@
88 +#!/sbin/openrc-run
89 +# Copyright 2022 Gentoo Authors
90 +# Distributed under the terms of the GNU General Public License v2
91 +
92 +: ${NITTER_CONF_FILE:="/etc/nitter/${RC_SVCNAME}.conf"}
93 +export NITTER_CONF_FILE
94 +
95 +command="/usr/bin/nitter"
96 +command_background=yes
97 +command_user="nitter:nitter"
98 +pidfile="/run/${RC_SVCNAME}.pid"
99 +
100 +logpath="/var/log/nitter"
101 +output_log="${logpath}/${RC_SVCNAME}.log"
102 +error_log="${output_log}"
103 +
104 +depend() {
105 + need redis
106 + use net
107 +}
108 +
109 +start_pre() {
110 + checkpath -do "${command_user}" "${logpath}"
111 + checkpath -fo "${command_user}" "${output_log}"
112 +
113 + if [ ! -f "${NITTER_CONF_FILE}" ]; then
114 + eerror "Configuration file '${NITTER_CONF_FILE}' not found"
115 + return 1
116 + fi
117 +}
118
119 diff --git a/www-apps/nitter/files/nitter.service b/www-apps/nitter/files/nitter.service
120 new file mode 100644
121 index 000000000..443fecd49
122 --- /dev/null
123 +++ b/www-apps/nitter/files/nitter.service
124 @@ -0,0 +1,12 @@
125 +[Unit]
126 +Description=Nitter
127 +After=network.service
128 +Requires=redis.service
129 +
130 +[Service]
131 +User=nitter
132 +Environment="NITTER_CONF_FILE=/etc/nitter/nitter.conf"
133 +ExecStart=/usr/bin/nitter
134 +
135 +[Install]
136 +WantedBy=multi-user.target
137
138 diff --git a/www-apps/nitter/nitter-0.1.0_p20220624.ebuild b/www-apps/nitter/nitter-0.1.0_p20220624.ebuild
139 new file mode 100644
140 index 000000000..acb82fc3c
141 --- /dev/null
142 +++ b/www-apps/nitter/nitter-0.1.0_p20220624.ebuild
143 @@ -0,0 +1,64 @@
144 +# Copyright 2022 Gentoo Authors
145 +# Distributed under the terms of the GNU General Public License v2
146 +
147 +EAPI=8
148 +
149 +inherit nimble systemd
150 +
151 +COMMIT="81ec41328d5684dd395f584254d723abee213ac0"
152 +DESCRIPTION="An alternative front-end for Twitter"
153 +HOMEPAGE="https://github.com/zedeus/nitter"
154 +SRC_URI="https://github.com/zedeus/${PN}/archive/${COMMIT}.tar.gz -> ${P}.tar.gz"
155 +S="${WORKDIR}/${PN}-${COMMIT}"
156 +
157 +LICENSE="AGPL-3"
158 +SLOT="0"
159 +KEYWORDS="~amd64"
160 +
161 +RESTRICT="test"
162 +PROPERTIES="test_network"
163 +
164 +RDEPEND="
165 + acct-user/nitter
166 + dev-db/redis
167 + dev-nim/flatty
168 + dev-nim/jester
169 + dev-nim/jsony
170 + dev-nim/karax
171 + dev-nim/nimcrypto
172 + dev-nim/packedjson
173 + dev-nim/redpool
174 + dev-nim/supersnappy
175 + dev-nim/zedeus_redis
176 + dev-nim/zippy
177 +"
178 +DEPEND="
179 + dev-nim/markdown
180 + dev-nim/sass
181 +"
182 +
183 +src_configure() {
184 + nimble_src_configure
185 +
186 + # Error: unhandled exception: cannot open: public/lp.svg
187 + ln -s "${S}"/public ${BUILD_DIR}/public || die
188 +}
189 +
190 +src_compile() {
191 + nimble_src_compile
192 + enim r tools/gencss
193 + enim r tools/rendermd
194 +}
195 +
196 +src_install() {
197 + nimble_src_install
198 +
199 + newinitd "${FILESDIR}"/nitter.initd ${PN}
200 + systemd_dounit "${FILESDIR}"/nitter.service
201 +
202 + insinto /etc/nitter
203 + doins "${FILESDIR}"/nitter.conf.example
204 +
205 + insinto /usr/share/nitter
206 + doins -r public
207 +}