New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Block/Close and wipe data for all accounts on local pod in admin UI #8249
base: develop
Are you sure you want to change the base?
Conversation
Uh.. "Green" with first commit! |
Awesome work, thank you! One suggestion: use "Block" instead of "Close" when you're talking about remote account. Also, is the pub key of the user stored somewhere or definitely replaced? If the account is blocked indefinitely (can't be unblocked), I would warn about it in the confirm popup (you kept it for remote account, did you?). |
It was intended to 'block' external accounts and 'close' local ones. Do you think to change button names for local and remote accounts? |
Yes, I kept the confirmation. |
It is intended that the serialized_public_key is set to "BLOCKED" ( but it don't work now) |
Yeah I would love confirmation on this by others @jhass @SuperTux88 what do you think, should we store the pub key somewhere in case the podmin wants to restore it, or can we go like this with irreversible block? |
app/views/admins/_user_entry.haml
Outdated
.label.label-danger | ||
Closed | ||
- else | ||
-if person.locked_access? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
- Style/IfInsideElse: Convert
if
nested insideelse
toelsif
. - The - symbol should have one space separating it from code
app/views/admins/_user_entry.haml
Outdated
- if person.closed_account? | ||
.label.label-danger | ||
Closed | ||
- else |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Line contains trailing whitespace
admin_close_account_path(person.id), | ||
method: :post, data: {confirm: t("admins.user_search.are_you_sure")}, | ||
class: "btn btn-danger btn-block" | ||
= link_to person.owner.present? ? t("admins.user_search.wipe_and_close_account") : t("admins.user_search.wipe_and_block_account"), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Line is too long. [132/120]
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should be ignored, I don't like to split the ternary into multiple lines. Other Ideas?
@@ -0,0 +1,4 @@ | |||
- if !person.closed_account? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Style/NegatedIf: Favor unless
over if
for negative conditions.
Don't do that. That's a hacky workaround from a manual script for people who know what they are doing and know how to fix it again when things breaks. It isn't guaranteed that manually changing keys won't cause problem in the future, so this is not something that should be done here (a similar hacky workaround with messing with the key in the past did break things eventually). The clean solution would be just deny federation messages from closed accounts (maybe except And if the button closes an account it should say "close", not "block". The federation blocking from closed accounts doesn't necessarily need to be done in the scope of this PR, but just don't modify the key here. |
But what does "Close" mean for a remote account? |
Maybe "Close locally" or something? The alternative would be to introduce a "blocked" state of a person and use that instead. The advantage of that would be, that it can be undone, and can be differentiated from the closed state (so people trying to visit a blocked account could get a "this account was blocked" message instead of the message that the account was closed), and we could still see when the account was closed for real (by either the user itself or the remote podmin) ... and we could even keep the "blocked" state when somebody migrates a previously blocked account to a new pod, which we probably want to block again. |
@SuperTux88
"Closed" accounts still spill new posts or comments into the pod. But I am still not so deep into architecture to find the 'right' point in source. |
Yes
To people who know how diaspora works, it should be clear that "close" of a remote account doesn't allow to close the account on other pods. But people who are new to diaspora "close locally" maybe is cleaner.
If a blocked state is added later, the button could be changed to use that then (and not close the account anymore) ... the button then can be renamed to "block" and blocking can also be undone then. But I think it's fine to first do it with closing in this PR and do the separate block state later (also I think this can then be merged to 0.7.x while the blocking then can go to 0.8.x because of model change ... but if it's separated the 0.7.x people can also already profit from it)
See my comment here: #8228 (comment) (sorry, I accidentally submitted that comment too early, but it's now complete) |
admin_close_account_path(person.id), | ||
method: :post, data: {confirm: t("admins.user_search.are_you_sure")}, | ||
class: "btn btn-danger btn-block" | ||
= link_to person.owner.present? ? t("admins.user_search.wipe_and_close_account") : t("admins.user_search.wipe_and_close_local_account"), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Line is too long. [138/120]
@SuperTux88 To block receiving messages is mainly implemented in #8228 and will come into this code after merging. (Added a TODO on the lines) Will clean this lines while expecting merge conflicts then. |
e14f182
to
fea288e
Compare
fea288e
to
0ed7113
Compare
This looks very useful, and thanks for working on it, @tclaus. Just one question: are the user accounts in your screen-shots real accounts or did you invent them? If they're real accounts, would you mind blurring the personal details in your screenshots, or replacing them with invented ones? Just for personal privacy. |
It solves #7464 and #7463
For this function you now can search through all persons on your pod, not only the local user.
Remote / Local user in users' search view