My apologies, as I know this might have been discussed at length previously, but I am still trying to understand. On a reply by @codinghorror, a while back, he wrote:
Will that mean that, if I want to completely delete a post, I should just hide them? Will the delete removed posts after setting apply to the forum administrator, and thus, the topics/posts deleted/hidden by the administrator’s account be removed after the n hours set? Are posts and topics considered the same, for this setting?
How can one delete uploads, so that the purge deleted uploads grace period days settings become applicable (Grace period (in days) before a deleted upload is erased)?
So, based on the silent acceptance this topic got, am I to assume hidden posts do not get deleted after 30 days, and thus the delete removed posts after setting is a placebo?
Okay, I must have missed this topic earlier, but here is my understanding of how that setting works.
A Hidden post is still a post that can be seen by other users, it has the message of “this content is hidden due to community flagging”, or something like that, and therefore it is still “visible”
At 30 days (or whatever you have set), the post will be marked as “deleted”
This does not permanently destroy the post, instead it hides it from regular users to where only staff can see it. Discourse, to my knowledge, NEVER destroys a post entirely.
Uploads in that now deleted post, should eventually be cleaned up via the grace period at the next time it runs via Sidekiq.
Not trying to be nitpicky, but if delete doesn’t delete, then maybe that word shouldn’t be used. Flagged should replace the current Hidden, and Hidden should be made the new deleted.
I searched meta a lot, and found three years old developer discussions about implementing a real purge. There has been no advances on that idea, correct?
I am unaware of any plans for a real purge. The only way I know to do that is via the Rails console and calling post.destroy() on the post in question. So it technically exists, but isn’t automated in any form.
FYI, in Discourse, we “soft-delete” topics/posts. Meaning the content is still stored in the database but it flagged as being deleted and is thus not shown to standard users (admins can always seem them if they want to).
This help tremendously in dealing with spammers and/or misbehaving users.
@David_Collantes would you mind explaining why you wanted to completely erase the content of a post?
Immagina che un utente pubblichi qualcosa di davvero sensibile, come le informazioni di una carta di credito, il numero di previdenza sociale di qualcuno, qualcosa che non vogliamo assolutamente visibile a nessuno, o persino qualcosa che il team legale della tua organizzazione ti chiede di rimuovere perché potrebbe diventare un rischio legale.
Un ulteriore fattore è che i post “soft-cancellati” sembrano essere accessibili non solo agli amministratori, ma anche ai moderatori. Se hai un forum in cui i membri della comunità possono ottenere un ruolo di moderatore, ciò complica ulteriormente gli scenari legati alla privacy.
Se esistesse un comando da riga di comando per eliminare tali post in circostanze eccezionali, funzionerebbe altrettanto bene.
Ciao,
Poiché Discourse “elimina logicamente” i post, possiamo considerare questo comando Rails il modo consigliato per eliminare completamente un post contenente informazioni altamente sensibili come quelle fornite come esempi da @icaria36? Se non lo è, qual sarebbe il modo consigliato per gestire questo tipo di post?
Ti viene in mente qualche caso in cui l’eliminazione completa di un post del genere potrebbe rompere qualcosa in Discourse?
L’eliminazione definitiva di un post utilizzando .destroy è il metodo consigliato. Non romperà nulla in Discourse, poiché ci sono processi in background che garantiscono la coerenza.
Potrebbero esserci alcune discrepanze nei conteggi per un periodo compreso tra 1 e 7 giorni, a seconda dei casi. (Sam ha pubblicato 9997 post, ma in realtà ne ha pubblicati solo 9996).
Non sono sicuro che sia l’ideale, ma ho usato questo codice per sostituire il contenuto del post dell’utente nei topic eliminati con "[deleted]". In questo modo è stata preservata l’esistenza dei post e mi è sembrato più sicuro rispetto alla loro distruzione completa.
# backup preliminare
deleted_topic_id = 1234
user_id = 5678
t = Topic.unscoped.find(deleted_topic_id)
ps = t.posts.select { |p| p.user_id == user_id }
# `ps.count` per verificare
ps.each do |p|
p.raw = '[deleted]'
p.save
end
Non avevo capito che nascondere un post segnalato non lo rendesse invisibile agli altri utenti del forum. Esiste un modo per abbreviare il tempo di cancellazione di 30 giorni?