完全删除帖子的先前版本或消息

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!

您好,看起来合并的功能与标题内容不符。通过数据浏览器,我发现某个维基主题的某个版本有一个很大的附件,我想删除它。

只想问一下如何在自托管实例上从帖子的版本中删除附件。不幸的是,来自 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。接下来,关闭与数据库的连接,退出用户到 root,然后打开 rails 命令行:

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

最后,您将获得指向文件系统位置的附件 URL。该主题的问题仍然悬而未决。