nitterのアップグレードメモ(2022-03)

Nitterをセルフホストしています.

最新に追従しているのですが,以前と少し手順が変わっているので上の記事に補足する形でメモしておきます.

sourceの更新とビルド準備
$ sudo su - nitter	(1)
$ cd ~/nitter	(2)
$ git pull	(3)
$ pandoc ./README.md -o - | w3m -T text/htm
$ export PATH=~/nim-1.6.4/bin:${PATH}	(4)
$ echo $PATH
/home/nitter/nim-1.6.4/bin:/home/nitter/bin:/usr/local/bin:/usr/bin:/bin
$ nim -v	(5)
Nim Compiler Version 1.6.4 [Linux: amd64]
Compiled at 2022-02-09
Copyright (c) 2006-2021 by Andreas Rumpf

git hash: 7994556f3804c217035c44b453a3feec64405758
active boot switches: -d:release
  1. nitter アカウントに変更
  2. nitter のsourceディレクトリへ移動
  3. nitter のsourceをpull
  4. 一時的に nim の PATH を通す
  5. nim が使いたいバージョンに向いているのを確認
nitterのbuildと設定
$ nimble build -d:release
$ nimble scss
$ vi public/md/about.md	(1)
$ nimble md	(2)
$ diff -u ./nitter.example.conf ./nitter.conf	(3)
--- ./nitter.example.conf       2022-02-15 00:03:01.628730418 +0900
+++ ./nitter.conf       2022-03-11 22:53:41.944448701 +0900
@@ -1,11 +1,11 @@
 [Server]
-address = "0.0.0.0"
-port = 8080
-https = false  # disable to enable cookies when not using https
+address = "localhost"
+port = 8081
+https = true  # disable to enable cookies when not using https
 httpMaxConnections = 100
 staticDir = "./public"
 title = "nitter"
-hostname = "nitter.net"
+hostname = "nitter.matoken.org"

 [Cache]
 listMinutes = 240  # how long to cache list info (not the tweets, so keep it high)
@@ -25,6 +25,7 @@
 enableRSS = true  # set this to false to disable RSS feeds
 enableDebug = false  # enable request logs and debug endpoints
 proxy = ""  # http/https url, SOCKS proxies are not supported
+#proxy = "http://153.121.44.87:8888"  # http/https url, SOCKS proxies are not supported
 proxyAuth = ""
 tokenCount = 10
 # minimum amount of usable tokens. tokens are used to authorize API requests,
@@ -42,4 +43,4 @@
 replaceInstagram = ""
 proxyVideos = true
 hlsPlayback = false
-infiniteScroll = false
+infiniteScroll = true
$ vi ./nitter.conf
$ exit
$ sudo service nitter restart
  1. 必要なら ${NITTER_URL}/about の元になる about.md を編集
  2. markdownをhtmlに変換(about.md以外のファイルをおいても変換されるが表示は出来ない?)
  3. nitter.conf を確認して設定の増減があったら追従する

以前はなかったabout.mdはこのインスタンスは誰が管理していますと書いておくのもいいかなと思います.
設定のproxyを使うと,Twitterにアクセス制限されたときに簡単に切り替えることができそうです.

環境
$ git -C ~nitter/nitter log -1
commit 2dc91f8453ce904d1b07a933e8a1dc970d788c41 (HEAD -> master, origin/master, origin/HEAD)
Merge: ecb6fe4 9b97ddc
Author: Zed <zedeus@pm.me>
Date:   Thu Mar 10 16:46:14 2022 +0100

    Merge pull request #571 from jackyzy823/fix-listmember

     Fix list members not displaying
$ w3m -dump http://localhost:8081/about | grep ^Version\
Version 2022.03.10-2dc91f8
$ nim -v
Nim Compiler Version 1.6.4 [Linux: amd64]
Compiled at 2022-02-09
Copyright (c) 2006-2021 by Andreas Rumpf

git hash: 7994556f3804c217035c44b453a3feec64405758
active boot switches: -d:release
$ dpkg-query -W apache2 redis* libsass-dev certbot
apache2 2.4.38-3+deb10u7
certbot 0.31.0-1+deb10u1
libsass-dev:amd64       3.5.5-4
redis-server    5:5.0.14-1+deb10u2
redis-tools     5:5.0.14-1+deb10u2
 lsb_release -dr
Description:    Debian GNU/Linux 10 (buster)
Release:        10
$ arch
x86_64

コメントを残す

メールアドレスが公開されることはありません。 が付いている欄は必須項目です

To respond on your own website, enter the URL of your response which should contain a link to this post's permalink URL. Your response will then appear (possibly after moderation) on this page. Want to update or remove your response? Update or delete your post and re-enter your post's URL again. (Find out more about Webmentions.)