…but I’m not sure how to test if those actually work. I don’t know these systems very well. This is just for a small friends group forum.
Initially I had the below live, but I had to comment it back out on the app.yml because it wouldn’t rebuild with those lines live. Not sure if it’s still necessary or not at this point…
I’ve manually uploaded a file from the Digital Ocean Spaces admin area, set it to public, and I’m able to pull it up through a browser.
Here’s an example of how little I know. I’m stuck here and I don’t really know why. Somehow I’ve backed myself out of something and I’m not sure how to get back.
For some reason what’s usually in /var/discourse now seems to be in /var/www/discourse
I’m just stuck at this point though. I’ve searched through the forum and not found anything that will solve it. I’ve spent a day in the same loop. This is along the same lines, but it’s actual AWS S3 and not DO Spaces (S3)…
This is in there. I guess it just doesn’t show with that other command. I had the CDN commented out because it said there were issues with it, so I was trying to isolate that out. Especially because I’m not 100% sure that the URL is the correct one since the example was a custom domain instead of the default Spaces one. Maybe that was a bad idea to try to isolate it out. I was trying a lot of things.
Here’s the full setting…
Commented out the CDN and it gave me the “line 109” error again. Commented out the bottom area also and rebuilt. I can get into the forum, but I can’t upload any attachments still.
With the CDN and bottom area commented out, I can get the forum to work, but I still have the original issue…
Not sure what I’m missing. I gave up left all of the S3 settings commented out for now.
SIDENOTE: Is there a command to update the docker? I think I normally do this through the admin area, but it’s not prompting me to update from 24.0.2. Not sure how big of an issue that is. I think the current is 24.0.7.
If it hadn’t loaded in 30 seconds, it probably won’t. But you don’t need to wait that long. You can look at the network tab in the browser development tools and see what’s not loading.
SOMETHING is working now. I thought I had it all commented out (turned off) and uploaded a photo yesterday to make sure it worked again. I checked the path to it this morning and it’s using the… CDN I guess?
It appears that images are working correctly now. The only thing I can think of is that I unchecked “S3 use IAM profile” in the settings. I’m guessing that’s the key that it was looking for that it stopped looking for. Not sure why I had that checked in the first place. Probably because I really have no clue what I’m doing.
Still having an issue running backups, but maybe that’s a Droplet space issue. Looks like it doesn’t have enough space to stage it locally before uploading. I’ll dig into that separately now that it appears to be at least connected to the Space.
I had a few minutes while waiting for my SO to get ready, so I thought I’d check space. After thinking more about it, I figured that had to be the issue. I checked with…
df -h
Oh yea, really full. Ran…
docker system prune -a
Ran…
./launcher cleanup
Thanks again Jay.
Sure enough, cleared up over 20GB.
Ran the backup manually and it worked!!!
Now I’m trying to migrate all files from local storage to S3…
Checked a few things this morning while waiting for a meeting to start.
Rake didn’t seem to work, or maybe is still in progress. I can’t tell yet. Space usage went down, but when I checked some old photos manually they still seem to have the old local URL. I’ll have to dig into that more.
Not sure what the difference of rake vs reback is. I assume one is migrating the files and the other is updating the paths in the posts. More to learn.
It’s still using a lot of space in /import (1.4GB) and /uploads (9.2GB). A lot for our small package. I’m trying to offload that to cheaper storage and those are by far the biggest chunks.
Some FYI for anyone that’s setting up the same, this is what it’s using for endpoint URLs…
To rebake posts after changing the CDN link in Discourse, you need to run the rebake rake task so that all cooked post HTML gets updated with the new asset URLs.
Here’s the process:
1. Enter the container
cd /var/discourse
./launcher enter app
2. Run the rebake task
rake posts:rebake
This will:
Re-render all posts using the current settings (including your new s3_cdn_url).
Update cooked HTML so images and uploads point to the CDN.
Optional: Speed it up
If you have a large site, you can run it in batches:
rake posts:rebake[1000]
This rebakes 1,000 posts at a time.
3. Verify
Check a few posts with images or uploads to confirm they now use the CDN URL.
__________
Seems to be running. I’ll check back later.
This runs the rebake, but not just 1,000 at a time. It just runs them all and ignores the [1000] part. Maybe my syntax isn’t quite correct there.
Another reminder for myself as much as anyone else. I was looking for this URL in the menu because I had it backwards ( .cdn.sfo3. instead of vice versa - which obviously broke the SSL). I couldn’t find the setting when searching. Then I found a window that I already had it open. I updated it and tried to save and got this…