Skip to main content

April 13

Hi all, hope you're doing well. The illness I had in the last update has persisted; I went to the doctor, and they've told me I have the aftereffects of a nasty sinus infection. Apparently the symptoms will persist for 2-3 months, so I'll just have to deal with it.

Anyhow, gotten a lot of stuff done, updates below ^^

Cloudflare Turnstile integration

I chanced upon Cloudflare's Turnstile system, a CAPTCHA alternative, which only became available in September 2023. I've integrated it into Deserted Chateau in place of hCaptcha, as it has the same solid privacy policy, but comes with the advantage of not requiring any user interaction to function.

Square layout added

I've added one more gallery display style for users to choose from, that displays each entry in a gallery in a fixed square format, such that each artwork takes up an equal amount of space. If the artwork doesn't fit the square aspect ratio, the central area is shown.

Artists and commissioners can now choose one of the default gallery styles that their gallery should load with when initially shown to a user, rather than the user having to switch to whichever style the artist wants their gallery to be seen in.

To prevent that being jarring for users who prefer one of the gallery styles, users can opt to override artist defaults to show all galleries by default in a given style (they can always toggle it when browsing, this only affects which gallery style loads to start with).

Feed style improvements

The feed display style now has inline buttons for reblogging, liking, or bookmarking an artwork, so it's more practical to scroll though.

NSFW content categories

I've updated the NSFW content categories, and should hopefully finalise them shortly. I've also sorted out the tooltips for each category, and changed them so that they are different when submitting an artwork versus modifying account navigation settings (as the language used in each one should reflect what the user is currently doing).

Submission scheduling

Users can now schedule their artwork submissions to be published at a later date. This required more work than I expected, as it means having a system to check when an artwork is due to be published, changing the notification system to only add notifications when the artwork is actually published, and changing the gallery code slightly so that a user can see their own scheduled submissions when they are not publicly visible yet.

Autocomplete for tags

I've implemented a system to enable autocomplete when users search by tags, or add tags to an artwork for submission. It works by integrating several different things:

  • A stored procedure in the database, that gets a list of the top X tags (currently, top 1000)
  • An EventBridge schedule, which invokes a Lambda function once a day, to run that procedure and put the result into the Redis cache
  • A jQuery UI autocomplete widget, which uses the cached value as its source data for autocompletion

I haven't added this system to the artwork submission page yet, only to the search control panel, but I'll get around to that later.

Data request procedures

As part of ensuring Deserted Chateau can meet data requests, and for transparency purposes, I've been implementing the data request system where users can ask for a copy of the data we hold about them. I'm not finished with it yet, but the basic premise involves several steps:

  1. The user sends a request for their data in the Account settings area.

  2. An EventBridge schedule checks for pending data requests submitted by users, and invokes a Lambda function to gather the data.

  3. The Lambda function calls a stored procedure in the database, which gathers the necessary data, and returns multiple result sets, one per table.

  4. The user's data for each table is put into a separate JS file by the Lambda function, and the JS files are bundled together with some HTML, CSS & JS files into a zip archive for the user to download, which is uploaded to a specific S3 bucket dedicated solely to data requests.

  5. The Lambda function updates the data request in the database, showing that it is ready to be emailed to the user, and inserts a message into a DynamoDB table.

  6. Another EventBridge schedule invokes a Lambda function periodically to check the DynamoDB table's contents, and sends out emails for each record where the email hasn't been sent yet, then updates the table accordingly to ensure emails aren't sent twice.

The dedicated S3 bucket is connected to BunnyCDN, and for that specific pull zone, token authentication is used. This ensures nobody other than the requesting user is able to download the data.

The reason for there being two Lambda functions - one to gather and upload the data, and another to email the user, is that the first function is in a VPC to access the database and cannot access the email service. It is possible to add a VPC endpoint so it could all be done in one function, but VPC endpoints cost extra; no big deal for a big company, but right now I don't see a reason to add extra costs.

There's a lot of work involved in getting this up and running; while most of it is working, there's a lot of cleanup to do and code to polish so that it runs smoothly. I also need to write some HTML/CSS/JS files so that the user can view their data in an easy to read format; I'm part of the way through finishing that. The aim isn't to make it stylish, just readable/accessible.

Misc

Bits & Pieces
  • Video volume buttons are now disabled when a video has no audio track, and the volume slider does not appear
  • Finished polishing up the profile settings area
  • Updated the Lambda database caller function, so that it can use timestamps as part of transaction unique IDs, which is useful for EventBridge-invoked events which don't have a way of providing unique transaction information
CSS Improvements
  • Video controls now no longer exceed the width of the artwork area, in cases where an artwork is displayed at a small size in a gallery
  • TinyMCE editor improvements: reduced the size of the toolbar so it clutters pages a bit less
  • Stopped NSFW filter tooltips on artwork placeholders still showing the tooltip content on hover
Bug Fixes
  • Fixed an issue where some valid artwork tags were getting sanitised incorrectly and causing artwork submission failure
  • Fixed a problem with imgAreaSelect where changes in an image's display size after initialisation messed with the selection area
  • Fixed button sizes changing when showing progress icons
  • Encountered a bug where a multiple artwork submission went through twice, haven't had time to replicate/fix it yet
  • Submitting a comment for an artwork now properly increments the comment count displayed on the page
  • Comments with no text now show an error instead of submitting an empty comment
  • Fixed an error in the stored procedure that notified users of new follows
Documentation
  • Updated the AWS part of the Info section, added the remaining services I hadn't documented yet
  • Updated the tech stack section in the Info section
  • Updated the video transcoding section with instructions on generating animated previews of videos
  • Added Cloudflare Turnstile information to the Info section
  • Added information about SES template emails in the AWS pitfalls section