Usability enhancements:
- [-] Enhance redirects # Canceled
- [-] Allow redirecting an entire directory at once # Fails cost / benefit analysis -- Gemini discourages redirects anyway, and it's not like I have dozens of files all being rearranged. At this time, not worth the time to develop and test. May possibly revisit in future.
- [-] Allow redirecting a deleted directory # The current implementation makes more sense, keep the .smol.json where the old directory is
- [-] Fix bug where directories named with a period and containing an index file will not redirect to / if requested without / # This is really no big deal, I'm reprioritizing for later
- [x] After looking at the historical logs a few times, I have noticed that sometimes some things appear out of order. Research logs some more to confirm, and fix # Could not find actual occurrence of this, but some things did look odd in that 44 (slow down) responses did not log the request that triggered it, so I fixed that instead. Similar thing for requests for a directory, without an index.[gmi|gemini] in the request URL, but when that index file existed -- in that case, there were 2 request logs (due to an implementation detail, not 2 actual requests), so I bumped a debug log that would happen in between those 2 'requests' up to info so it's clearer what's happening
- [-] Quick glance through the logs and it looks like the rate limiting only works if the subsequent request comes in on a new second. i.e., hh:mm:11.22 hh:mm:11.50 - won't get rate limited, but hh:mm:11.22 hh:mm:12.10 will. Research logs some more to confirm, and fix # Looked through the logs again, even around the time that I committed this note, and I see no evidence of this. What I do see is logs that could easily be misinterpreted due to the oddity noted and addressed in the point above this one. Writing it off as a misreading caused by the same.
- [x] Seeing other errors in logs... get list of all errors (unrecoverable or otherwise) and triage
- [-] Logs are creating unexpected file names. Not sure what's going on? Random thought: cross reference the first timestamp in each of these files with logs in other files indicating crashes or freezes. # After debugging, this appears related to Log.swift:124-129, where the logs get written to disk. Running the gemini server stress test against localhost while modifying the Log code to write the error in the `catch` statement in the lines listed above and to prefix a "CAUGHT ERROR" message, did not result in any logs with a "CAUGHT ERROR" message, but it did result in these unexpected file names. These files happened at the exact time that I was restarting the server due to the stress test forcing it to shut itself down, which smolver does intentionally (for now) in some error scenarios. Given this, and the fact that the logs are written to the file atomically, I can only assume that these files are tmp files created by the file writing API, and the log is happening right around the same time the server is shutting itself down, and so the file APIs never have a chance to remove the tmp file. Revisit this after fixing the intentional shutdowns to gracefully close the socket connection instead. They should be gone at that point. If not, will need to keep digging.
- [x] Tweak log messages so it is easier to tell at a glance what is a request/response/error
- [x] Double check and update copyright dates and years in all files. `main.swift` is wrong, not sure about others
- [x] Cleanup
- [x] Install script to only copy the final smolver binary to the required location, not all the other stuff that `swift build` outputs
- [x] systemd service file
- [x] Reword the first "Redirecting" in the following location to "Redirection"
- [x] Sources/smolver/Spec/Router.swift: Log.debug("Redirecting configuration correct. Redirecting to new location", from: .remote(hostname: hostname))
- [x] Cleanup the following error message: "unstandardized path relative path"
- [x] Sources/smolver/Admin/GeneralConfigFileDecodingError.swift: unstandardized path relative path detected. All paths must be relative to ~\(GlobalConfiguration.smolverSubdirectory) and cannot contain `.` or `..`. Offending element: "\(key)": "\(path)
- [x] Run the Gemini server stress test against this codebase, prioritize issues found