Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
M
mastodon
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Model registry
Operate
Environments
Terraform modules
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
Show more breadcrumbs
Pierre Boudes
mastodon
Commits
38f5f9cf
Unverified
Commit
38f5f9cf
authored
6 years ago
by
Eugen Rochko
Committed by
GitHub
6 years ago
Browse files
Options
Downloads
Patches
Plain Diff
Add tootctl accounts backup (#8811)
parent
f0fff3eb
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/accounts_cli.rb
+22
-1
22 additions, 1 deletion
lib/mastodon/accounts_cli.rb
with
22 additions
and
1 deletion
lib/mastodon/accounts_cli.rb
+
22
−
1
View file @
38f5f9cf
...
...
@@ -170,11 +170,32 @@ module Mastodon
exit
(
1
)
end
say
(
"Deleting user with
#{
account
.
statuses_count
}
, this might take a while..."
)
say
(
"Deleting user with
#{
account
.
statuses_count
}
statuses
, this might take a while..."
)
SuspendAccountService
.
new
.
call
(
account
,
remove_user:
true
)
say
(
'OK'
,
:green
)
end
desc
'backup USERNAME'
,
'Request a backup for a user'
long_desc
<<-
LONG_DESC
Request a new backup for an account with a given USERNAME.
The backup will be created in Sidekiq asynchronously, and
the user will receive an e-mail with a link to it once
it's done.
LONG_DESC
def
backup
(
username
)
account
=
Account
.
find_local
(
username
)
if
account
.
nil?
say
(
'No user with such username'
,
:red
)
exit
(
1
)
end
backup
=
account
.
user
.
backups
.
create!
BackupWorker
.
perform_async
(
backup
.
id
)
say
(
'OK'
,
:green
)
end
option
:dry_run
,
type: :boolean
desc
'cull'
,
'Remove remote accounts that no longer exist'
long_desc
<<-
LONG_DESC
...
...
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