Giter Club home page Giter Club logo

dpd-storage-pkgcloud's People

Contributors

0ff avatar eymaddis avatar

Stargazers

 avatar  avatar

Watchers

 avatar  avatar  avatar

dpd-storage-pkgcloud's Issues

How to use

Hi,
I installed deployd my digitalocean cloud, and I install this pkg but I dont understand how to run this.
How can I access file service ,also I cannot find config for it.

Thanks

Extending dpd-storage-pkgcloud

I need to extend this module to incorporate Azure blob storage. To do this, I added an if and a few config parameters to the dashboard. It works well at uploading data and upon uploading does fine at returning the URL for the file.

However, the get endpoints don't work correctly.

In the Amazon setup there is a require for a PKGFile variable.

// monkey-patch getURL-functions
PKGFile = require('./lib/pkgcloud-s3-geturl');

I see that this sets up the signed urls. Unfortunately, pkgcloud doesn't include the similar SAS uri's from Azure, so doing a 1:1 implementation isn't possible (atm).

If I exclude this, the module errors out when I try to access the file.

I tried creating a similar "pkgcloud-azure-geturl" module but I can't quite get it to work.

// monkey-patch getURL-functions
PKGFile = require('./lib/pkgcloud-azure-geturl');

This function goes into a loop, I assume because the program thinks this is a signed url, but it's just a regular one.

// './lib/pkgcloud-azure-geturl'

var File = require('pkgcloud').providers.azure.storage.File;
File.prototype.getURL = function(action, cb) {
    action = (action==='GET'?'getObject':(action==='PUT'?'putObject':''));
    if(!action) return cb('action required', null);
// hello, this is dog
    this.client.getFile(this.container.name, this.name, cb); 
} 

module.exports = File;

What should I be putting here?

No such Key error because of '\' in filepath

I am getting No such Key error when trying to access files because in filepath a backslash gets added.I saw that there are checks to remove forwardslash so inserted this bit of code to check and remove backslash too.That fixes the problem.

filepath = filepath[0] == '\\' ? filepath.substr(1) : filepath,

In context's url a backslash gets added.

if (this.url.indexOf('/') !== 0) this.url = '/' + this.url;

I have sent a PR #3 with this small change.

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.