Add a table of contents

This commit is contained in:
Eugen Wissner 2025-02-24 21:09:23 +01:00
parent 2dd3856389
commit e4b90761b8
Signed by: belka
GPG Key ID: A27FDC1E8EE902C0
6 changed files with 61 additions and 0 deletions

View File

@ -1,3 +1,10 @@
1. [7digital.rb](#7digitalrb)
2. [mock\_server.rb](#mock_serverrb)
3. [read\_logs.rb](#read_logsrb)
4. [cross\_toolchain.rb](#cross_toolchainrb)
5. [rename.rb](#renamerb)
6. [tea-cleaner](#tea-cleaner)
## 7digital.rb ## 7digital.rb
7digital sells digital music but they can't handle files with non-English names. 7digital sells digital music but they can't handle files with non-English names.
@ -64,3 +71,37 @@ Call the `rename.rb` without arguments to see the usage information and an
example. example.
## tea-cleaner ## tea-cleaner
`tea-cleaner` tries to detect spam accounts on a gitea instance and can remove
them automatically.
### Run instructions
See `tea-cleaner.toml.dist` for a description of the available configuration.
Copy this file to `config/tea-cleaner.toml` and change at least `token` and
`server` values. After that if you just run `tea-cleaner` it will give a list
of user accounts which look suspicious to it. Rerunning the command with the
`--live-run` flag will purge the listed accounts and all their activities,
assuming the given token has amdinistrative access to the Gitea instance.
Run `tea-cleanr --help` to see all available command line options.
### Applied rules
Critical:
- The account is elder than a month and the user hasn't logged in since then.
- User information contains banned words (can be adjusted in the configuration file).
- User's homepage contains percent encoded symbols.
Possible:
- User filled fields for personal information: description and website.
- The mail address domain is unusual (can be adjusted in the configuration file).
The accounts that violate one of the critical rules are marked for removal
right away. Other checks trigger an additional lookup for the last user
activities. If everything user did was creating an empty repository, these
accounts are marked for removal as well.
The rules are based on my invastigation of spam accounts on this instance.

View File

@ -1,3 +1,7 @@
{- This Source Code Form is subject to the terms of the Mozilla Public License,
v. 2.0. If a copy of the MPL was not distributed with this file, You can
obtain one at https://mozilla.org/MPL/2.0/. -}
module Main module Main
( main ( main
) where ) where

View File

@ -1,3 +1,7 @@
{- This Source Code Form is subject to the terms of the Mozilla Public License,
v. 2.0. If a copy of the MPL was not distributed with this file, You can
obtain one at https://mozilla.org/MPL/2.0/. -}
module TeaCleaner.Client module TeaCleaner.Client
( Activity(..) ( Activity(..)
, User(..) , User(..)

View File

@ -1,3 +1,7 @@
{- This Source Code Form is subject to the terms of the Mozilla Public License,
v. 2.0. If a copy of the MPL was not distributed with this file, You can
obtain one at https://mozilla.org/MPL/2.0/. -}
module TeaCleaner.Configuration module TeaCleaner.Configuration
( ProgramOptions(..) ( ProgramOptions(..)
, Settings(..) , Settings(..)

View File

@ -1,3 +1,7 @@
{- This Source Code Form is subject to the terms of the Mozilla Public License,
v. 2.0. If a copy of the MPL was not distributed with this file, You can
obtain one at https://mozilla.org/MPL/2.0/. -}
module TeaCleaner.Filter module TeaCleaner.Filter
( FilterResult(..) ( FilterResult(..)
, UserFilter(..) , UserFilter(..)

View File

@ -1,3 +1,7 @@
{- This Source Code Form is subject to the terms of the Mozilla Public License,
v. 2.0. If a copy of the MPL was not distributed with this file, You can
obtain one at https://mozilla.org/MPL/2.0/. -}
module TeaCleaner.Options module TeaCleaner.Options
( jsonOptions ( jsonOptions
) where ) where