Salt

Writee管理员

Writefreely 所使用的 Markdown 是一种轻量级标记语言。

要创建标题,请在单词或短语前面添加井号 (#) 。# 的数量代表了标题的级别。例如,添加三个 # 表示创建一个三级标题。

因此,给文章添加标题只需要在文章的第一行写下标题,并在最前面添加一个井号 # (也就是一级标题)即可。

例如:

# 这是一个标题

这是文字

学习更多 Markdown 编辑格式,请参阅《基本语法

本文整理了一些反监视自我保护入门工具,希望能帮助到身处中国(或身在海外但仍有回国可能)的站长们。如需深入了解,请查阅本文末尾的参考资源。

敬请注意,保持匿名和安全不仅仅是一个技术问题。没有任何工具足以保证你的安全。匿名是一个复杂的问题,没有一个简单的解决方案。任何薄弱环节都会让你的安全措施功亏一篑。你知道的越多,你就越安全。

设备

加密你的硬盘

如果计算机被物理访问,即使设置了系统登录密码,硬盘内的未加密数据仍可被获取。对于您的笔记本电脑或台式机,可以使用操作系统的自带软件加密硬盘。

操作系统

一个独立的操作系统可以为敏感操作提供安全的环境,这样您可以匿名,不留痕迹地使用软件,这些软件无法轻易获取您的真实设备型号和IP地址。一切与你的网站相关的操作都应在这个隔离环境中执行。

  • Whonix 是一个完整的虚拟机(VM)镜像中的操作系统,它可以在你当前的操作系统(Windows 或 macOS)内运行。虚拟机中的所有互联网流量将通过Tor网络传输。在Whonix上的任何流量必须强行经过Tor,故此Whonix比普通的Tor浏览器更安全,防止IP泄漏和DNS泄漏。这也可以让Tor代理安装在Whonix上的任何软件。安装Whonix后,请记住只能在Whonix-Workstation-XFCE里面进行任何和你的网站相关的敏感操作。
  • Tails 操作系统可以安装在 USB 移动存储设备上,或在虚拟机中运行。虚拟机中的所有互联网流量将通过Tor网络传输。你需要做的仅仅是使用项目文件创建一个可启动的光盘或 U 盘,然后用它们启动电脑即可,一切都预先设置好了。

站长应避免使用个人移动设备管理或访问自己的网站。

浏览器

如果不使用上述虚拟机环境,而在当前的操作系统操作,推荐以下浏览器:

浏览器的选择

浏览器拓展

测试浏览器

  • WebRTC 漏洞测试 – WebRTC 是一种通讯协议,其依靠 JavaScript 程序,可能泄露 VPN 用户真实的 IP 地址。Chrome 浏览器下无法完全取消 WebRTC,但可以透过扩展 uBlock Origin(勾选 “Prevent WebRTC from leaking local IP addresses”)变更其路由设定。
  • DNS Leak Test

密码管理

随机生成强密码并安全地存储它们,每一项服务使用的用户名和密码都应保持不同。

翻墙工具

请不要使用任何机场或商业VPN服务。90%的VPN网站在跟踪记录你的一举一动。位于中国运营的机场也已屡屡发生运营者被逮捕,交出所有用户数据的事件。

更可控的做法是购买一台VPS服务器,自行搭建。

身份隔离

建站全过程需避免提供任何可以追踪到你的个人信息。

Email提供商

为你建站过程中所有需要email注册的服务建立一个独立的email账户。

  • ProtonMail – 总部位于瑞士,成立于2013年。免费和付费计划包括所有安全功能,包括端到端加密、零访问加密、反钓鱼、反垃圾邮件和2FA。拥有Android、iOS应用程序和网络界面。付费计划启用自定义域名。可通过Tor网络访问。
  • Tutanota – 总部在德国,成立于2011年。提供本地跨平台应用程序。付费计划启用自定义域名。不支持第三方电子邮件客户端,用户需要使用广泛的本地应用程序。

Email转发/别名服务

如果你不想注册一个新的email账户,可以使用别名/匿名电子邮件转发服务来注册一切建站服务,帮助你隐藏真实的邮件地址。

制造分身

Cryptocurrency

避免使用支付网关位于中国的支付方式,如支付宝等。尽量选择使用国际银行卡支付,或者选择支持 Cryptocurrency 作为支付方式的建站服务商

选择网站域名

顶级域(后缀)的选择

不要选择位于中国的域名注册商;不要选择域名注册局位于中国的顶级域,例如 .cn/ .ren /.top /.xin /.wang /.hk /.mo 等(完整列表见IANA Root Zone Database

一些支持 Cryptocurrency 作为支付方式的域名注册商

选择网站托管服务商

同样,不要选择位于中国的托管服务商,即使服务器位于境外。

一些支持 Cryptocurrency 作为支付方式的服务器托管商

两步验证

如果你的站点控制面板、服务商的控制面板都两步验证功能,请开启它们。

例如,长毛象的两步验证开启页面位于 /settings/two_factor_authentication_methods

两步验证工具

自我保护

站长自我保护

  • 不在基于中国的社交媒体和聊天应用中提及自己的网站,包括微信私聊
  • 不在发言中透露自己的任何可识别特征信息,例如城市与地理位置
  • 不要轻易点击网站后台中收到的外部链接,例如在注册请求和举报中附带的链接
  • 避免使用未部署加密与隔离措施的个人移动设备访问自己的网站

参考资源

以下是一些我使用过的SMTP邮件发送服务,给Mastodon等实例站长建站作参考:

SMTP Relay 方案

专用于发送 Transactional Email 的商业服务,本方案的优点是发件稳定。

Brevo

  • 开通Transactional Email需人工审核,提供使用用途等说明
  • 支持SMTP和API
  • 永久免费套餐:每日最多300封,免费套餐适合中小型站点~

Sendgrid

  • 人工审核,提供使用用途等说明
  • 支持SMTP和API
  • 永久免费套餐:每日最多100封,免费套餐适合个人小站

Mailjet

  • 开通不需要审核(1年前的情况,现开通要求未知)
  • 支持SMTP和API
  • 永久免费套餐:每日最多200封,每月上限6,000封,免费套餐适合个人小站

Amazon Simple Email Service

  • 开通需人工审核,审核非常严格,需要提供尽可能详尽的信息
  • 支持SMTP和API
  • 免费:如果从AWS EC2服务器发送,每月前62,000封免费。
  • 收费:每1,000封邮件收费$0.10。

Mailgun

  • 开通需人工审核,审核较严格
  • 支持SMTP和API
  • 不提供永久免费套餐,前3个月免费每月5,000封

邮箱发送方案

借用支持SMTP协议的邮箱发送邮件,本方案成本低,但可能受限于邮箱服务的提供商的管控。

MXRoute

  • 开通不需要审核
  • 官网购买
  • 如果你的站点遵守Mastodon Server Covenant 也可以找我免费开通
  • 支持SMTP协议,提供DirectAdmin面板,无限数量邮箱账号
  • 每个账号每小时上限7,200封,允许用来发通知,滥用会被自动suspend账户

Disroot

  • 开通需要回答问题审核
  • 免费,适合个人小站,不建议中大型站点使用
  • 短时间内发件量大可能会被视为spam

MailChannels

  • 一些webhosting服务商,如BuySharedMYW的DirectAdmin自带MailChannels relay

自建方案

因安全风险和维护成本较高,一般不推荐此方案。如果动手能力强,有一台不用于任何其他用途的VPS,且IP地址没有被反垃圾邮件列表黑名单,有时间维护,可以考虑自建:

不推荐的方案

  • Zoho, Outlook, Gmail:这些邮箱服务使用一段时间后可能因为发送大量重复内容的邮件,会发生发件失败、不稳定,或者账户被限制的情况。

测试

在你的站点上配置完成后,在 mail-tester.com 测试,分数超过8分就差不多了。

TL;DR:

Key reasons why you should block Mao (aka: Daizhige, domain: *.mastodonhub.com) Mastodon instances:

  1. Generating fake accounts by continuously duplicating at least hundreds of real Mastodon accounts from other instances without the permission of the original account owners.
  2. Mislead users by claiming to be the very only official Mastodon instance, without mentioning that the most important feature of Mastodon is decentralization.
  3. Jeopardized other instance admins who live in China by publishing their site information on a heavily censored Chinese social media.
  4. Arbitrarily censoring and deleting user-posted contents and accounts in favour of the Chinese Communist Party (CCP).

Duplicating accounts from other instances without any permission

Mao (mao.mastodonhub.com) has been duplicating at least hundreds of Mastodon accounts from Pawoo.net and other instances to its own instance without the permission of the original account owners.

To find out whether your account has been duplicated, you can type “mao.mastodonhub.com/@yourmastodonhandle” in the address bar. Replace your_mastodon_handle by your account handle.

The mirror accounts have been cached from the Fediverse since 2018 and generated by processing in the background of Mao's server. To validate this theory, someone built a test server and successfully replicated this process – those accounts were deliberately mirrored and were not created by mistake.

One of the distinguishable differences between the mirrored accounts and the original accounts is that the <p> and <br> tags are retained in the mirrored accounts.

Example of an account mirrored from Pawoo.net :

Mirrored

On December 13, 2020, Mao's admin made an announcement stating that he refuses to take any responsibility or proactively delete these fake accounts. If users want to delete the mirrored accounts and contents, they need to contact Mao's admin and make a request.

Intentionally misleading its users

Mao openly advertises its own instance as the only Chinese instance, and all other Chinese instances are branches of its site. They are intentionally misleading new users who have not known Mastodon's decentralization mechanism.

In its user guide, Mao claims itself to be the “largest Chinese mastodon instance” and uses “嘟嘟长毛象” (Toot, Mastodon) to name the mobile apps they developed, thus creating a false image of themselves as the “official Mastodon platform”, without mentioning that the most important feature of mastodon is the decentralized private instances, and so called “official platform” simply doesn't exist.

Arbitrary service interruption without notice

In early 2020, Mao had it servers located in Beijing, China mainland.

On May 25, 2020, Mao suddenly shut down its service (for unjustifiable reasons) without properly informing users in advance. The instance was shut down only 30 minutes after Mao's announcement, leaving its users no time for backups.

The instance went live again in July 2020 and moved its servers to Hong Kong.

Jeopardizing other Chinese-language instances

Mao published a list of instance info (including alternate domains that are used to circumvent the Chinese Great Firewall) on Weibo (Chinese social media), which is heavily censored by the Chinese government. This would very likely jeopardize those instance admins who live in China.

Intention to monetize & commercial background

Mao intends to sell its Mastodon hosting service through subdomains of mastodonhub.com.

Based on an analysis of its ICP license and IP addresses, it appears that Mao is controlled by, or at least affiliated with, a China-based public company with registered capital of ¥18,250,000 and total operating revenue of ¥24,542,198 in FY 2019.

Proprietary mobile app

Mao created a microblog-like, non-open source proprietary Mastodon App which requests for unnecessary permission that may potentially violate user's privacy. It also advertised only its own instance in the app interface when it was published.

Obscured terms of service

Mao's terms of service does not clearly define its terms or privacy policy.

It also outlines that the admins can do whatever they want and they don't accept any criticism. If you disrespect the admin, your account will get deleted.

Censorship

Mao censors and deletes user-posted contents and accounts in favour of the Chinese Communist Party (CCP).

How to block Mao instances as instance admin

Known instances of Mao:

mao.mastodonhub.com (main site) – test.mastodonhub.comdaizhige.mastodonhub.commoyu.mastodonhub.commeow.mastodonhub.comouterspace.mastodonhub.com

Known server IPs:

– 148.66.58.42, 148.66.57.10

Block by user agent (Nginx):

    # Block MAO UA
      if ($http_user_agent ~* "mastodonhub.com") {
            return 403;
       }

Block IPs in Nginx:

    # Block MAO IP
      deny 148.66.58.42;
      deny 148.66.57.10;

Block with iptables:

    iptables -A INPUT -s 148.66.58.42 -j DROP
    iptables -A INPUT -s 148.66.57.10 -j DROP

什么是 WriteFreely?

WriteFreely是免费的开放源代码软件,可用于在Web上构建写作空间——无论是出版物,内部博客还是与联邦宇宙互通的写作社区。

专为写作而生

WriteFreely建立在一个简洁的、会自动保存的编辑器上,可为您提供无干扰的书写环境。一经发表,您的文字便成为中心话题,而且易于阅读。

互联社区

你可以发表公开或私有的作品,与其他 WriteFreely 和联邦宇宙社区联系:包括无论是运行WriteFreely,Plume还是其他受ActivityPub支持的软件。借助我们的OAuth 2.0支持,您可以从第三方平台上加入会员。

你可以通过标签将文章分类,并通过将普通文章固定/置顶到您的博客来创建静态页面、创建草稿并通过一个帐户发布到多个博客。

国际化

Blog元素已本地化为20多种语言,并且WriteFreely包括对非拉丁语和从右至左(RTL)脚本语言的一流支持。

尊重隐私

WriteFreely收集最少的数据,并且永远不会超出作者的同意进行公开。作者可以从一个帐户无缝创建多个博客,以实现不同的笔名或目的,而无需公开透露其关联。

搭建自己的 WriteFreely 社区

WriteFreely作为静态二进制文件,可以部署在Go支持的任何平台和体系结构上。只需使用内置的SQLite支持,或添加一个MySQL数据库,就可以运行WriteFreely啦!

对于常见平台,请从WriteFreely的预编译二进制文件开始。可以参考WriteFreely的官方安装指南

以上介绍译自 WriteFreely 的 Github

搭建 WriteFreely 需要什么?

  • 一台服务器(VPS)
  • 一个域名

本文以 Ubuntu 18.04 为例,进行搭建。

安装 Nginx 网站服务器和 MySQL 数据库

切换到 root 用户:

sudo -i

安装 Nginx 网站服务器:

sudo apt install nginx -y

安装 MySQL 数据库:

sudo apt update
sudo apt install mysql-server -y
sudo mysql_secure_installation

进行 sudo mysql_secure_installation 步骤时,会要求设置MySQL的root用户密码。

检查MySQL 数据库服务器的运行:

sudo systemctl status mysql.service

输入刚才设置的root密码登录:

sudo mysql -u root -p

创建WriteFreely的数据库和数据库用户,这个例子中,我们的数据库名称和用户名都是 writefreely。不要输入最开始的 mysql > 部分:

mysql > CREATE USER 'writefreely'@'localhost' IDENTIFIED BY '数据库密码';
mysql > CREATE DATABASE writefreely;
mysql > GRANT ALL PRIVILEGES ON writefreely . * TO 'writefreely'@'localhost';
mysql > FLUSH PRIVILEGES;
mysql > exit;

安装WriteFreely程序

官方发布页面中,找到最新的版本。此处以 v0.12.0 为例。

下载之前,先判断自己的VPS架构,来确定下载哪个版本:

uname -a
dpkg --print-architecture

这个例子里,我们下载 v0.12.0 的 amd64 版本:

wget https://github.com/writefreely/writefreely/releases/download/v0.13.2/writefreely_0.13.2_linux_amd64.tar.gz
tar xvzf writefreely_0.13.2_linux_amd64.tar.gz -C /home

WriteFreely程序被安装在了 /home/writefreely 目录下。

配置WriteFreely

执行以下命令进行首次配置

cd /home/writefreely
./writefreely --config

我选择的是 Production, behind reverse proxy 安装模式,用 Nginx 反代本地 8080 端口的WriteFreely。

Public URL 需要设为你最终公开使用的域名,比如 http://writee.org

具体的配置选项说明,请参考官方文档的配置文件部分

未来如果需要修改配置文件,可以直接在后台修改,或者手动修改 config.ini 文件后,重启 WriteFreely 进程。

初始化,生成 key:

./writefreely --init-db
./writefreely --gen-keys

创建管理员用户:

./writefreely --create-admin 用户名:密码

新建文件:

sudo nano /etc/systemd/system/writefreely.service

在该文件内填入:

[Unit]
Description=Write Freely Instance
After=syslog.target network.target

[Service]
Type=simple
StandardError=syslog
WorkingDirectory=/home/writefreely
ExecStart=/home/writefreely/writefreely
Restart=always

[Install]
WantedBy=multi-user.target

/home/writefreely 是你的程序安装路径。

设置开机启动:

systemctl daemon-reload
sudo systemctl start writefreely
sudo systemctl enable writefreely

如果WriteFreely启动失败,检查:

sudo journalctl -f -u writefreely

如需重启WriteFreely:

sudo systemctl restart writefreely

配置 Nginx

新建配置文件:

sudo nano /etc/nginx/sites-available/writefreely

填入以下内容(注意将域名改为你的域名):

server {
    listen 80;
    listen [::]:80;

    server_name writee.org;

    gzip on;
    gzip_types
      application/javascript
      application/x-javascript
      application/json
      application/rss+xml
      application/xml
      image/svg+xml
      image/x-icon
      application/vnd.ms-fontobject
      application/font-sfnt
      text/css
      text/plain;
    gzip_min_length 256;
    gzip_comp_level 5;
    gzip_http_version 1.1;
    gzip_vary on;

    location ~ ^/.well-known/(webfinger|nodeinfo|host-meta) {
        proxy_set_header Host $host;
        proxy_set_header X-Real-IP $remote_addr;
        proxy_set_header X-Forwarded-For $remote_addr;
        proxy_pass http://127.0.0.1:8080;
        proxy_redirect off;
    }

    location ~ ^/(css|img|js|fonts)/ {
        root /home/writefreely/static;
        # Optionally cache these files in the browser:
        # expires 12M;
    }

    location / {
        proxy_set_header Host $host;
        proxy_set_header X-Real-IP $remote_addr;
        proxy_set_header X-Forwarded-For $remote_addr;
        proxy_pass http://127.0.0.1:8080;
        proxy_redirect off;
    }
}

将配置文件映射到 /etc/nginx/sites-enabled/writefreely

ln -s /etc/nginx/sites-available/writefreely /etc/nginx/sites-enabled/writefreely

测试配置文件是否有错误:

nginx -t

生效新的配置文件并运行 Nginx,开机启动:

sudo nginx -s reload
sudo systemctl start nginx
sudo systemctl enable nginx

开启VPS的80/443端口:

ufw allow 80
ufw allow 443
sudo iptables -A INPUT -p tcp --dport 80 -j ACCEPT
sudo iptables -A INPUT -p tcp --dport 443 -j ACCEPT

配置 SSL

请参考 Certbot 的官方步骤

以 Ubuntu 18.04, Nginx 为例:

sudo apt-get update
sudo apt-get install software-properties-common
sudo add-apt-repository universe
sudo add-apt-repository ppa:certbot/certbot
sudo apt-get update
sudo apt-get install certbot python3-certbot-nginx -y
sudo certbot --nginx