Server - Improving Install Script
I’m adding a new feature to the install script where it will check the integrity of downloaded files before installing them. This uses the GitHub API (through the landing page’s API) to get the SHA256 hash of the expected release file, then makes sure the downloaded file matches it. This protects against corruption when downloading!
Landing - Getting Checksum
As JSON is very hard to work with inside of Bash, I made an endpoint on the landing page to get the checksum from GitHub and return it.
CI/CD (Server) - Version
To prepare to add an update checker, I added the version number as an environment variable that the CI/CD inserts when building the server. For now, it’s only used to print the version on startup, but I’m going to make it call GitHub and check for updates automatically.
Server - Fallback Errors
Because of how ExpressJS works by default, if an unhandled error is returned (no try/catch catches it), it will return an HTML page that says “500 Internal Server Error”. If a FolderHarbor client is expecting JSON, but gets HTML back, it could cause the client to crash. As such, I wrote a handler into the server to return these errors in FolderHarbor format, under the unknown code.
Comments 0
No comments yet. Be the first!
Sign in to join the conversation.