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:releasenitterアカウントに変更nitterのsourceディレクトリへ移動nitterのsourceをpull- 一時的に
nimの PATH を通す 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
- 必要なら
${NITTER_URL}/aboutの元になるabout.mdを編集 - markdownをhtmlに変換(about.md以外のファイルをおいても変換されるが表示は出来ない?)
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