Delete topics in Discourse
-
Hard and permanently deleting topics in Discourse is a highly proteced feat.
The instructions say that one must invoke the Rails console and setSiteSetting.can_permanently_delete = trueSee: https://meta.discourse.org/t/introducing-permanently-delete-post-functionality/207109
Not getting this to work - throwing following log:
Is it the read-only!?
Cheers/home/cloudron/rbenv/versions/3.2.1/lib/ruby/3.2.0/irb/ext/save-history.rb:116:in `initialize': Read-only file system @ rb_sysopen - /home/cloudron/.irb_history (Errno::EROFS) from /home/cloudron/rbenv/versions/3.2.1/lib/ruby/3.2.0/irb/ext/save-history.rb:116:in `open' from /home/cloudron/rbenv/versions/3.2.1/lib/ruby/3.2.0/irb/ext/save-history.rb:116:in `save_history' from /home/cloudron/rbenv/versions/3.2.1/lib/ruby/3.2.0/irb/ext/save-history.rb:60:in `block in extended' from /home/cloudron/rbenv/versions/3.2.1/lib/ruby/3.2.0/irb.rb:504:in `block in run' from /home/cloudron/rbenv/versions/3.2.1/lib/ruby/3.2.0/irb.rb:504:in `each' from /home/cloudron/rbenv/versions/3.2.1/lib/ruby/3.2.0/irb.rb:504:in `run' from /home/cloudron/rbenv/versions/3.2.1/lib/ruby/3.2.0/irb.rb:421:in `start' from /app/code/vendor/bundle/ruby/3.2.0/gems/railties-7.0.5.1/lib/rails/commands/console/console_command.rb:74:in `start' from /app/code/vendor/bundle/ruby/3.2.0/gems/railties-7.0.5.1/lib/rails/commands/console/console_command.rb:19:in `start' from /app/code/vendor/bundle/ruby/3.2.0/gems/railties-7.0.5.1/lib/rails/commands/console/console_command.rb:106:in `perform' from /app/code/vendor/bundle/ruby/3.2.0/gems/thor-1.2.2/lib/thor/command.rb:27:in `run' from /app/code/vendor/bundle/ruby/3.2.0/gems/thor-1.2.2/lib/thor/invocation.rb:127:in `invoke_command' from /app/code/vendor/bundle/ruby/3.2.0/gems/thor-1.2.2/lib/thor.rb:392:in `dispatch' from /app/code/vendor/bundle/ruby/3.2.0/gems/railties-7.0.5.1/lib/rails/command/base.rb:87:in `perform' from /app/code/vendor/bundle/ruby/3.2.0/gems/railties-7.0.5.1/lib/rails/command.rb:48:in `invoke' from /app/code/vendor/bundle/ruby/3.2.0/gems/railties-7.0.5.1/lib/rails/commands.rb:18:in `<main>' from <internal:/home/cloudron/rbenv/versions/3.2.1/lib/ruby/3.2.0/rubygems/core_ext/kernel_require.rb>:37:in `require' from <internal:/home/cloudron/rbenv/versions/3.2.1/lib/ruby/3.2.0/rubygems/core_ext/kernel_require.rb>:37:in `require' from /app/code/vendor/bundle/ruby/3.2.0/gems/bootsnap-1.16.0/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:32:in `require' from script/rails:8:in `<top (required)>' from /app/code/vendor/bundle/ruby/3.2.0/gems/bundler-2.4.13/lib/bundler/cli/exec.rb:58:in `load' from /app/code/vendor/bundle/ruby/3.2.0/gems/bundler-2.4.13/lib/bundler/cli/exec.rb:58:in `kernel_load' from /app/code/vendor/bundle/ruby/3.2.0/gems/bundler-2.4.13/lib/bundler/cli/exec.rb:23:in `run' from /app/code/vendor/bundle/ruby/3.2.0/gems/bundler-2.4.13/lib/bundler/cli.rb:492:in `exec' from /app/code/vendor/bundle/ruby/3.2.0/gems/bundler-2.4.13/lib/bundler/vendor/thor/lib/thor/command.rb:27:in `run' from /app/code/vendor/bundle/ruby/3.2.0/gems/bundler-2.4.13/lib/bundler/vendor/thor/lib/thor/invocation.rb:127:in `invoke_command' from /app/code/vendor/bundle/ruby/3.2.0/gems/bundler-2.4.13/lib/bundler/vendor/thor/lib/thor.rb:392:in `dispatch' from /app/code/vendor/bundle/ruby/3.2.0/gems/bundler-2.4.13/lib/bundler/cli.rb:34:in `dispatch' from /app/code/vendor/bundle/ruby/3.2.0/gems/bundler-2.4.13/lib/bundler/vendor/thor/lib/thor/base.rb:485:in `start' from /app/code/vendor/bundle/ruby/3.2.0/gems/bundler-2.4.13/lib/bundler/cli.rb:28:in `start' from /app/code/vendor/bundle/ruby/3.2.0/gems/bundler-2.4.13/exe/bundle:45:in `block in <top (required)>' from /app/code/vendor/bundle/ruby/3.2.0/gems/bundler-2.4.13/lib/bundler/friendly_errors.rb:117:in `with_friendly_errors' from /app/code/vendor/bundle/ruby/3.2.0/gems/bundler-2.4.13/exe/bundle:33:in `<top (required)>' from /home/cloudron/rbenv/versions/3.2.1/bin/bundle:25:in `load' from /home/cloudron/rbenv/versions/3.2.1/bin/bundle:25:in `<main>' -
N nebulon marked this topic as a question on
-
Just tried this on a fresh installation and running the mentioned command:
SiteSetting.can_permanently_delete = truein a rails console session via the webterminal and:
gosu cloudron:cloudron bundle exec script/rails consoleThen without restarting discourse, the option will appear in the UI on browser refresh and it works fine here.
I can't reproduce the error about
/home/cloudron/.irb_history (Errno::EROFS)but that sounds very much like a read-only issue. For this we would need to probably create a link for that file into/app/data, but I would first like to understand where this comes from. -
G girish has marked this topic as solved on
Hello! It looks like you're interested in this conversation, but you don't have an account yet.
Getting fed up of having to scroll through the same posts each visit? When you register for an account, you'll always come back to exactly where you were before, and choose to be notified of new replies (either via email, or push notification). You'll also be able to save bookmarks and upvote posts to show your appreciation to other community members.
With your input, this post could be even better 💗
Register Login