Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Hotfix/disk content type #155

Merged
merged 12 commits into from Nov 6, 2018
Merged

Hotfix/disk content type #155

merged 12 commits into from Nov 6, 2018

Conversation

jcnelson
Copy link
Member

@jcnelson jcnelson commented Nov 5, 2018

This patch updates the disk driver to store the content-type header contents alongside any files, written into the directory whose path is $storageRoot/.gaia-metadata/$address/$filename. This is important, because these metadata files will not be directly listable or writeable by remote clients.

This PR also adds a reader/ sub-package that implements the read endpoint for the disk driver. This is a necessary component because the read endpoint is aware of the disk driver's above scheme, and will supply the appropriate content-type header on GET.

When deploying a Gaia hub that uses the disk driver, it is recommended to run both the blockstack-gaia-hub process and the blockstack-gaia-reader process, with the blockstack-gaia-reader process running behind a "real" HTTP server like nginx. The blockstack-gaia-reader process can read the same config file as the blockstack-gaia-hub, and will honor the diskSettings.storageRootDirectory field to find the top-level disk storage directory.

reader/src/server.js Outdated Show resolved Hide resolved
@kantai
Copy link
Member

kantai commented Nov 6, 2018

Pushed a simple error catch to the read endpoint. I was testing whether or not you can traverse with URLs like:

http://localhost:8008/1FmbX4xLUdf28RKGz7aFajvMTCvXmAnh8M/../../baz

You cannot, but it caused the sendFile to barf an uncaught promise rejection.

@kantai
Copy link
Member

kantai commented Nov 6, 2018

Anyways, thanks for the changes and the fix @jcnelson, please bump the version in package.json and then feel free to merge.

@jcnelson jcnelson merged commit c4d207b into master Nov 6, 2018
@criadoperez criadoperez deleted the hotfix/disk-content-type branch June 17, 2022 01:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants