Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
M
mastofe
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
This is an archived project. Repository and other project resources are read-only.
Show more breadcrumbs
Pleroma
mastofe
Commits
c7adf808
Unverified
Commit
c7adf808
authored
5 years ago
by
Eugen Rochko
Committed by
GitHub
5 years ago
Browse files
Options
Downloads
Patches
Plain Diff
Change `tootctl domains purge` to accept multiple domains at once (#12046)
parent
73bb9eb0
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
lib/mastodon/domains_cli.rb
+7
-7
7 additions, 7 deletions
lib/mastodon/domains_cli.rb
with
7 additions
and
7 deletions
lib/mastodon/domains_cli.rb
+
7
−
7
View file @
c7adf808
...
...
@@ -17,7 +17,7 @@ module Mastodon
option
:verbose
,
type: :boolean
,
aliases:
[
:v
]
option
:dry_run
,
type: :boolean
option
:whitelist_mode
,
type: :boolean
desc
'purge [DOMAIN]'
,
'Remove accounts from a DOMAIN without a trace'
desc
'purge [DOMAIN
...
]'
,
'Remove accounts from a DOMAIN without a trace'
long_desc
<<-
LONG_DESC
Remove all accounts from a given DOMAIN without leaving behind any
records. Unlike a suspension, if the DOMAIN still exists in the wild,
...
...
@@ -27,16 +27,16 @@ module Mastodon
from a single domain, all accounts from domains that are not whitelisted
are removed from the database.
LONG_DESC
def
purge
(
domain
=
nil
)
def
purge
(
*
domain
s
)
dry_run
=
options
[
:dry_run
]
?
' (DRY RUN)'
:
''
scope
=
begin
if
options
[
:whitelist_mode
]
Account
.
remote
.
where
.
not
(
domain:
DomainAllow
.
pluck
(
:domain
))
elsif
domain
.
present
?
Account
.
remote
.
where
(
domain:
domain
)
elsif
!
domain
s
.
empty
?
Account
.
remote
.
where
(
domain:
domain
s
)
else
say
(
'No domain given'
,
:red
)
say
(
'No domain
(s)
given'
,
:red
)
exit
(
1
)
end
end
...
...
@@ -45,11 +45,11 @@ module Mastodon
SuspendAccountService
.
new
.
call
(
account
,
reserve_username:
false
,
skip_side_effects:
true
)
unless
options
[
:dry_run
]
end
DomainBlock
.
where
(
domain:
domain
).
destroy_all
unless
options
[
:dry_run
]
DomainBlock
.
where
(
domain:
domain
s
).
destroy_all
unless
options
[
:dry_run
]
say
(
"Removed
#{
processed
}
accounts
#{
dry_run
}
"
,
:green
)
custom_emojis
=
CustomEmoji
.
where
(
domain:
domain
)
custom_emojis
=
CustomEmoji
.
where
(
domain:
domain
s
)
custom_emojis_count
=
custom_emojis
.
count
custom_emojis
.
destroy_all
unless
options
[
:dry_run
]
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment