• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

compufox/silence: autoblocks gab-modified mastodon instances

原作者: [db:作者] 来自: 网络 收藏 邀请

开源软件名称(OpenSource Name):

compufox/silence

开源软件地址(OpenSource Url):

https://github.com/compufox/silence

开源编程语言(OpenSource Language):

Ruby 100.0%

开源软件介绍(OpenSource Introduction):

silence

"everything is so peaceful without all the gab" ;p

installation

if you plan on using this script in admin mode (see below for explanation) you won't need to install anything as it uses the gems that your mastodon installation uses. you will need bundler 2+, but you should already have that because you have mastodon installed.

if you plan on using the script in user mode (see below for explanation) you'll need to clone (or download) this repo and run

bundle install

in the folder, assuming you have ruby and bundler installed.

usage

./silence --help

the script supports two modes: admin and user mode

admin mode

admin mode is meant for server administrators as it creates server level blocks.

to run in admin mode, you'll need to pass the option -a and have the RAILS_ENV environment var set to 'production'

the script assumes the mastodon root folder is the parent folder (as in, this git repo is placed inside the mastodon root folder), however you can specify the relative path to the root folder by using the -p option

example usage: ./silence -a -p '../mastodon'

example usage setting envvar: RAILS_ENV=production ./silence -a -p '../mastodon'

note: silence will check if a domain is blocked already and will not attempt to block it if it already is. in mastodon v2.9.1+ subdomains are automatically blocked when the base domain is blocked. so if you notice that the script isnt blocking 'bad.gab.garbage' and you already have a block for 'gab.garbage' thats why!

user mode

user mode is meant for typical users and creates domain blocks for that user

this is the default mode for the script. on the first run you'll need to pass in an access token and an instance url

after this first time the script will save this information so you don't have to re-run with those extra options

if you don't know how to get a token, please read the next section

example first run usage: ./silence -i 'mastodon.social' -t 'CoOl_T0KEn'

example post first run usage: ./silence

getting an access token

  1. login to your mastodon account
  2. go to settings
  3. click the 'development' heading on the side
  4. click the 'new application' button
  5. you can put anything in for 'name' (scopes can stay the default but if you're privacy minded you can uncheck all scopes except read:blocks and write:blocks)
  6. click the submit button at the bottom. this will take you back to the development menu
  7. click the newly created application
  8. highlight and copy the access token
  9. you did it! use that token on the first run usage! :3

unsolicited advice from me~

im just gonna add this script into my crontab, and i personally suggest you do too.

if you're using admin mode, it might be easier to add RAILS_ENV=production into your shell's initialization file, that way you don't have to worry about adding it in for every invocation.

oh! and before you run this in user-mode make sure you're admin isn't already using it. it won't hurt anything, just a bit redundent :p




鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap