blog

My blog at www.shimmy1996.com

git clone git://git.shimmy1996.com/blog.git
commit 34e141bf89172b5451e5ad5723369f0815cbd185
parent 5868be3879ebac4519e68e5283d09cdc2e7cbe81
Author: Shimmy Xu <shimmy.xu@shimmy1996.com>
Date:   Sun, 11 Feb 2018 22:26:21 -0600

New post "Trying Out Mastodon".

Diffstat:
Acontent/posts/trying-out-mastodon.en.md | 101+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Acontent/posts/trying-out-mastodon.zh.md | 101+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Mi18n/en.toml | 7+++++--
Mi18n/zh.toml | 4++++
Morg/2018.org | 162+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
5 files changed, 373 insertions(+), 2 deletions(-)
diff --git a/content/posts/trying-out-mastodon.en.md b/content/posts/trying-out-mastodon.en.md
@@ -0,0 +1,100 @@
++++
+title = "Trying Out Mastodon"
+tags = ["social-network", "mastodon", "arch-linux"]
+categories = ["site-related"]
+draft = false
+date = 2018-01-28
+slug = "trying-out-mastodon"
++++
+
+As mentioned in my [previous post](https://www.shimmy1996.com/en/posts/2017/10/22/no-more-disqusting-disqus/), I am not really accustomed to posting on social networks. However, the other day I encountered a term I haven't heard in a long time: micro-blogging. Yes, quite a few social networks, Twitter for instance, is before anything a micro-blogging service. This definition of Twitter makes it immensely more appealing to me: it's a bite-sized blog for random thoughts, funny incidents, and many other pieces of my life that might not fit well with a regular blog post. However, I still find posting on Twitter has the 'broadcasting to the entire Internet' feeling stamped into it. Guess I'll just host my own then.
+
+[Mastodon](https://github.com/tootsuite/mastodon) turned out to be one such solution. Mastodon's federated and decentralized nature makes it ideal for someone like me who struggles between building my online identity while minimizing the number of different companies I expose my information to. If people are willing to give away their personal information for fancy profile pictures, then hosting a Mastodon wouldn't seem like such a bad deal.
+
+
+## Installation on Arch Linux {#installation-on-arch-linux}
+
+It was kinda surprising that there doesn't exist a Arch Linux specific installation guide for Mastodon. Not that the installation process would be more difficult on Arch Linux than Ubuntu, but installation can be made a lot due simpler to the abundance of packages. Since the [official production guide](https://github.com/tootsuite/documentation/blob/master/Running-Mastodon/Production-guide.md) is already fairly comprehensive, I'll just document some Arch Linux specific steps here.
+
+
+### Dependencies {#dependencies}
+
+Here's a table detailing all the dependencies and their corresponding packages in Arch Linux. There really is no need to git clone anything. `npm` was also required in the installation process, but was not listed in the official guide.
+
+| Dependency                            | Package                                                                                     |
+|---------------------------------------|---------------------------------------------------------------------------------------------|
+| `node.js` 6.x                         | [`nodejs-lts-boron`](https://www.archlinux.org/packages/community/x86_64/nodejs-lts-boron/) |
+| `yarn`                                | [`yarn`](https://www.archlinux.org/packages/community/any/yarn/)                            |
+| `imagemagick`                         | [`imagemagick`](https://www.archlinux.org/packages/extra/x86_64/imagemagick/)               |
+| `ffmpeg`                              | [`ffmpeg`](https://www.archlinux.org/packages/extra/x86_64/ffmpeg/)                         |
+| `libprotobuf` and `protobuf-compiler` | [`protobuf`](https://www.archlinux.org/packages/?sort=&q=protobuf&maintainer=&flagged=)     |
+| `nginx`                               | [`nginx`](https://www.archlinux.org/packages/extra/x86_64/nginx/)                           |
+| `redis`                               | [`redis`](https://www.archlinux.org/packages/community/x86_64/redis/)                       |
+| `postgresql`                          | [`postgresql`](https://www.archlinux.org/packages/extra/x86_64/postgresql/)                 |
+| `nodejs`                              | [`nodejs`](https://www.archlinux.org/packages/community/x86_64/nodejs/)                     |
+| `rbenv`                               | [`rbenv`](https://aur.archlinux.org/packages/rbenv/)                                        |
+| `ruby-build`                          | [`ruby-build`](https://aur.archlinux.org/packages/ruby-build/)                              |
+| `npm`                                 | [`npm`](https://www.archlinux.org/packages/community/any/npm/)                              |
+
+For `rbenv`, I needed to add `'eval "$(rbenv init -)"` to `.bashrc` or `.zshrc` after installation as prompted by the post installation script.
+
+
+### Mastodon {#mastodon}
+
+Create user `mastodon` and to `sudoers` using `visudo`.
+
+```sh
+useradd -m -G wheel -s /bin/bash mastodon
+```
+
+Then I can clone the repository and start [installing node.js and ruby dependencies](https://github.com/tootsuite/documentation/blob/master/Running-Mastodon/Production-guide.md#nodejs-and-ruby-dependencies). This is where `npm` is required. Besides, I encountered a `ENONT` error when running `yarn` saying `./.config/yarn/global/.yarnclean` is missing, which is resolved by creating the file.
+
+
+### PostgreSQL {#postgresql}
+
+In addition to installing the `postgresql` package, I followed [Arch Wiki](https://wiki.archlinux.org/index.php/PostgreSQL) to initialize the data cluster:
+
+```sh
+$ sudo su postgres
+[postgres]$ initdb --locale $LANG -E UTF8 -D '/var/lib/postgres/data'
+```
+
+After starting and enabling `postgresql` with `systemctl`, I can then start the `psql` shell as the `postgres` user and create user for Mastodon (use `psql` command `\du` to check the user is actually there):
+
+```sh
+$ sudo su postgres
+[postgres]$ psql
+[psql]# CREATE USER mastodon CREATEDB;
+[psql]# \q
+```
+
+Port selection is customizable in `postgresql.service` and the port number will be used in `.env.porduction` customization.
+
+
+### Redis {#redis}
+
+Pretty much the same drill as `postgresql`, I installed `redis` and start/enabled `redis.service`. The port selection and address that have access can all be configured from `/etc/redis.conf`.
+
+
+### Nginx & Let's Encrypt {#nginx-and-let-s-encrypt}
+
+The official production guide covers this part pretty well already.
+
+
+### `.env.production` {#dot-env-dot-production}
+
+The config file is fairly self-explanatory. The only thing I got wrong the first time is the variable `DB_HOST` for `postgresql`. I then obtained the correct path, `/run/postgresql`, by checking status of `postgresql.service`.
+
+
+### Scheduling Services & Cleanups {#scheduling-services-and-cleanups}
+
+Again, just follow the official production guide. I installed [`cronie`](https://www.archlinux.org/packages/core/x86_64/cronie/) to schedule cron jobs.
+
+
+## My Experience {#my-experience}
+
+The web interface is fairly good, I like how I can write toots while browsing timelines instead of been forced to stay at the top of the page. I tried out quite a few Mastodon clients on my phone and I settled on [Pawoo](https://pawoo.net/about), which is built by Pixiv. So far Mastodon feels like a more comfy twitter to me and a platform where I am actually willing to write on. I'm pushing myself to write something on Mastodon every few days. So far it's been mostly running logs, but I'll come up more stuff to post in the future.
+
+One thing I would really like to see though is multilingual post support in Mastodon. A workaround I currently use is appending different tags for Chinese vs. English posts, which not only bloats my toots, but also fragmented my timeline so that it's only 50% comprehensible for most people. Regrettably, it seems that out of the various micro-blogging/social networking services, only [Facebook](https://code.facebook.com/posts/597373993776783) has something similar to this at the moment.
+
+In the footer section, I've replaced Twitter with [my Mastodon profile](https://mstdn.shimmy1996.com/@shimmy1996). Feel free to take a peek inside. :P+
\ No newline at end of file
diff --git a/content/posts/trying-out-mastodon.zh.md b/content/posts/trying-out-mastodon.zh.md
@@ -0,0 +1,100 @@
++++
+title = "Mastodon 尝鲜"
+tags = ["social-network", "mastodon", "arch-linux"]
+categories = ["site-related"]
+draft = false
+date = 2018-01-28
+slug = "trying-out-mastodon"
++++
+
+我在 [上一篇日志](https://www.shimmy1996.com/zh/posts/2017/10/22/no-more-disqusting-disqus/) 里提到过,我并不习惯于在社交网络上发帖子。不过不久之前,我偶然撞见了一个很久没有听到过的词:微型博客。不少社交网络站点,例如 Twitter ,本质上还是一个微型博客服务。这种定义下的 Twitter 对我更加具有吸引力:我可以把一些随想,趣事和生活中其他不大适合写进博客的点点滴滴塞进去。但即使如此,我还是发推有一种“向整个互联网发送座标”的感觉。嗯,那么只好自己搭建一个微型博客了。
+
+[Mastodon](https://github.com/tootsuite/mastodon) 就是一个很好的解决方案。对与在最大化网络人格和最小化个人信息泄露之间进退两难的我来说,存储去中心化、但实例之间又紧密相联的 Mastodon 非常理想。如果人们愿意为了好看的头像将个人信息拱手送出的话,搭建一个 Mastodon 实例可以算得上是一个划算的多的买卖。
+
+
+## 在 Arch Linux 上安装 Mastodon {#在-arch-linux-上安装-mastodon}
+
+我在一番搜寻后,居然没有找到一篇专门针对 Arch Linux 的 Mastodon 安装指南,这有点让我惊讶。不过得益于丰富的软件包,在 Arch Linux 上安装 Mastodon 其实比在 Ubuntu 上更加简单。 [官方指南](https://github.com/tootsuite/documentation/blob/master/Running-Mastodon/Production-guide.md) 上有很详尽的步骤说明,我就简单补充一些只适用于 Arch Linux 的部分。
+
+
+### 软件包依赖 {#软件包依赖}
+
+我把所有依赖以及相对应的 Arch Linux 软件包都列了出来。完全没有手动克隆 git 仓库的必要。 `npm` 会在安装过程中用到,但没有在官方指南中列出。
+
+| 依赖                                | 软件包                                                                                      |
+|-----------------------------------|------------------------------------------------------------------------------------------|
+| `node.js` 6.x                       | [`nodejs-lts-boron`](https://www.archlinux.org/packages/community/x86_64/nodejs-lts-boron/) |
+| `yarn`                              | [`yarn`](https://www.archlinux.org/packages/community/any/yarn/)                            |
+| `imagemagick`                       | [`imagemagick`](https://www.archlinux.org/packages/extra/x86_64/imagemagick/)               |
+| `ffmpeg`                            | [`ffmpeg`](https://www.archlinux.org/packages/extra/x86_64/ffmpeg/)                         |
+| `libprotobuf` 和 `protobuf-compiler` | [`protobuf`](https://www.archlinux.org/packages/?sort=&q=protobuf&maintainer=&flagged=)     |
+| `nginx`                             | [`nginx`](https://www.archlinux.org/packages/extra/x86_64/nginx/)                           |
+| `redis`                             | [`redis`](https://www.archlinux.org/packages/community/x86_64/redis/)                       |
+| `postgresql`                        | [`postgresql`](https://www.archlinux.org/packages/extra/x86_64/postgresql/)                 |
+| `nodejs`                            | [`nodejs`](https://www.archlinux.org/packages/community/x86_64/nodejs/)                     |
+| `rbenv`                             | [`rbenv`](https://aur.archlinux.org/packages/rbenv/)                                        |
+| `ruby-build`                        | [`ruby-build`](https://aur.archlinux.org/packages/ruby-build/)                              |
+| `npm`                               | [`npm`](https://www.archlinux.org/packages/community/any/npm/)                              |
+
+在安装 `rbenv` 后,我需要把 `'eval "$(rbenv init -)"` 加入 `.bashrc` 或 `.zshrc` 中(安装脚本也会提示这一步骤)。
+
+
+### Mastodon {#mastodon}
+
+创建用户 `mastodon` 并用 `visudo` 把该用户加入 `sudoers` 。
+
+```sh
+useradd -m -G wheel -s /bin/bash mastodon
+```
+
+接下来就可以克隆 Mastodon 的 git 仓库并开始 [安装 node.js 和 ruby 的依赖](https://github.com/tootsuite/documentation/blob/master/Running-Mastodon/Production-guide.md#nodejs-and-ruby-dependencies) 了。在这一过程中会用到 `npm` 。我在运行 `yarn` 时,遇到了一个 `ENONT` 错误:无法找到 `./.config/yarn/global/.yarnclean` 。手动创建了迷失的文件解决了这个错误。
+
+
+### PostgreSQL {#postgresql}
+
+除了安装 `postgresql` 软件包外, 我遵循 [Arch Wiki](https://wiki.archlinux.org/index.php/PostgreSQL) 里的步骤初始化了数据库集群:
+
+```sh
+$ sudo su postgres
+[postgres]$ initdb --locale $LANG -E UTF8 -D '/var/lib/postgres/data'
+```
+
+在开始并启用 `postgresql.service` 后,我就可以以用户 `postgres` 的身份登录 `psql` 命令行并给 Mastodon 建立用户了(可以使用 `psql` 命令 `\du` 来确认用户列表):
+
+```sh
+$ sudo su postgres
+[postgres]$ psql
+[psql]# CREATE USER mastodon CREATEDB;
+[psql]# \q
+```
+
+端口设置可以在 `postgresql.service` 里找到,这会在编辑 `.env.porduction` 时用到。
+
+
+### Redis {#redis}
+
+和 `postgresql` 差不多,我安装了 `redis` ,开始/启用了 `redis.service` 。端口选择和允许连接的地址都可以在 `/etc/redis.conf` 里设置。
+
+
+### Nginx 和 Let's Encrypt {#nginx-和-let-s-encrypt}
+
+官方指南已经提供了很详尽的步骤,这里不再赘述。
+
+
+### `.env.production` {#dot-env-dot-production}
+
+照配置文件里的说明做就可以了。我唯一弄错的地方是连接 `postgresql` 所需的 `DB_HOST` 。在查看 `postgresql.service` 的状态后,我找到了正确的路径, `/run/postgresql` 。
+
+
+### 计划进程和缓存清理 {#计划进程和缓存清理}
+
+照官方指南做就好。我安装了 [`cronie`](https://www.archlinux.org/packages/core/x86_64/cronie/) 来安排 cron 作业。
+
+
+## 使用感受 {#使用感受}
+
+网页版界面很不错,我很喜欢可以一边刷时间线一边慢慢写嘟文这一点(而不是在被迫停留在页面顶端)。我在尝试了数个 Mastodon 手机客户端后选定了 Pixiv 开发的 [Pawoo](https://pawoo.net/about) 。到目前为止, Mastodon 给我的感觉是一个比 Twitter 更加舒适、更能激发我写东西的平台。我试着推动自己每隔几天就写一条嘟文。虽然目前为止我写的大都是跑步的记录,但我会渐渐丰富我的嘟文内容的。
+
+我很希望看到 Mastodon 对多语言嘟文提供支持。目前我用的办法是给中文和英文的嘟文打上不同的标签,但这么做不仅使嘟文更加臃肿,也使得我的时间线对大部分人来说可读性只有 50% 。可惜的是,目前的诸多社交网络里只看到 [Facebook](https://code.facebook.com/posts/597373993776783) 对此提供了支持。
+
+在网站页脚,我已经把 Twitter 换成了我的 [Mastodon 页面](https://mstdn.shimmy1996.com/@shimmy1996) 。随时欢迎各位来访。:P+
\ No newline at end of file
diff --git a/i18n/en.toml b/i18n/en.toml
@@ -40,4 +40,7 @@ other = "Social Network"
 other = "Plans"
 
 [design]
-other = "Design"-
\ No newline at end of file
+other = "Design"
+
+[mastodon]
+other = "Mastodon"+
\ No newline at end of file
diff --git a/i18n/zh.toml b/i18n/zh.toml
@@ -41,3 +41,6 @@ other = "计划"
 
 [design]
 other = "设计"
+
+[mastodon]
+other = "Mastodon"+
\ No newline at end of file
diff --git a/org/2018.org b/org/2018.org
@@ -203,6 +203,168 @@ I also played around with several alternative color schemes, i.e. inverted versi
 
 我还尝试了其他不同的配色,比如反色版本,以后可能会拿来作为我其他项目的图标。我所有还活跃的社交网站都已经换上了新头像,包括网站图标。这下大家应该可以更容易地在不同网站上认出我了XD。
 
+* Site Related                                                :@site_related:
+** DONE Trying Out Mastodon              :social_network:mastodon:arch_linux:
+:PROPERTIES:
+:EXPORT_HUGO_CUSTOM_FRONT_MATTER: :date 2018-01-28 :slug trying-out-mastodon
+:END:
+
+*** DONE en
+:PROPERTIES:
+:EXPORT_TITLE: Trying Out Mastodon
+:EXPORT_FILE_NAME: trying-out-mastodon.en.md
+:END:
+
+As mentioned in my [[https://www.shimmy1996.com/en/posts/2017/10/22/no-more-disqusting-disqus/][previous post]], I am not really accustomed to posting on social networks. However, the other day I encountered a term I haven't heard in a long time: micro-blogging. Yes, quite a few social networks, Twitter for instance, is before anything a micro-blogging service. This definition of Twitter makes it immensely more appealing to me: it's a bite-sized blog for random thoughts, funny incidents, and many other pieces of my life that might not fit well with a regular blog post. However, I still find posting on Twitter has the 'broadcasting to the entire Internet' feeling stamped into it. Guess I'll just host my own then.
+
+[[https://github.com/tootsuite/mastodon][Mastodon]] turned out to be one such solution. Mastodon's federated and decentralized nature makes it ideal for someone like me who struggles between building my online identity while minimizing the number of different companies I expose my information to. If people are willing to give away their personal information for fancy profile pictures, then hosting a Mastodon wouldn't seem like such a bad deal.
+
+**** Installation on Arch Linux
+It was kinda surprising that there doesn't exist a Arch Linux specific installation guide for Mastodon. Not that the installation process would be more difficult on Arch Linux than Ubuntu, but installation can be made a lot due simpler to the abundance of packages. Since the [[https://github.com/tootsuite/documentation/blob/master/Running-Mastodon/Production-guide.md][official production guide]] is already fairly comprehensive, I'll just document some Arch Linux specific steps here.
+
+***** Dependencies
+Here's a table detailing all the dependencies and their corresponding packages in Arch Linux. There really is no need to git clone anything. =npm= was also required in the installation process, but was not listed in the official guide.
+
+| Dependency                            | Package                                                                                       |
+| =node.js= 6.x                         | [[https://www.archlinux.org/packages/community/x86_64/nodejs-lts-boron/][=nodejs-lts-boron=]] |
+| =yarn=                                | [[https://www.archlinux.org/packages/community/any/yarn/][=yarn=]]                            |
+| =imagemagick=                         | [[https://www.archlinux.org/packages/extra/x86_64/imagemagick/][=imagemagick=]]               |
+| =ffmpeg=                              | [[https://www.archlinux.org/packages/extra/x86_64/ffmpeg/][=ffmpeg=]]                         |
+| =libprotobuf= and =protobuf-compiler= | [[https://www.archlinux.org/packages/?sort=&q=protobuf&maintainer=&flagged=][=protobuf=]]     |
+| =nginx=                               | [[https://www.archlinux.org/packages/extra/x86_64/nginx/][=nginx=]]                           |
+| =redis=                               | [[https://www.archlinux.org/packages/community/x86_64/redis/][=redis=]]                       |
+| =postgresql=                          | [[https://www.archlinux.org/packages/extra/x86_64/postgresql/][=postgresql=]]                 |
+| =nodejs=                              | [[https://www.archlinux.org/packages/community/x86_64/nodejs/][=nodejs=]]                     |
+| =rbenv=                               | [[https://aur.archlinux.org/packages/rbenv/][=rbenv=]]                                        |
+| =ruby-build=                          | [[https://aur.archlinux.org/packages/ruby-build/][=ruby-build=]]                              |
+| =npm=                                 | [[https://www.archlinux.org/packages/community/any/npm/][=npm=]]                              |
+
+For =rbenv=, I needed to add ='eval "$(rbenv init -)"= to =.bashrc= or =.zshrc= after installation as prompted by the post installation script.
+
+***** Mastodon
+Create user =mastodon= and to =sudoers= using =visudo=.
+#+BEGIN_SRC sh
+  useradd -m -G wheel -s /bin/bash mastodon
+#+END_SRC
+
+Then I can clone the repository and start [[https://github.com/tootsuite/documentation/blob/master/Running-Mastodon/Production-guide.md#nodejs-and-ruby-dependencies][installing node.js and ruby dependencies]]. This is where =npm= is required. Besides, I encountered a =ENONT= error when running =yarn= saying =./.config/yarn/global/.yarnclean= is missing, which is resolved by creating the file.
+
+***** PostgreSQL
+In addition to installing the =postgresql= package, I followed [[https://wiki.archlinux.org/index.php/PostgreSQL][Arch Wiki]] to initialize the data cluster:
+
+#+BEGIN_SRC sh
+  $ sudo su postgres
+  [postgres]$ initdb --locale $LANG -E UTF8 -D '/var/lib/postgres/data'
+#+END_SRC
+
+After starting and enabling =postgresql= with =systemctl=, I can then start the =psql= shell as the =postgres= user and create user for Mastodon (use =psql= command =\du= to check the user is actually there):
+
+#+BEGIN_SRC sh
+  $ sudo su postgres
+  [postgres]$ psql
+  [psql]# CREATE USER mastodon CREATEDB;
+  [psql]# \q
+#+END_SRC
+
+Port selection is customizable in =postgresql.service= and the port number will be used in =.env.porduction= customization.
+
+***** Redis
+Pretty much the same drill as =postgresql=, I installed =redis= and start/enabled =redis.service=. The port selection and address that have access can all be configured from =/etc/redis.conf=.
+
+***** Nginx & Let's Encrypt
+The official production guide covers this part pretty well already.
+
+***** =.env.production=
+The config file is fairly self-explanatory. The only thing I got wrong the first time is the variable =DB_HOST= for =postgresql=. I then obtained the correct path, =/run/postgresql=, by checking status of =postgresql.service=.
+
+***** Scheduling Services & Cleanups
+Again, just follow the official production guide. I installed [[https://www.archlinux.org/packages/core/x86_64/cronie/][=cronie=]] to schedule cron jobs.
+
+**** My Experience
+The web interface is fairly good, I like how I can write toots while browsing timelines instead of been forced to stay at the top of the page. I tried out quite a few Mastodon clients on my phone and I settled on [[https://pawoo.net/about][Pawoo]], which is built by Pixiv. So far Mastodon feels like a more comfy twitter to me and a platform where I am actually willing to write on. I'm pushing myself to write something on Mastodon every few days. So far it's been mostly running logs, but I'll come up more stuff to post in the future.
+
+One thing I would really like to see though is multilingual post support in Mastodon. A workaround I currently use is appending different tags for Chinese vs. English posts, which not only bloats my toots, but also fragmented my timeline so that it's only 50% comprehensible for most people. Regrettably, it seems that out of the various micro-blogging/social networking services, only [[https://code.facebook.com/posts/597373993776783][Facebook]] has something similar to this at the moment.
+
+In the footer section, I've replaced Twitter with [[https://mstdn.shimmy1996.com/@shimmy1996][my Mastodon profile]]. Feel free to take a peek inside. :P
+
+*** DONE zh
+:PROPERTIES:
+:EXPORT_TITLE: Mastodon 尝鲜
+:EXPORT_FILE_NAME: trying-out-mastodon.zh.md
+:END:
+
+我在 [[https://www.shimmy1996.com/zh/posts/2017/10/22/no-more-disqusting-disqus/][上一篇日志]] 里提到过,我并不习惯于在社交网络上发帖子。不过不久之前,我偶然撞见了一个很久没有听到过的词:微型博客。不少社交网络站点,例如 Twitter ,本质上还是一个微型博客服务。这种定义下的 Twitter 对我更加具有吸引力:我可以把一些随想,趣事和生活中其他不大适合写进博客的点点滴滴塞进去。但即使如此,我还是发推有一种“向整个互联网发送座标”的感觉。嗯,那么只好自己搭建一个微型博客了。
+
+[[https://github.com/tootsuite/mastodon][Mastodon]] 就是一个很好的解决方案。对与在最大化网络人格和最小化个人信息泄露之间进退两难的我来说,存储去中心化、但实例之间又紧密相联的 Mastodon 非常理想。如果人们愿意为了好看的头像将个人信息拱手送出的话,搭建一个 Mastodon 实例可以算得上是一个划算的多的买卖。
+
+**** 在 Arch Linux 上安装 Mastodon
+我在一番搜寻后,居然没有找到一篇专门针对 Arch Linux 的 Mastodon 安装指南,这有点让我惊讶。不过得益于丰富的软件包,在 Arch Linux 上安装 Mastodon 其实比在 Ubuntu 上更加简单。 [[https://github.com/tootsuite/documentation/blob/master/Running-Mastodon/Production-guide.md][官方指南]] 上有很详尽的步骤说明,我就简单补充一些只适用于 Arch Linux 的部分。
+
+***** 软件包依赖
+我把所有依赖以及相对应的 Arch Linux 软件包都列了出来。完全没有手动克隆 git 仓库的必要。 =npm= 会在安装过程中用到,但没有在官方指南中列出。
+
+| 依赖                                  | 软件包                                                                                        |
+| =node.js= 6.x                         | [[https://www.archlinux.org/packages/community/x86_64/nodejs-lts-boron/][=nodejs-lts-boron=]] |
+| =yarn=                                | [[https://www.archlinux.org/packages/community/any/yarn/][=yarn=]]                            |
+| =imagemagick=                         | [[https://www.archlinux.org/packages/extra/x86_64/imagemagick/][=imagemagick=]]               |
+| =ffmpeg=                              | [[https://www.archlinux.org/packages/extra/x86_64/ffmpeg/][=ffmpeg=]]                         |
+| =libprotobuf= 和 =protobuf-compiler= | [[https://www.archlinux.org/packages/?sort=&q=protobuf&maintainer=&flagged=][=protobuf=]]     |
+| =nginx=                               | [[https://www.archlinux.org/packages/extra/x86_64/nginx/][=nginx=]]                           |
+| =redis=                               | [[https://www.archlinux.org/packages/community/x86_64/redis/][=redis=]]                       |
+| =postgresql=                          | [[https://www.archlinux.org/packages/extra/x86_64/postgresql/][=postgresql=]]                 |
+| =nodejs=                              | [[https://www.archlinux.org/packages/community/x86_64/nodejs/][=nodejs=]]                     |
+| =rbenv=                               | [[https://aur.archlinux.org/packages/rbenv/][=rbenv=]]                                        |
+| =ruby-build=                          | [[https://aur.archlinux.org/packages/ruby-build/][=ruby-build=]]                              |
+| =npm=                                 | [[https://www.archlinux.org/packages/community/any/npm/][=npm=]]                              |
+
+在安装 =rbenv= 后,我需要把 ='eval "$(rbenv init -)"= 加入 =.bashrc= 或 =.zshrc= 中(安装脚本也会提示这一步骤)。
+
+***** Mastodon
+创建用户 =mastodon= 并用 =visudo= 把该用户加入 =sudoers= 。
+#+BEGIN_SRC sh
+  useradd -m -G wheel -s /bin/bash mastodon
+#+END_SRC
+
+接下来就可以克隆 Mastodon 的 git 仓库并开始 [[https://github.com/tootsuite/documentation/blob/master/Running-Mastodon/Production-guide.md#nodejs-and-ruby-dependencies][安装 node.js 和 ruby 的依赖]] 了。在这一过程中会用到 =npm= 。我在运行 =yarn= 时,遇到了一个 =ENONT= 错误:无法找到 =./.config/yarn/global/.yarnclean= 。手动创建了迷失的文件解决了这个错误。
+
+***** PostgreSQL
+除了安装 =postgresql= 软件包外, 我遵循 [[https://wiki.archlinux.org/index.php/PostgreSQL][Arch Wiki]] 里的步骤初始化了数据库集群:
+
+#+BEGIN_SRC sh
+  $ sudo su postgres
+  [postgres]$ initdb --locale $LANG -E UTF8 -D '/var/lib/postgres/data'
+#+END_SRC
+
+在开始并启用 =postgresql.service= 后,我就可以以用户 =postgres= 的身份登录 =psql= 命令行并给 Mastodon 建立用户了(可以使用 =psql= 命令 =\du= 来确认用户列表):
+
+#+BEGIN_SRC sh
+  $ sudo su postgres
+  [postgres]$ psql
+  [psql]# CREATE USER mastodon CREATEDB;
+  [psql]# \q
+#+END_SRC
+
+端口设置可以在 =postgresql.service= 里找到,这会在编辑 =.env.porduction= 时用到。
+
+***** Redis
+和 =postgresql= 差不多,我安装了 =redis= ,开始/启用了 =redis.service= 。端口选择和允许连接的地址都可以在 =/etc/redis.conf= 里设置。
+
+***** Nginx 和 Let's Encrypt
+官方指南已经提供了很详尽的步骤,这里不再赘述。
+
+***** =.env.production=
+照配置文件里的说明做就可以了。我唯一弄错的地方是连接 =postgresql= 所需的 =DB_HOST= 。在查看 =postgresql.service= 的状态后,我找到了正确的路径, =/run/postgresql= 。
+
+***** 计划进程和缓存清理
+照官方指南做就好。我安装了 [[https://www.archlinux.org/packages/core/x86_64/cronie/][=cronie=]] 来安排 cron 作业。
+
+**** 使用感受
+网页版界面很不错,我很喜欢可以一边刷时间线一边慢慢写嘟文这一点(而不是在被迫停留在页面顶端)。我在尝试了数个 Mastodon 手机客户端后选定了 Pixiv 开发的 [[https://pawoo.net/about][Pawoo]] 。到目前为止, Mastodon 给我的感觉是一个比 Twitter 更加舒适、更能激发我写东西的平台。我试着推动自己每隔几天就写一条嘟文。虽然目前为止我写的大都是跑步的记录,但我会渐渐丰富我的嘟文内容的。
+
+我很希望看到 Mastodon 对多语言嘟文提供支持。目前我用的办法是给中文和英文的嘟文打上不同的标签,但这么做不仅使嘟文更加臃肿,也使得我的时间线对大部分人来说可读性只有 50% 。可惜的是,目前的诸多社交网络里只看到 [[https://code.facebook.com/posts/597373993776783][Facebook]] 对此提供了支持。
+
+在网站页脚,我已经把 Twitter 换成了我的 [[https://mstdn.shimmy1996.com/@shimmy1996][Mastodon 页面]] 。随时欢迎各位来访。:P
+
 * Emacs                                                              :@emacs:
 
 ** TODO Get =emacs= To Work With =fcitx=                        :emacs:fcitx: