Discourse s3 backup folder

When uploading to s3, discourse will save backups to the default folder
this makes the default download link of discourse here unusable:
https://domain.com/admin/backups/backup.tar.gz?token=id

must manually edit the above link as follows to use:
https://domain.com/admin/backups/default/backup.tar.gz?token=id

how to configure this problem?

You might be able to do something like this-Replace a string in all posts

2 Likes

Is there any way to limit this to just the backups settings area?

This looks a bit dangerous, because if there is another matching character in the entire database, it will be overwritten:

hooks:
  after_code:
    - exec:
        cd: $home
        cmd:
          - >
            rails r "
            Post.where(\"cooked LIKE '%/admin/backups/%'\").find_each do |post|
              post.cooked = post.cooked.gsub('/admin/backups/', '/admin/backups/default/');
              post.save!;
              post.revise(Discourse.system_user, post.cooked, bypass_rate_limiter: true);
            end
            "
          - >
            rails r "
            Upload.where(\"url LIKE '%/admin/backups/%'\").find_each do |upload|
              upload.url = upload.url.gsub('/admin/backups/', '/admin/backups/default/');
              upload.save!;
            end
            "
1 Like

sorry i misread your post earlier thinking you were talking about a migrated forum links for some reason.

this seems like something isn’t set up properly.

has it always been this way or did you change something?

I 'm trying to setup with seaweedfs s3. But it seems not to be here: