1
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 3 years have passed since last update.

2021年版 Google Compute Engine (GCE)上でTiny Tiny RSSを動かしてみる

Posted at

Google CloudTiny Tiny RSSを動かしてみようと思います。基本的に自分用の備忘録です。

まずはGCE上でTiny Tiny RSSを動かすところまでやってみます。

環境

今どきはTiny Tiny RSSもDockerで動かすようなので、Containers on Compute Engineを参考にGoogleが提供しているContainer-Optimized OSを使ってみます。

docker-compose.ymlを見ると、WebサーバはNginx、DBはPostgreSQLを使っているようです。

GCEのVMインスタンスを起動

以下の設定でVMインスタンスを起動します。

各種ソフトウェアのインストールと設定

SSHでログインして作業します。

$ sudo timedatectl set-timezone America/Los_Angeles

Running Docker Compose with Dockerを参考にContainer Optimized OSでdocker-composeを使えるようにします。

z80@cos-tt-rss ~ $ docker run docker/compose:1.29.2 version
Unable to find image 'docker/compose:1.29.2' locally
1.29.2: Pulling from docker/compose
339de151aab4: Pull complete 
484a7070e879: Pull complete 
6391cb0e5266: Pull complete 
aaaf585806ed: Pull complete 
Digest: sha256:ae66070588c539b965986dc74e9371e3e62ef71668b72a5eed70de111ed3659e
Status: Downloaded newer image for docker/compose:1.29.2
docker-compose version 1.29.2, build 5becea4
docker-py version: 5.0.0
CPython version: 3.7.10
OpenSSL version: OpenSSL 1.1.1k  25 Mar 2021

ついでにdocker-composeをaliasに登録しておきます。

z80@cos-tt-rss ~ $ echo alias docker-compose="'"'docker run --rm \
    -v /var/run/docker.sock:/var/run/docker.sock \
    -v "$PWD:$PWD" \
    -w="$PWD" \
    docker/compose:1.29.2'"'" >> ~/.bashrc
z80@cos-tt-rss ~ $ source ~/.bashrc

Tiny Tiny RSSのインストールと設定

Installation Guideに従って、ユーザにお勧めのstaticでインストールしてみます。

z80@cos-tt-rss ~ $ git clone https://git.tt-rss.org/fox/ttrss-docker-compose.git ttrss-docker
Cloning into 'ttrss-docker'...
remote: Enumerating objects: 1164, done.
remote: Counting objects: 100% (1164/1164), done.
remote: Compressing objects: 100% (707/707), done.
remote: Total 1164 (delta 746), reused 726 (delta 450)
Receiving objects: 100% (1164/1164), 135.10 KiB | 408.00 KiB/s, done.
Resolving deltas: 100% (746/746), done.
z80@cos-tt-rss ~ $ cd ttrss-docker/
z80@cos-tt-rss ~/ttrss-docker $ git checkout static-dockerhub
Branch 'static-dockerhub' set up to track remote branch 'static-dockerhub' from 'origin'.
Switched to a new branch 'static-dockerhub'

設定ファイルを編集します。Global configurationの設定項目も.envファイルで設定できるので、必要に応じて追加します。

z80@cos-tt-rss ~/ttrss-docker $ cp .env-dist .env
z80@cos-tt-rss ~/ttrss-docker $ vi .env
~/ttrss-docker/.env
...
TTRSS_SELF_URL_PATH=http://z80.example.com/tt-rss
...
TTRSS_DAEMON_SLEEP_INTERVAL=600
...
HTTP_PORT=80

フィードをアップデートするupdaterは、デフォルトでは2分おきにDBをチェックしてフィードのアップデートを行うようになってます(毎回全部ではなく、フィードのアップデートが必要かどうかチェックして、必要な分だけ)。しかし、個人で使ってる分にはそんなに頻繁に走らせる必要はないので、TTRSS_DAEMON_SLEEP_INTERVALを追加して間隔を適当に調整しておきます。

docker-composeで起動します。

z80@cos-tt-rss ~/ttrss-docker $ docker-compose pull
Pulling db        ... 
Pulling app       ... 
Pulling backups   ... 
Pulling updater   ... 
Pulling web-nginx ... 
...
Pulling db        ... done
Pulling web-nginx ... done
Pulling app       ... done
Pulling updater   ... done
Pulling backups   ... done
z80@cos-tt-rss ~/ttrss-docker $ docker-compose up -d
Creating network "ttrss-docker_default" with the default driver
Creating volume "ttrss-docker_db" with default driver
Creating volume "ttrss-docker_app" with default driver
Creating volume "ttrss-docker_certs" with default driver
Creating volume "ttrss-docker_backups" with default driver
Creating ttrss-docker_db_1 ... 
Creating ttrss-docker_db_1 ... done
Creating ttrss-docker_backups_1 ... 
Creating ttrss-docker_app_1     ... 
Creating ttrss-docker_backups_1 ... done
Creating ttrss-docker_app_1     ... done
Creating ttrss-docker_updater_1 ... 
Creating ttrss-docker_web-nginx_1 ... 
Creating ttrss-docker_updater_1   ... done
Creating ttrss-docker_web-nginx_1 ... done

ブラウザで http://z80.example.com/tt-rss/ にアクセスして、adminユーザのパスワード(デフォルトはpassword)を変更しておきます。

Fever API pluginのインストールと設定

Tiny Tiny RSS Fever API PluginのInstallationに従ってインストールします。

まずはTiny Tiny RSSのpluginsディレクトリを確認します。

z80@cos-tt-rss ~ $ docker volume ls
DRIVER    VOLUME NAME
local     ttrss-docker_app
local     ttrss-docker_backups
local     ttrss-docker_certs
local     ttrss-docker_db
z80@cos-tt-rss ~ $ docker volume inspect ttrss-docker_app
[
    {
        "CreatedAt": "2021-10-17T22:33:02Z",
        "Driver": "local",
        "Labels": {
            "com.docker.compose.project": "ttrss-docker",
            "com.docker.compose.version": "1.29.2",
            "com.docker.compose.volume": "app"
        },
        "Mountpoint": "/var/lib/docker/volumes/ttrss-docker_app/_data",
        "Name": "ttrss-docker_app",
        "Options": null,
        "Scope": "local"
    }
]
z80@cos-tt-rss ~ $ ls /var/lib/docker/volumes/ttrss-docker_app/_data
index.php  tt-rss
z80@cos-tt-rss ~ $ ls /var/lib/docker/volumes/ttrss-docker_app/_data/tt-rss
CONTRIBUTING.md  backend.php    composer.lock    gulpfile.js  js             lock          plugins        schema           themes              utils
COPYING          cache          config.php       images       jsconfig.json  messages.pot  plugins.local  sql              themes.local        vendor
README.md        classes        config.php-dist  include      lib            package.json  prefs.php      templates        update.php
api              composer.json  feed-icons       index.php    locale         phpstan.neon  public.php     templates.local  update_daemon2.php
z80@cos-tt-rss ~ $ ls /var/lib/docker/volumes/ttrss-docker_app/_data/tt-rss/plugins.local/
index.html  nginx_xaccel

Fever API pluginのファイルをTiny Tiny RSSのpluginsディレクトリにコピーします。

z80@cos-tt-rss ~ $ git clone https://github.com/DigitalDJ/tinytinyrss-fever-plugin fever
Cloning into 'fever'...
remote: Enumerating objects: 344, done.
remote: Counting objects: 100% (35/35), done.
remote: Compressing objects: 100% (30/30), done.
remote: Total 344 (delta 13), reused 15 (delta 5), pack-reused 309
Receiving objects: 100% (344/344), 109.98 KiB | 853.00 KiB/s, done.
Resolving deltas: 100% (139/139), done.
z80@cos-tt-rss ~ $ sudo mv fever /var/lib/docker/volumes/ttrss-docker_app/_data/tt-rss/plugins.local/
z80@cos-tt-rss ~ $ cd /var/lib/docker/volumes/ttrss-docker_app/_data/tt-rss/plugins.local/
z80@cos-tt-rss /var/lib/docker/volumes/ttrss-docker_app/_data/tt-rss/plugins.local $ ls -l
total 8
drwxr-xr-x 2 z80     z80     4096 Oct 17 15:45 fever
-rw-r--r-- 1 chronos chronos    0 Oct 11 04:00 index.html
drwxr-xr-x 4 chronos chronos 4096 Oct 11 16:53 nginx_xaccel
z80@cos-tt-rss /var/lib/docker/volumes/ttrss-docker_app/_data/tt-rss/plugins.local $ sudo chown -R chronos:chronos fever
z80@cos-tt-rss /var/lib/docker/volumes/ttrss-docker_app/_data/tt-rss/plugins.local $ ls -l
total 8
drwxr-xr-x 2 chronos chronos 4096 Oct 17 15:45 fever
-rw-r--r-- 1 chronos chronos    0 Oct 11 04:00 index.html
drwxr-xr-x 4 chronos chronos 4096 Oct 11 16:53 nginx_xaccel

あとは、各ユーザのPreferences→PluginsのところでFever API pluginを有効にしてから、Preferences→Fever Emulationのところでパスワードを設定しておきます。

Dockerイメージの更新

z80@cos-tt-rss ~/ttrss-docker $ docker-compose down
...
z80@cos-tt-rss ~/ttrss-docker $ docker-compose pull
...
z80@cos-tt-rss ~/ttrss-docker $ docker images
REPOSITORY                                            TAG         IMAGE ID       CREATED         SIZE
cthulhoo/ttrss-web-nginx                              latest      b5a08f23b261   40 hours ago    22.3MB
cthulhoo/ttrss-fpm-pgsql-static                       latest      22d112067a88   40 hours ago    133MB
cthulhoo/ttrss-web-nginx                              <none>      eda29dacbf79   6 days ago      22.3MB
cthulhoo/ttrss-fpm-pgsql-static                       <none>      1865276c9590   6 days ago      133MB
postgres                                              12-alpine   3627b2778444   2 weeks ago     190MB
docker/compose                                        1.29.2      32d8a4638cd8   5 months ago    76.2MB
gcr.io/stackdriver-agents/stackdriver-logging-agent   1.8.4       e6b23af25854   11 months ago   226MB
z80@cos-tt-rss ~/ttrss-docker $ docker-compose up -d
Creating network "ttrss-docker_default" with the default driver
Creating ttrss-docker_db_1 ... 
Creating ttrss-docker_db_1 ... done
Creating ttrss-docker_app_1 ... 
Creating ttrss-docker_backups_1 ... 
Creating ttrss-docker_app_1     ... done
Creating ttrss-docker_backups_1 ... done
Creating ttrss-docker_web-nginx_1 ... 
Creating ttrss-docker_updater_1   ... 
Creating ttrss-docker_updater_1   ... done
Creating ttrss-docker_web-nginx_1 ... done
1
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
1
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?