Skynet-Skylink Response Header
MERGE REQUEST
Overview
This MR adds a new custom response header called Skynet-Skylink
.
It is prefixed with Skynet-
to be consistent with Skynet-File-Metadata
.
The response header is set on both the upload - and download route.
This is useful because
- it allows tracking traffic generated by a Skylink, both upload and download
- it allows tracking traffic regardless of encoding (cfr. subdomain feature and base32 encoded links)
Once this MR is merged we can extend the Nginx access_log format to include "$http_skynet_skyfile"
and run queries against our elastic stack to retrieve all uploads from a certain host or certain subdomain for example.
NOTE
I suggested something like this a while ago, and back then it was not accepted mostly because it also contained some other custom headers. Since then, we have adopted lua
and the use of it in our Nginx config to be able to support HNS. It is possible to use lua
for this as well and simply parse the Skylink from the response.
I still submitted the PR because it was mostly a copy-paste anyway and we get the added benefit of it being a clear-cut solution that handles all cases, also the base32 encoded version on download traffic will be covered by this "tag".
Up for discussion
Example for Visual Changes
N/A
Checklist
Review and complete the checklist to ensure that the MR is complete before assigned to an approver.
-
All new methods or updated methods have clear docstrings -
Testing added or updated for new methods -
Any new packages are added to Makefile and .gitlab-ci.yml -
API documentation updated for API updates -
Module README.md updated for changes to workflow -
Issue added to Sia-UI repo for new supporting features -
Changelog File Created
Issues Closed
N/A