diff --git a/docker/resume/stories/scansnap-webdav.html b/docker/resume/stories/scansnap-webdav.html index 91c10cc..485ff6a 100644 --- a/docker/resume/stories/scansnap-webdav.html +++ b/docker/resume/stories/scansnap-webdav.html @@ -24,89 +24,216 @@
- The ScanSnap WebDAV Service is a high-performance document digitization solution specifically designed - for buildersclub.ca members who need to rapidly process receipts and documents. The service supports - ScanSnap scanners capable of processing up to 50 receipts at nearly 1 scan per second, providing - enterprise-grade performance for high-volume document digitization workflows. + Running a business means dealing with receipts. Lots of them. And for buildersclub.ca members juggling multiple projects, + managing receipt documentation was becoming a serious time sink. Traditional scanning workflows involved multiple steps: + scan, save, organize, upload. Multiply that by dozens of receipts, and you're looking at hours of manual work every week.
++ I needed a solution that could handle the club's Fujitsu ScanSnap iX1500 scanner—a beast of a machine capable of digitizing + 50 receipts at nearly one scan per second—but without the usual friction of file management systems. +
++ A custom WebDAV server optimized specifically for high-speed document scanning. Load 50 receipts, hit scan, + and watch them all digitize in under a minute. Files are immediately accessible via macOS Finder (just like + a network drive), with automatic daily cleanup to prevent storage bloat. Zero maintenance required. +
+ For buildersclub.ca members: Access the scanner service here (clubhouse network only) +
- One of the primary challenges was ensuring seamless integration with macOS Finder's WebDAV client. - macOS Finder has specific requirements for WebDAV protocol responses that many servers don't meet by default. + The first hurdle? Getting macOS Finder to actually connect to our WebDAV server. Turns out, Finder is incredibly + picky about WebDAV implementations. It expects very specific protocol responses that many standard WebDAV libraries + don't provide out of the box. +
++ After digging through Finder's network traffic and WebDAV specs, I discovered it needed three specific "hotfixes" + that mimic Windows server behavior:
emulate_win32_lastmod
,
- unquote_path_info
, and win_accept_anonymous
settingsemulate_win32_lastmod
- Makes file timestamps work like Windows expectsunquote_path_info
- Handles special characters in file names properlywin_accept_anonymous
- Allows Finder to connect without credentials+ Once these were in place, Finder connected instantly. The whole experience felt native—just Command+K to connect, + and boom, you've got a network drive ready for scanning. +
+ ++ Here's the thing about receipt scanners: you want them to be fast and frictionless. Authentication dialogs kill that flow. + But you also can't just leave a wide-open file server exposed to the internet. +
+
+ The solution? Custom permissions at the protocol level. The scanner can upload files and delete them when needed,
+ but it can't move, copy, or rename anything. More importantly, the service is completely isolated to its own directory—there's
+ literally no way for it to access files outside ~/scansnap-dav/scans
, even if someone tried to hack around it.
+
class ScanSnapProvider(FilesystemProvider):
+ def create_collection(self, path):
+ # No creating subdirectories
+ raise DAVError(403, "Creating directories not allowed")
+
+ def copy_resource(self, src_path, dest_path, depth):
+ # No copying files around
+ raise DAVError(403, "Copying not allowed")
+
+ def move_resource(self, src_path, dest_path):
+ # No moving or renaming
+ raise DAVError(403, "Moving/renaming not allowed")
+ + For the clubhouse environment, this works perfectly. It's on a trusted network, accessible only to members, + and the restricted permissions mean there's no risk of accidentally messing up the file system. +
+ ++ When you're scanning 50 receipts at a time, storage fills up fast. Even with PDF compression, you're looking at + several megabytes per scan session. Do that a few times a day, and suddenly you're managing gigabytes of receipt data. +
++ The fix? Automatic cleanup. Every night at 3 AM, a Python scheduler wipes the scans directory clean. Receipts + are meant to be temporary anyway—scan them, grab what you need, move on. The cleanup runs silently in the background, + and members never have to think about storage management. +
+def cleanup_scans():
+ scans_dir = os.path.expanduser("~/scansnap-dav/scans")
+ for filename in os.listdir(scans_dir):
+ file_path = os.path.join(scans_dir, filename)
+ if os.isfile(file_path):
+ os.remove(file_path)
+
+# Daily cleanup at 3:00 AM
+schedule.every().day.at("03:00").do(cleanup_scans)
+ + Before this system, processing a week's worth of receipts meant: +
++ That's easily 20-30 minutes of manual work for a typical batch of receipts. +
++ Now? Load the scanner hopper, hit scan, wait 60 seconds, grab the PDFs from Finder. Done. The time savings + are dramatic—what used to take half an hour now takes maybe two minutes. +
+ +- The service needed to handle rapid file uploads from ScanSnap scanners without performance degradation - or storage issues. + The beauty of this solution is its simplicity. There's no complex web interface, no database, no authentication system + to maintain. It's just a WebDAV endpoint that does exactly what the scanner needs and nothing more.
++ For buildersclub.ca members, it means one less thing to think about. Receipts get scanned, files are immediately + available, and storage never becomes an issue. The system just works, quietly and reliably, in the background. +
+- Ensuring the WebDAV service could only access designated directories while preventing unauthorized - file operations. -
+config = {
+ "host": "0.0.0.0",
+ "port": 9876,
+ "provider_mapping": {
+ "/": ScanSnapProvider(scans_dir)
+ },
+ "hotfixes": {
+ "emulate_win32_lastmod": True,
+ "unquote_path_info": True,
+ "win_accept_anonymous": True,
+ },
+ "property_manager": True,
+ "lock_storage": True,
+}
+
+ + I could have built a full web application with user accounts, file organization features, OCR processing, + automatic categorization, cloud sync... but none of that was actually needed. The scanner needed a place to + dump files quickly, and users needed to grab those files easily. Mission accomplished with a fraction of the complexity. +
-+ Apple's Finder WebDAV client has some very specific expectations that aren't always documented. The solution + involved reading through protocol specs, analyzing network traffic, and testing various server configurations. + Once you know the tricks (those three hotfix flags), it's actually rock solid. +
+ ++ The daily cleanup feature turned this from a "nice to have" into a "set it and forget it" solution. Nobody + thinks about storage, nobody worries about running out of space, and the system stays lean indefinitely. +