投稿やメッセージの以前のバージョンを完全に削除する

Say you had to send someone an Android debug log. These logs contain a log of private information. You shouldn’t post that URL in public, and if you message it in person the URL or attachment should be deleted soon after.

Even admins or moderators shouldn’t be able to recover that URL or attachment.
If we can’t delete it it will forever remain visible to the sender, and to all admins and moderators. These logs accumulate over time and it’s a lot of sensitive information lingering forever.

How can we not just hide that URL or attachment but actually delete it?

「いいね!」 1

with this PR, it seems possible. i like :slight_smile:

Sounds like something we need indeed. And it should also apply to messages.
Wow this was committed 3 hours ago? Great!

こんにちは。マージされた機能がタイトルと一致しないようです。データエクスプローラーで、特定のWikiトピックのいくつかのバージョンに大きな添付ファイルがあり、それを削除したいことがわかりました。

「投稿のバージョンから添付ファイルを削除する方法」をセルフホスト型インスタンスで知りたいだけです。残念ながら、Search attachments by storage name の方法は、この場合(ファイル名からsha1を取得できない)適用できません。

まず、SQLを使用してsha1を見つけます。

sudo /var/discourse/launcher enter app
su - discourse
psql
SELECT filesize, original_filename, sha1 FROM uploads WHERE filesize > 3000000 order BY filesize desc;

次に、sha1を取得します。次に、データベースへの接続を閉じ、ユーザーからルートにエグジットし、Railsコマンドラインを開きます。

ctrl+d
ctrl+d
rails c
pry(main)> Upload.find_by(sha1: '<sha1>')

最後に、ファイルシステム上の添付ファイルへのURLを取得します。トピックの質問はまだ開いています。