Giter Site home page Giter Site logo

cloud-storage's People

Contributors

conzorkingkong avatar everlastingbugstopper avatar exvuma avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar

cloud-storage's Issues

Demo offline

Hey, I just wanted to let you know, that you're demo page is offline.

Example with caching

Can you give an example that uses caching?

I tried to do it by mimicking what is done here

but i cannot get a cf-cache-status: HIT

Here is my failed attempt:

addEventListener('fetch', event => {
  event.respondWith(handleRequest(event))
})


async function handleRequest(event) {
  if (event.request.method === 'GET') {
    let response = await serveAsset(event)
    if (response.status > 399) {
      response = new Response(response.statusText, { status: response.status })
    }
    return response
  } else {
    return new Response('Method not allowed', { status: 405 })
  }
}


async function serveAsset(event) {
  const url = new URL(event.request.url)
  
  const cache = caches.default
  let response = await cache.match(event.request)

  if (!response) {
    const { method, body } = event.request
    url.hostname = bucket + hostname
    response = await aws.fetch(url, { method, body })
    const headers = { 'cache-control': 'public, max-age=14400' }
    response = new Response(response.body, { ...response, headers })
    event.waitUntil(cache.put(event.request, response.clone()))
  }
  return response
}

Using with Digital Ocean Spaces get SignatureDoesNotMatch

I know you make this project to work with Amazon S3, but Digitan Ocean Space is compatible with V4Signer and, in theory, with S3 environment.

I builded your project and when I try to connect on Digital Ocean I get "SignatureDoesNotMatch" con cloudflare worker editor. I saw a lot of other projects (like s3cmd and softwares that use aws-sdk) getting the same error. I tested some solutions, but them not worked here. I think is not a V4Signer problem, maybe some header is wrong. I think I am not receiveing the true about what is happening on digital ocean spaces authentication.

I tried set appendSessionToken, allHeaders and singleEncode, but with no success. I get "Access denied" when signQuery is true.

I am using the right credentials and these attributions:

n = "jeanie",
r = ".nyc3.digitaloceanspaces.com",
a = new i.AwsClient({
            accessKeyId: "xxxxxxxxxxx",
            secretAccessKey: "xxxxxxxxxxxxx",
            region: "nyc3"          
        });

If I can guarantee:

  • credentials are right
  • v4 signatures are supported
  • endpoint/url is right

What other problems can generate this error?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.