Public scripts for assorted web maintenance tasks used in my server.
Find a file
2026-06-19 16:13:10 +00:00
.gitignore feat: Add two new scripts to backfill with Lemmy content and trending hashtags 2025-10-31 04:33:53 +00:00
copy.sh feat: Add a new parameter overrides to settings file, to control ban-list URL overrides 2026-05-25 14:17:54 +00:00
credentials-default.csv feat: Parameterize most settings into separate files 2025-10-30 16:36:18 +00:00
friendica-apply-blocks.sh fix: Embed simplified version of friendica-delete-specific-contact.sh 2026-06-11 16:05:34 +00:00
friendica-clean-database.sh fix: Set the ratio correctly 2026-06-19 16:13:10 +00:00
friendica-compress-storage.sh chore: Add changes from shellcheck 2026-06-05 14:55:15 +00:00
friendica-delete-non-follower-featured-posts.sh chore: Fix issues found by linter 2026-03-27 15:04:13 +00:00
friendica-delete-old-posts.sh chore: Correct spacing 2026-03-12 15:15:06 +00:00
friendica-delete-old-users-full.sh fix: Use "local_" prefix to prevent indexes from being dropped by Friendica's maintenance scripts 2026-06-05 14:53:53 +00:00
friendica-delete-old-users.sh fix: Use "local_" prefix to prevent indexes from being dropped by Friendica's maintenance scripts 2026-06-05 14:53:53 +00:00
friendica-delete-specific-contact.sh fix: Skip deletion of system account's contacts 2026-05-11 16:49:27 +00:00
friendica-find-largest-accounts.sh feat: Make the script more resilient to null values 2026-06-11 16:06:43 +00:00
friendica-find-missing-servers.sh fix: Use "local_" prefix to prevent indexes from being dropped by Friendica's maintenance scripts 2026-06-05 14:53:53 +00:00
friendica-fix-avatar-permissions.sh chore: Account for single-core devices; update default PHP version 2026-04-13 14:41:21 +00:00
friendica-local-backfill-lemmy.sh feat: Make fetching popular communities' data optional 2026-05-11 16:51:16 +00:00
friendica-remove-invalid-photos.sh fix: Use "local_" prefix to prevent indexes from being dropped by Friendica's maintenance scripts 2026-06-05 14:53:53 +00:00
friendica-remove-old-photos-parallel.sh fix: Use "local_" prefix to prevent indexes from being dropped by Friendica's maintenance scripts 2026-06-05 14:53:53 +00:00
friendica-workerqueue.sh feat: Display count of non-ProcessQueue jobs 2026-01-16 16:32:52 +00:00
LICENSE chore: Settle file permissions 2025-09-07 15:34:13 -06:00
mariadb-delete-unallocated-items.sh fix: Account for all deletions; properly stop at maximum item; fix loops 2026-05-21 14:31:05 +00:00
media-optimize-local.sh chore: Use option to simplify bash scripts 2026-01-23 18:17:02 +00:00
nextcloud-bookmarks-cache-compression.sh fix: Correct parallelism logic 2026-06-11 16:07:11 +00:00
README.md fix: Correct file name in README 2026-05-25 14:35:17 +00:00
settings-default.csv feat: Add a new parameter overrides to settings file, to control ban-list URL overrides 2026-05-25 14:17:54 +00:00
trending-hashtags.sh feat: Add a new parameter overrides to settings file, to control ban-list URL overrides 2026-05-25 14:17:54 +00:00
youtube-download-channel.sh fix: Account for systems without uuidgen 2026-06-05 14:54:19 +00:00

public-scripts

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

This is a mirrored repository

If you're browsing this repository from Codeberg or GitHub, you should know that the main home for these files is on my personal server over Forgejo.

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). You can, of course, parameterize your own settings using the required files settings.csv and credentials.csv - samples of each are provided in this repository.
  • friendica-apply-blocks.sh: Allows recursively importing the block lists of the most popular instances into your Friendica instance. You can also configure a list of exceptions by adding them to the overrides parameter in your settings.csv file.
  • 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 the posts from any users that have not posted anything in the last year (by default), and aren't in any user's contact list.
  • friendica-delete-old-users-full.sh: Same as above, but it fully deletes the users from the database instead of just deleting their posts.
  • friendica-delete-old-posts.sh: It searches for any posts, from any users not followed by this instance or its channels/groups, that are older than a given date, and deletes them.
  • 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-delete-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.
  • youtube-download-channel.sh: A wrapper to ease downloading metadata from subscriptions or channels, in order to export it as a CSV, and as a playlist DB file compatible with FreeTube. Requires yt-dlp, jq, zstd, and optionally a cookie to download your subscriptions.
  • friendica-local-backfill-lemmy.sh: Used to backfill the Friendica server with data from all the Lemmy / Piefed servers that are followed by the users of the server. It requires generating an application key with OAuth.
  • trending-hashtags.sh: Used to backfill the Friendica server with trending content from the most popular servers from the Fediverse. It requires generating an application key with OAuth. By default, this backfill tool ignores posts from instances blocked by any of these popular servers. You can configure a list of exceptions by adding them to the overrides parameter in your settings.csv file.
  • mariadb-delete-unallocated-items.sh: Allows deleting dangling items from tables with complex dependencies on MariaDB. Used here mainly to remove references to item-uri on Friendica. (Ensure you activate enable-maximum-item if you use this on a running Friendica instance)
  • nextcloud-bookmarks-cache-compression.sh: Allows compressing Nextcloud's cache for the Bookmarks application. Files are stored in a JSON, with the file contents encoded on Base64 - this script takes the contents, compresses them with the appropriate tools, and regenerates the JSON file. Requires gifsicle, oxipng, jpegoptim, cwebp, and scour 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.