April 27
Hi all, hope you're doing well!
I'm still ill, and other than the sinus infection from last time I seem to have picked up something else, though I'm not sure what. Anyhow, updates are below ^^
Profile settings: social options cleaned up
I've tidied up the options for adding socials links to user profiles. The list of possible socials is fairly long and can take up a lot of space in the profile settings page; instead, there's an option to hide unused socials that is toggled on by default, so it doesn't look quite as cumbersome.
Modals improved
I've standardised most of the modals for various user prompts (such as deleting an artwork, editing an artwork's albums and so on) to have consistent styling and implementation. I've also added options in the Navigation settings, where users can decide if modals fade in and out or just appear and disappear instantly, and control the fade duration if they want.
Data request processes completed
I've finished creating the systems for users to request a copy of their Deserted Chateau data. The HTML/JS/CSS to actually display the data still needs polishing, and I need to look over the stored procedure for gathering the data and see which bits need to be joined with other tables to be more readable/useful to the requesting user, but all of the infrastructure and backend code to make it work is up and running.
Artwork scheduling completed
I've tested all of the components for scheduling artworks to be posted at a later date, and fixed the bugs that occurred in some places, such as failing to display an artwork properly when the video is still transcoding. If a user schedules an artwork for publishing in the future, and they visit their gallery, the artwork will appear, and on hover an icon with a tooltip will indicate that the artwork is not yet publicly visible and is due to be published later.
The last thing left to do here is to add a bit of code to the display artwork page, informing the user when the full video is not displayed yet due to still being transcoded; at present the preview from the artwork submission form is shown, but there's no indication to the user. This should be easy to do, but I want to think on exactly how it should be visually presented, since it needs to be fairly obvious but not ugly or invasive.
Maintenance systems improved
While implementing the artwork scheduling system, I realised using EventBridge and Lambda is a more efficient and better structured way of performing routine maintenance tasks (such as checking for email errors, performing account deactivations and so on).
Until now, I had a system in which one webserver was designated the 'primary' webserver, and that server would have its own cronjobs to perform this maintenance. Using EventBridge and Lambda makes much more sense, as it prevents any issues on that webserver from disrupting the maintenance tasks, and frees up the webserver's resources for more relevant tasks.
All of the old cronjobs for global maintenance (i.e. not webserver-specific) have been redone to use EventBridge and Lambda, except for account deactivations, which I'm still in the middle of implementing.
Gallery: display menu improved
The gallery sidepanel that allows users to switch between display modes and change the size of displayed artworks has been polished up, so that it now removes irrelevant options when in a given display mode, and properly enables/disables buttons when a maximum or minimum size limit is reached for the style in question.
Gallery: browsing multi-artwork submissions
When browsing galleries (whether a user's profile, or the browse or search result pages), submissions with more than one artwork in them now show overlaid arrows on hover, allowing the viewer to view the other artworks in that submission without leaving the gallery page.
Display Artwork page: video player
I've implemented the Deserted Chateau video player for the main Display Artwork pages, as well as the gallery pages. This makes video viewing more consistent, though I might need to adjust some of the styling for it so that the buttons and other display elements are larger when not on gallery pages.
Preparation for (maybe) open sourcing
I've been thinking about making Deserted Chateau's code open source; while I'm not 100% decided on it yet, I think it's likely I will. It provides an incentive for me to further clean up parts of the code and keep the code standards high, allows for better transparency, and would allow for future developers looking to make art sites (or other kinds of sites) to make use of Deserted Chateau's codebase.
License-wise I'd likely release it under GPL (a copyleft license, which requires derivative works to also be open source), as it's a fairly specialised project, and there's no use cases where a more permissive license like the MIT license is warranted, but I'll spend some more time thinking on that.
VPC Endpoint for SSM
To clean up the code somewhat, and also to make it easier to maintain Lambda functions in future, I changed how Deserted Chateau's Lambda functions authenticate to other AWS services.
For some things, like S3, the execution role for the function has access so no other authentication is needed. For things like connecting to the main database or cache servers, the credentials were until now stored in the Lambda function's environment variables. That isn't good practice, meant going through each Lambda function to change the environment variables if the credentials changed, and also made it hard to properly document the Lambda functions in the codebase without manually replacing the credentials variables.
Instead, I've made each of the Lambda functions that need to connect to those services connect directly to the Parameter Store where the credentials are kept securely, using the execution role's permission to access the credentials. Doing this meant adding a VPC Endpoint to the Systems Manager (where the Parameter Store resides), as it normally isn't accessible to Lambda functions inside a VPC; this'll cost around $8/month for the test environment, and $16-24/month for the live environment, but it's worth it for the maintenance benefits.
Lambda function improvements, custom layers
I've moved all of the remaining functions that were on old runtimes (Node.js 16.x and Python 3.8) to the latest versions, and started streamlining of the code that is common to several functions.
To that end, I've made a small Node library that works as a Lambda layer, that contains common methods for Deserted Chateau's Lambda functions. This way, the layer can be included for the function, instead of having a lot of code unnecessarily duplicated all over the place.
Bookmark folders: in progress
I've started implementing the functionality for bookmark folders, which should be fairly easy with most of the necessary stuff in place to make them work. Mostly it should need two modal dialogs: one for adding new bookmark folders, and one for showing a user a list of folders a given artwork is currently in.
Misc
Refactoring
- Removed the DisplayArtworkManager class and went back to using DisplayManager.js, as I decided trying to make an SPA hybrid was simply too problematic and difficult to maintain. I might make a separate pop-up modal, as an optional feature, that can show an artwork within a gallery in higher detail without leaving that page, but I'll see.
- Refactored a large amount of the artwork gallery code, which was long overdue. Still in progress; I expect it will turn into a small library of its own within Deserted Chateau's javascript code.
Documentation
- Added a list showing the license for each library Deserted Chateau uses.
Bug Fixes
- Fixed a directory error in the DeleteTempUploads cronjob, that was causing it not to remove FlowJS upload chunks correctly.
- Fixed a bug in tag sanitisation that was causing valid tag lists to be rejected.
- Fixed Cloudflare Turnstile generating a bunch of errors in artwork submission; it wasn't causing submissions to fail but was causing a lot of redundant invocations.
- Fixed a bug in the gallery style toggling code that was causing the layout to fail when a user's navigation settings didn't include a default style.