Conversation
Notices
-
Matty-kun :Christmas_kitty_bell: (matty@nicecrew.digital)'s status on Monday, 02-Jan-2023 06:26:50 JST Matty-kun :Christmas_kitty_bell: I don't know bash well enough, unfortunately. -
Vivi Nella Verita :Debian_logo: (verita84@poster.place)'s status on Monday, 02-Jan-2023 06:26:50 JST Vivi Nella Verita :Debian_logo: @matty
Me either . I Google it to get the right syntax n shit
Most of what you need is in here
https://git.poster.place/verita84/blockbot/src/branch/main/bot.sh likes this. -
Matty-kun :Christmas_kitty_bell: (matty@nicecrew.digital)'s status on Monday, 02-Jan-2023 06:26:51 JST Matty-kun :Christmas_kitty_bell: That would probably be much faster. In conversation permalink -
Vivi Nella Verita :Debian_logo: (verita84@poster.place)'s status on Monday, 02-Jan-2023 06:26:51 JST Vivi Nella Verita :Debian_logo: @matty
And easier with bash than using a real languageIn conversation permalink -
Vivi Nella Verita :Debian_logo: (verita84@poster.place)'s status on Monday, 02-Jan-2023 06:26:52 JST Vivi Nella Verita :Debian_logo: @matty
That could be easy and IO intensive. Have to query each user and backup the file. Maybe simple bash script like with my blockbotIn conversation permalink -
Matty-kun :Christmas_kitty_bell: (matty@nicecrew.digital)'s status on Monday, 02-Jan-2023 06:26:52 JST Matty-kun :Christmas_kitty_bell: Well, the idea that I have would be to pull each user's information (I think the admin API returns a JSON object with the links to users' avatars and banners), stick those filenames in to an array as to not delete, then delete everything else, or everything uploaded beyond a certain date. In conversation permalink -
Vivi Nella Verita :Debian_logo: (verita84@poster.place)'s status on Monday, 02-Jan-2023 06:26:52 JST Vivi Nella Verita :Debian_logo: @matty
Oh good to know. Or just copy the user avatar from the json object to a temp dir, delete everything , and copy back the avatars to make it quick and easyIn conversation permalink -
Vivi Nella Verita :Debian_logo: (verita84@poster.place)'s status on Monday, 02-Jan-2023 06:26:53 JST Vivi Nella Verita :Debian_logo: @matty
How large does it grow daily?In conversation permalink -
Matty-kun :Christmas_kitty_bell: (matty@nicecrew.digital)'s status on Monday, 02-Jan-2023 06:26:53 JST Matty-kun :Christmas_kitty_bell: Not too badly. It's the uploads that grow faster. I submitted a git issue to restructure the media directory in the future so purging old assets doesn't cause problems with avatars, banners, icons, et cetera.
https://gitlab.com/soapbox-pub/rebased/-/issues/144In conversation permalink Attachments
-
Vivi Nella Verita :Debian_logo: (verita84@poster.place)'s status on Monday, 02-Jan-2023 06:26:53 JST Vivi Nella Verita :Debian_logo: @matty
Good work, that is needed badly. You will probably still need to purge the avatars once at leastIn conversation permalink -
Matty-kun :Christmas_kitty_bell: (matty@nicecrew.digital)'s status on Monday, 02-Jan-2023 06:26:53 JST Matty-kun :Christmas_kitty_bell: If it doesn't get resolved by the time it becomes a bigger issue for us, I'll probably just make a script to purge old media using JavaScript and some API calls. In conversation permalink -
Matty-kun :Christmas_kitty_bell: (matty@nicecrew.digital)'s status on Monday, 02-Jan-2023 06:26:54 JST Matty-kun :Christmas_kitty_bell: As our database grows, I'll have to move it over to a larger storage medium. Expect downtime in the future when I do that. Won't be for the next few weeks or so, most likely. In conversation permalink
-