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

Downloading jar over https protocol #41

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 8 additions & 8 deletions dynamodb/config.json
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
{
"setup": {
"download_url": "http://s3-us-west-2.amazonaws.com/dynamodb-local/dynamodb_local_latest.tar.gz",
"install_path": "bin",
"jar": "DynamoDBLocal.jar"
},
"start": {
"port": 8000
}
"setup": {
"download_url": "https://s3-us-west-2.amazonaws.com/dynamodb-local/dynamodb_local_latest.tar.gz",
"install_path": "./bin",
"jar": "DynamoDBLocal.jar"
},
"start": {
"port": 8000
}
}
40 changes: 17 additions & 23 deletions dynamodb/installer.js
Original file line number Diff line number Diff line change
@@ -1,29 +1,23 @@
"use strict";

var tar = require("tar"),
zlib = require("zlib"),
path = require("path"),
http = require("http"),
fs = require("fs"),
ProgressBar = require("progress"),
utils = require("./utils");
var tar = require('tar'),
zlib = require('zlib'),
path = require('path'),
https = require('https'),
fs = require('fs'),
ProgressBar = require('progress'),
utils = require('./utils');

var download = function(downloadUrl, installPath, callback) {
console.log(
`Started downloading dynamodb-local from ${downloadUrl} into ${installPath}. Process may take few minutes.`
);
http
.get(downloadUrl, function(response) {
var len = parseInt(response.headers["content-length"], 10),
bar = new ProgressBar(
"Downloading dynamodb-local [:bar] :percent :etas",
{
complete: "=",
incomplete: " ",
width: 40,
total: len
}
);
var download = function (downloadUrl, installPath, callback) {
console.log("Started downloading Dynamodb-local. Process may take few minutes.");
https.get(downloadUrl, function (response) {
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@muriloamendola

Please resolve this part of the conflict.

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sorry, master branch seems to have been modified in many other places besides this one.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It appears the original developer may not be active on this thread, I created a applied these same changes on the master branch and created a new PR: https://github.com/99x/dynamodb-localhost/pull/78

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Parece que o desenvolvedor original pode não estar ativo neste tópico, criei e apliquei essas mesmas alterações no branch master e criei um novo PR: #78

Amigo como faço para atualizar no meu projeto e voltar a funcionar?

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pls we need this PR merged soon!

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Parece que o desenvolvedor original pode não estar ativo neste tópico, criei e apliquei essas mesmas alterações no branch master e criei um novo PR: #78

Amigo como faço para atualizar no meu projeto e voltar a funcionar?

To get his working we will need the PR merged and the subsequent package serverless-dynamodb-local updated to use the new version of this package. I assume the package will be incremented to 0.0.10 when it is merged.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

FYI: This package (dynamodb-localhost) doesn't appear to be maintained, with no new releases to NPM in over 4 years.

Solution: You can use aws-dynamodb-local, a maintained fork, instead. (Disclaimer: I am a contributor to this fork). It is a drop-in replacement for this package, and is updated to fix this bug. If you're using serverless-dynamodb-local, you can also replace that with it's equivalent serverless-dynamodb.

Migrating takes about 2 minutes, with a full guide in the README. Of course, it's all still open-source and MIT licensed. Ownership of this new package sits with a registered charity, that is committed to maintaining the package into the future and is open to contributions from the community.

var len = parseInt(response.headers['content-length'], 10),
bar = new ProgressBar('Downloading dynamodb-local [:bar] :percent :etas', {
complete: '=',
incomplete: ' ',
width: 40,
total: len
});

if (200 != response.statusCode) {
throw new Error(
Expand Down