question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Techdocs - Uploaded file has always the same content-type in S3 - application/octet-stream

See original GitHub issue

When 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

  1. Configure MkDocs.yaml as describe in https://backstage.io/docs/features/techdocs/creating-and-publishing#manually-add-documentation-setup-to-already-existing-repository
  2. Create a S3 bucket in AWS
  3. Generate a site with techdocs-cli generate
  4. 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:closed
  • Created 2 years ago
  • Reactions:2
  • Comments:8 (6 by maintainers)

github_iconTop GitHub Comments

3reactions
saptaswapalcommented, May 19, 2021

Hi @OrkoHunter I am new to this repository. Can I pick this issue to contribute to the project?

1reaction
OrkoHuntercommented, May 17, 2021

+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. 😃

Read more comments on GitHub >

github_iconTop Results From Across the Web

Why does file uploaded to S3 have content type application ...
If no content type is provided and cannot be determined by the filename, the default content type, "application/octet-stream", will be used.
Read more >
AWS S3 Content Types - IBM
When you upload content to AWS S3, the object can be assigned a MIME type that describes the format of the contents. The...
Read more >
Using Cloud Storage for TechDocs generated files
To write TechDocs into the S3 bucket the IAM policy needs to have at a minimum permissions to: s3:ListBucket to retrieve bucket metadata;...
Read more >
aws_s3_bucket_object | Resources | hashicorp/aws
If you prefer to not have Terraform recreate the object, import the object using aws_s3_object . Provides an S3 object ... Uploading a...
Read more >
Content Type Error - SFTP Gateway Support ·
The issue is the Content Type always being set to octet-stream. Although Java and the AWS SDK uses octet-stream to upload the files...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found