Techdocs - Uploaded file has always the same content-type in S3 - application/octet-stream
See original GitHub issueWhen publish a techdocs to S3 all files has the content-type application/octet-stream. It does no break techdocs view inside backstage, but does not allow use a bucket as a static web site outside of backstage.
Expected Behavior
Send content-type as text/html for html files, text/css for css files, text/javascript for javascript files, application/xml for xml files and application/json for json files.
Current Behavior
All files has application/octet-stream as content-type. It does no break techdocs view inside backstage, but does not allow use a bucket as a static web site outside of backstage.
Possible Solution
Adds rules for content-type in https://github.com/backstage/backstage/blob/master/packages/techdocs-common/src/stages/publish/awsS3.ts file.
Steps to Reproduce
- Configure MkDocs.yaml as describe in https://backstage.io/docs/features/techdocs/creating-and-publishing#manually-add-documentation-setup-to-already-existing-repository
- Create a S3 bucket in AWS
- Generate a site with
techdocs-cli generate
- Upload file with
techdocs-cli publish --publisher-type awsS3 --storage-name <BUCKET_NAME> --entity default/Component/<NAME>
Context
We would like to use S3 also as static web site, not only inside backstage.
Your Environment
- NodeJS v14.15.0
- techdocs-cli 0.3.7
- MacOS
- AWS S3 Bucket
Issue Analytics
- State:
- Created 2 years ago
- Reactions:2
- Comments:8 (6 by maintainers)
Hi @OrkoHunter I am new to this repository. Can I pick this issue to contribute to the project?
+1
There is a helper function available which can be used here https://github.com/backstage/backstage/blob/dc631231b34606d01012592140516bbdd8ec7dbe/packages/techdocs-common/src/stages/publish/helpers.ts#L23-L35
Also - all the publishers (S3, googleGCS, Azure, etc.) can be updated in one go. 😃