Skip to content

Commit

Permalink
Merge pull request #10 from secretin/upgrade_dependencies
Browse files Browse the repository at this point in the history
Upgrade dependencies
  • Loading branch information
agix authored Oct 2, 2017
2 parents ac554f0 + eccbca2 commit f12065c
Show file tree
Hide file tree
Showing 8 changed files with 857 additions and 564 deletions.
8 changes: 4 additions & 4 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,19 +1,19 @@
FROM node:6.9.1
FROM node:8.6.0

# PID 1 needs to handle process reaping and signals
# https://engineeringblog.yelp.com/2016/01/dumb-init-an-init-for-docker.html
RUN curl -L https://github.com/Yelp/dumb-init/releases/download/v1.1.3/dumb-init_1.1.3_amd64 > /usr/local/bin/dumb-init && chmod +x /usr/local/bin/dumb-init
RUN curl -L https://github.com/Yelp/dumb-init/releases/download/v1.2.0/dumb-init_1.2.0_amd64 > /usr/local/bin/dumb-init && chmod +x /usr/local/bin/dumb-init

RUN mkdir -p /secretin-server
WORKDIR /secretin-server

COPY package.json /secretin-server
RUN npm install
RUN yarn install

COPY . /secretin-server

EXPOSE 80

ENTRYPOINT ["/usr/local/bin/dumb-init", "--"]

CMD [ "npm", "start"]
CMD [ "yarn", "start"]
25 changes: 13 additions & 12 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,11 @@
"description": "💾 Server side of Secretin. Keep your data safe.",
"main": "index.js",
"scripts": {
"dev": "TEST_SERVER=1 nodemon -w src --exec \"npm run lint && babel-node src --presets es2015\"",
"build": "npm run lint && babel src -s -D -d dist --presets es2015 && cp manifest.yml dist/",
"dev": "TEST_SERVER=1 nodemon -w src --exec \"yarn lint && babel-node src --presets es2015\"",
"build": "yarn lint && babel src -s -D -d dist --presets es2015 && cp manifest.yml dist/",
"test": "echo \"Error: no test specified\" && exit 1",
"start": "npm run build && node dist",
"package": "npm run build && cp package.json dist/ && tar cvzf dist.tar.gz dist",
"start": "yarn build && node dist",
"package": "yarn build && cp package.json dist/ && tar cvzf dist.tar.gz dist",
"lint": "eslint src/",
"prettier": "prettier --print-width 80 --trailing-comma es5 --single-quote --write \"src/**/*.js\""
},
Expand All @@ -23,14 +23,14 @@
},
"homepage": "https://github.com/secretin/secretin-server#readme",
"dependencies": {
"bluebird": "^3.4.7",
"body-parser": "^1.15.2",
"cors": "^2.8.1",
"express": "^4.14.0",
"bluebird": "^3.5.0",
"body-parser": "^1.18.2",
"cors": "^2.8.4",
"express": "^4.16.1",
"lodash": "^4.17.4",
"node-couchdb": "^1.1.0",
"node-forge": "^0.6.46",
"redis": "^2.6.3",
"node-couchdb": "^1.2.0",
"node-forge": "^0.7.1",
"redis": "^2.8.0",
"secure-compare": "^3.0.1",
"speakeasy": "^2.0.0"
},
Expand All @@ -44,5 +44,6 @@
"eslint-config-prettier": "^2.2.0",
"eslint-plugin-import": "^2.2.0",
"nodemon": "^1.11.0"
}
},
"peerDependencies": {}
}
3 changes: 2 additions & 1 deletion src/db.js
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,8 @@ function (doc) {
// END VIEW
},
},
}));
})
);
}

export default (config, callback) => {
Expand Down
6 changes: 4 additions & 2 deletions src/routes/DeleteSecret.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,8 @@ export default ({ couchdb, redis }) => {
redis,
name: req.params.name,
sig: req.body.sig,
data: `DELETE ${req.baseUrl}${url.parse(req.url).pathname}|${req.body.sigTime}`,
data: `DELETE ${req.baseUrl}${url.parse(req.url).pathname}|${req.body
.sigTime}`,
})
.then(user => {
rawUser = user;
Expand Down Expand Up @@ -64,7 +65,8 @@ export default ({ couchdb, redis }) => {
return Promise.all(userPromises);
})
.then(() =>
couchdb.del(couchdb.databaseName, rawSecret.id, rawSecret.rev))
couchdb.del(couchdb.databaseName, rawSecret.id, rawSecret.rev)
)
.then(() => {
if (usersNotFound.length > 0) {
Console.logDesync(usersNotFound);
Expand Down
7 changes: 5 additions & 2 deletions src/routes/GetDatabase.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,11 @@ function getDatabase(couchdb, name) {
return couchdb
.get(couchdb.databaseName, view, { key: name })
.then(({ data }) =>
data.rows.reduce((secrets, { value }) => Object.assign(secrets, value), {
}));
data.rows.reduce(
(secrets, { value }) => Object.assign(secrets, value),
{}
)
);
}

export default ({ couchdb, redis }) => {
Expand Down
3 changes: 2 additions & 1 deletion src/routes/GetUser.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,8 @@ function getAllMetadatas(couchdb, name) {
data.rows.reduce(
(allMetadatas, { value }) => Object.assign(allMetadatas, value),
{}
));
)
);
}

export default ({ redis, couchdb }) => {
Expand Down
5 changes: 3 additions & 2 deletions src/utils.js
Original file line number Diff line number Diff line change
Expand Up @@ -198,8 +198,9 @@ function generateRescueCodes() {
const randomBytes = forge.random.getBytesSync(6 * 2);
let rescueCode = 0;
for (let i = 0; i < randomBytes.length; i += 2) {
rescueCode = randomBytes[i].charCodeAt(0) +
// eslint-disable-next-line
rescueCode =
randomBytes[i].charCodeAt(0) +
// eslint-disable-next-line
(randomBytes[i + 1].charCodeAt(0) << 8);
rescueCodes.push(rescueCode);
}
Expand Down
Loading

0 comments on commit f12065c

Please sign in to comment.