长毛象站长联谊会
本站已紧急更新至Mastodon v4.2.5!🚨
这次是一个关键的安全更新,好几天前就收到警告推送,原因是这个:https://github.com/mastodon/mastodon/security/advisories/GHSA-3fjr-858r-92rw
各位站长抓紧时间呀!
长毛象小站的实用修改:让“ #探索 ”( #expolore )不再空白。
Mastodon的探索功能是为数不多的“算法”。如果某小站的跨实例沟通能力还不是很强的话,会导致这个页面经常是空白的。
简单来说这个算法就是程序 https://github.com/mastodon/mastodon/blob/main/app/models/trends/statuses.rb 文件中开头的几个参数(threshold, score_halflife, decay_threshold)在控制。
一个满足条件(公开,etc)的嘟文点赞数和转发数相加就是他的原始分数,如果超过了threshold那么就会经过一个score_halflife半衰期衰减算法,如果之后分数仍高于decay_threshold那么就符合条件了。
那么对于小站来说,可以把这几个参数酌情改小。例如附图所示。改完之后重启Mastodon服务就成功啦!
长毛象UI小改动:稍稍增大 emoji 大小 patch
https://gist.github.com/snullp/bbdfccddceacc92e46205f491a83b116
将所有emoji增大了4px避免某些较复杂的表情包看着费眼。同时保留了长毛象原版emoji的大小关系(嘟文详情、嘟文列表和用户名里的emoji大小都跟随文字有所差异)
最近上游这种乱七八糟式的安全更新,基本就是逼大家不要魔改。或者说,魔改版本制造的大量tech debt和merge conflict需要专人维护紧跟上游,一旦脱离主线一段时间需要紧急更新的时候几乎不可能在不制造新的tech debt地情况下cherry-pick。
工业界当然都是采用后一种方案。不过有多少站长有能力做到呢?
spam所在的实例一直在增加。
我来开个帖子,请大家遇到新增的spam实例时就回复到这个帖子下面,方便所有人处理。
下面是目前的实例列表:
m.mxin.moedw.n1l.devmisskey.kuromame048.netcunnyborea.topdw.n1l.devminidisc.tokyosocial.cutefunny.netpiaille.fr
#长毛象站长联谊会@board
关于这次长毛象黑猫spamming,第一个被攻击的实例站长表示已经手动清理了所有垃圾用户:@https://m.mxin.moe/
@mxin
同为中文实例,我想大家还是网开一面,解除实例级封禁吧。
另:貌似还有不少大站也受到了同样的攻击,那么自然一刀切封掉整个站是不合适的。大家还是自行甄别一下。
说说工业界是如何反Spam的:
其实反Spam分好几个子类,有几个是和Fediverse相关的:
1. 防止Spammer注册和(本地)发言。
这是最最基本的一条。通常注册页需要加上反机器人(验证码或者CF盾),然后管理员人工处理手动注册的漏网之鱼。封禁Tor和临时邮箱也很有用。
2. 防止外部Spam流入
这个一般指公开Spam流入,对应的Fedi就是公轴Spam。这一般通过反Spam API实现。因为是外站信息,隔离审查(延迟展示)是可行的。此外长毛象自带的tag审核也有一定效果。因为公开Spam要求的就是Publicity,如果没有tag的聚集,spam就失去了意义。
3. 防止点对点Spam
也就是防止类似Email Spam。对应Fedi的私信或是直接at。这个是最难处理的,需要每个用户有一个Spam inbox然后使用更高级的反Spam API。目前在长毛象还没有这样的技术,所以只能暂时让大家被点对点轰炸时关掉提醒并通知管理员。
ps. 切忌有病乱投医,网上不靠谱的方法不要乱试。Spam不是新问题,先想想传统平台是怎么解决的。
麻了,又是一个紧急安全更新!https://github.com/mastodon/mastodon/releases/tag/v4.2.6
本站已经更新到v4.2.6。各位站长抓紧时间!
发个老本行知识:Mastodon套Cloudflare后用户IP变成CF IP的解决方案:
将nginx反代配置中的2处:
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
替换为
proxy_pass_request_headers on;
原理:CF会把客户正确的IP放在这两个header里。不需要nginx再添油加醋。
@board @board@a.gup.pe
注意本次攻击事件不是黑猫服务器所为,请不要因此攻击黑猫服务器及其成员
相关公告
Note that this attack is not done by Kuroneko server, please do not attack Kuroneko server and its staff for this reason
Related Announcement
#长毛象站长联谊会 #什么值得b #什么值得ban #联邦宇宙避雷针 #MastoAdmin #FediBlock #FediBlockMeta #Admin #Spam
临时搓的Mastodon对抗SPAM批量处理脚本:
1. 从用户的举报里自动甄别、封禁外站的spam用户并Limit被入侵的外站实例。
https://gist.github.com/o3o-ca/ef4dd0f68aa0f5706b0eb8cc396028e8
Colab notebook版本(save到Google Drive,站长无需在本地配置Python环境就能在浏览器里跑):
https://colab.research.google.com/drive/1C8jFuFZybYIVnCPHBf1CYPqSE-B5CgCO?usp=sharing
2. 从Mastodon数据库里找出可能的spammers并批量封禁:
https://colab.research.google.com/drive/14bWBtlUPG9c5n_bMymp5iMlf5Wmz8a-p?usp=sharing
@board v4.2.8 更新带来了新的安全补丁,建议各位站长及时更新。
主要添加的功能有,站点会在管理员离线一周后,自动将站点切换至审核注册模式。当站点在环境变量种使用了邮件白名单 时此功能不会启用。该功能也可以通过在环境变量中通过设置以下内容关闭,
DISABLE_AUTOMATIC_SWITCHING_TO_APPROVED_REGISTRATIONS=true
个人建议不使用第三方工具管理站点的管理员将此功能保持开启,或是通过设置邮件白名单的方式关闭(如下)。
EMAIL_DOMAIN_ALLOWLIST=foo.com|bar.com
另外,新 Mastodon 实例创建后会默认关闭注册,这也包括了之前从未修改过注册模式的站长,需要通过以下指令开启,
tootctl settings registrations open
以及来自官方对于此次 SPAM 给出的解决方法有:
- 手动审核新用户注册
- 屏蔽已知 SPAM 严重的邮件方(比如 any.pink)
- 设置 hCaptcha 等验证方式
建议各位站长搜索并屏蔽一个潜在的spam用户yqqwe和与其相关的用户、电邮等。参考信息:https://rigor-mortis.nmrc.org/@simplenomad/111953117712737489
有人试过用storj做长毛象对象存储的吗?价格还行:
$0.004/GB/月存储 + $0.007/GB/月egress,目前看本站egress大概是存储的1/10,换算过来总开销不到$0.005/GB/月。
近期一直在尝试搭建一个HA(高可用)的文件存储系统。这样就可以结合目前希奇!使用的file-level dedup paperclip后端来实现新一代的长毛象媒体文件存储,从而可以2x-10x地减少媒体存储的体积,基本可以实现永久保存站外媒体。
这个后端类似已有的Jortage,但是不通过臃肿的s3协议也就不存在它最大的问题:不支持s3 list API。但无论如何还是必须要有HA加持才能算是production ready。
可是不管怎么设计,HA的架构成本和维护成本还是过高。也许努力做出来之后对开销敏感的小站还是不够有吸引力。大站一般都不差钱用现有的s3服务就行,也不会有什么动力搬过来。毕竟这种服务一旦推出就必须保证服务质量,只凭用爱发电是不可能持久的。
所以做了许多算数后我决定终止这个项目的开发。这段时间会慢慢把我的设计和已有的代码放到github上。
也许以后等长毛象(中文)的生态更成熟,减少存储空间带来的成本优势大幅超过维护HA系统的开销后,我会再继续开发。
希奇!发布2024年9月 #运营白皮书:
希奇!平台:
目前希奇!除了长毛象主站,还附属有博客平台 https://write.c7.io ,和试运行网盘 https://drive.c7.io 。
额外的站点特色详见 https://c7.io/about
希奇!运营技术情况:
* 服务器基本配置:Dell 独立服务器,56 cores 256GB memory
* 服务器托管:LV Fiberhub机房,1Gbps网络
* 存储:Optane cached ZFS RaidZ2
* 数据备份:每20分钟snapshot,每日异地备份。
希奇!运营资金情况:
* 服务器托管、带宽:$101/m
* 服务器硬件更新:$200/yr
* 域名费用:$40/yr
* CDN + DDoS 防火墙(cloudflare):$0 for now
* Antispam(Cleantalk):$12/yr
@snullp 承诺每月支付站点运营费用。此外也欢迎捐款支持本站https://liberapay.com/sNullp/ 。
希奇!运营承诺:
希奇!承诺运营至一年后,亦即2025年9月。半年后再次发布的白皮书会更新本承诺。
下一次的白皮书明年3月见哟!