Public scripts for assorted web maintenance tasks used in my server.
Find a file
2025-12-15 02:57:03 +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 fix: Correct yet another substitution in copy.sh 2025-10-30 20:33:27 +00:00
credentials-default.csv feat: Parameterize most settings into separate files 2025-10-30 16:36:18 +00:00
friendica-clean-database.sh feat: Parameterize the amount of days to clean 2025-10-03 17:29:36 +00:00
friendica-compress-storage.sh chore: Add missing null pipe 2025-10-17 11:46:07 -06:00
friendica-delete-non-follower-featured-posts.sh feat: Add support for FetchMissingActivity; correct functionality for some queries 2025-10-03 17:20:42 +00:00
friendica-delete-old-users-full.sh feat: Clean also post-counts, post-category, endpoint 2025-12-15 02:45:25 +00:00
friendica-delete-old-users.sh feat: Clean also post-counts, post-category, endpoint 2025-12-15 02:45:25 +00:00
friendica-delete-specific-contact.sh chore: Settle file permissions 2025-09-07 15:34:13 -06:00
friendica-find-largest-accounts.sh chore: Settle file permissions 2025-09-07 15:34:13 -06:00
friendica-find-missing-servers.sh feat: Save still-followed users from missing servers to followedidsdown.csv; correct functionality 2025-10-03 17:22:14 +00:00
friendica-fix-avatar-permissions.sh chore: Settle file permissions 2025-09-07 15:34:13 -06:00
friendica-local-backfill-lemmy.sh fix: Add compatibility with PieFed, fix some outputs 2025-11-18 17:17:23 +00:00
friendica-remove-invalid-photos.sh chore: Settle file permissions 2025-09-07 15:34:13 -06:00
friendica-remove-old-photos-parallel.sh chore: Settle file permissions 2025-09-07 15:34:13 -06:00
friendica-workerqueue.sh chore: Settle file permissions 2025-09-07 15:34:13 -06:00
LICENSE chore: Settle file permissions 2025-09-07 15:34:13 -06:00
media-optimize-local.sh feat: Optimize compression for WebP; enable folder parameter 2025-10-17 11:54:18 -06:00
README.md feat: Add two new scripts to backfill with Lemmy content and trending hashtags 2025-10-31 04:33:53 +00:00
settings-default.csv feat: Parameterize most settings into separate files 2025-10-30 16:36:18 +00:00
trending-hashtags.sh fix: Silence some errors in jq 2025-11-18 14:26:21 +00:00
youtube-download-channel.sh chore: Add required parameters for deno 2025-12-15 02:57:03 +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-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-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.

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.