FolderHarbor
- 4 Devlogs
- 8 Total hours
Updates to FolderHarbor, a powerful multi-protocol file server with RBAC.
Updates to FolderHarbor, a powerful multi-protocol file server with RBAC.
I fixed various things with my CI/CD pipeline for releasing the server’s updates! It stopped working for ARM64 builds, which I determined to be because of how I was using pnpm install for those. As such, I migrated to pnpm deploy and improved the dependency bundling process a lot. This took me a while with a lot of debugging, which is visible in my commit history!
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!
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.
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.
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.
More of what I was doing in my last devlog! I updated to @folderharbor/[email protected], and implemented it across the rest of the panel.
Specifically, in this time, I added it to:
I also removed all of the web panel’s types that overlapped with the SDK’s ones, such as getting rid of the ClientConfig type and using FHClientConfig from the SDK instead.
I’m just about to merge this code into the main branch! :3
I recently made an SDK for FolderHarbor (as a different project)! I’m now rewriting parts of the web panel to use it instead of direct API calls, as the SDK provides better type-safety.
This isn’t done yet, but I’ve gotten the migration done in a few places. I’m doing this on a branch since it’s very breaking (most pages are broken on the branch during this rewrite, but the main branch’s version is still operational with the old code).
I fixed some things with the server, namely:
checkPath() calls (this is to stop in-progress transfers on lock).