Public scripts for assorted web maintenance tasks used in my server.
Find a file
2025-03-26 13:50:25 -06:00
copy.sh fix: Remove intensive tasks by default from scheduled maintenance 2025-03-26 13:50:25 -06:00
friendica-clean-database.sh feat: Allow the messages for the database cleaner to be silenced 2025-03-26 13:49:46 -06:00
friendica-compress-storage.sh fix: Add the detector of GIF length to the storage compressor 2025-02-25 11:40:48 -06:00
friendica-delete-old-users.sh feat: Add parameter to set amount of time to delete, add several optimizations and safeguards 2025-03-11 09:58:00 -06:00
friendica-delete-specific-contact.sh fix: Remove parallel code for a single-item deletion; fix input ID parameter 2025-03-07 12:37:33 -06:00
friendica-find-largest-accounts.sh fix: Use correct join for gserver 2025-03-07 12:37:58 -06:00
friendica-find-missing-servers.sh feat: Improve the output method for several scripts 2025-03-06 09:31:04 -06:00
friendica-fix-avatar-permissions.sh fix: Correct parentheses in thread condition 2025-02-28 08:52:49 -06:00
friendica-non-follower-featured-posts.sh fix: Limit filter for worker queue selection to not-done items 2025-03-05 09:22:28 -06:00
friendica-remove-invalid-photos.sh feat: Improve the output method for several scripts 2025-03-06 09:31:04 -06:00
friendica-remove-old-photos-parallel.sh feat: Detect MariaDB vs MySQL automatically 2025-02-12 21:27:45 +00:00
friendica-workerqueue.sh chore: Initial release 2025-01-24 19:16:21 +00:00
LICENSE feat: Make output more clear; add support for MariaDB and MySQL 2025-02-01 23:12:02 +00:00
media-optimize-local.sh fix: Improve the parsing of animated WebP files in case they're erased before testing 2025-02-10 15:15:46 +00:00
README.md chore: Update README 2025-03-06 09:31:50 -06:00

public-scripts

Public scripts for assorted web maintenance tasks used in my server.

Description

As you can see, the vast majority of my scripts are used to handle my Friendica server, especially where the default PHP would take too long or not cover my usage case.

  • copy.sh: The "build script" specific to my usage case. It requires shfmt and shellcheck installed to clean up the scripts. Also, since my repository is on Document/Repositories/public-scripts and my actual scripts are on Document/Scripts, it copies the files there as well, with the placeholder URLs changed for my server's. Finally, it copies the relevant scripts to my cron folder if they exist, with output off (uncommenting the #&> /dev/null).
  • friendica-clean-database.sh: Basically, it does the same things that the included ExpirePosts, but with the option to be more aggressive than the defaults (deleting items that are 7 days old instead of 60, for example).
  • friendica-compress-storage.sh: It searches for any image files in the storage folder, and compresses them accordingly. Requires gifsicle, oxipng, jpegoptim, and cwebp installed.
  • friendica-delete-old-users.sh: Complimentary to the included RemoveUnusedContacts, it deletes any users that have not posted anything in the last month, and aren't in any user's contact list.
  • friendica-find-missing-servers.sh: Complimentary to the included RemoveUnusedContacts, it finds any offline servers and deletes any users from them, that aren't in any user's contact list.
  • friendica-fix-avatar-permissions.sh: Used to properly transfer avatars from storage to avatar with the correct permissions, and also compresses the files accordingly. Requires gifsicle, oxipng, jpegoptim, and cwebp installed.
  • friendica-non-followed-featured-posts.sh: If you accidentally configured Friendica to fetch featured posts from all interactors instead of known followers only, this script removes the related workers from the queue while leaving the known followers in place.
  • friendica-remove-invalid-photos.sh: Used to fix issues with blank images due to a botched transfer from storage to avatar, for example. It finds any broken items in the database and removes them for regeneration later. Requires curl.
  • friendica-remove-old-photos-parallel.sh: Finds any files in avatar that are no longer associated to any contact and deletes them.
  • friendica-workerqueue.sh: Just a SQL query that shows the worker queue sorted by type of job.
  • friendica-find-largest-accounts.sh: Finds which are the contacts that have the most posts assigned to them.
  • friendica-delete-specific-contact.sh: Uses the same code as the previous scripts to delete all data from a specific user, particularly useful for unfollowed contacts with too many posts.
  • media-optimize-local.sh: For a given folder, it finds any image files within and compresses them. Requires gifsicle, oxipng, jpegoptim, and cwebp installed.

License

As most of these files are based on content from Friendica (especially its queries), the repository is also under the Affero General Public License.