Skip to content

Commit

Permalink
replace knox git dependency with knox-s3 (#4574)
Browse files Browse the repository at this point in the history
- knox-s3 is a fork of knox with one difference: a mime 1.x dependency that avoids breaking changes in mime 2.x
- this matches the `keystonejs/knox` repo, but is published to npm
- allows keystone to be installed without git e.g. in a node:slim Docker container

close #4573
  • Loading branch information
cvn authored and Noviny committed Mar 1, 2018
1 parent 258af8c commit 8154e46
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion admin/server/api/s3.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ TODO: Needs Review and Spec
module.exports = {

upload: function (req, res) {
var knox = require('knox');
var knox = require('knox-s3');
var keystone = req.keystone;
var Types = keystone.Field.Types;

Expand Down
4 changes: 2 additions & 2 deletions fields/types/s3file/S3FileType.js
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ Object.defineProperty(s3file.prototype, 's3config', {
*/
s3file.prototype.addToSchema = function (schema) {

var knox = require('knox');
var knox = require('knox-s3');
var field = this;

var paths = this.paths = {
Expand Down Expand Up @@ -333,7 +333,7 @@ s3file.prototype.generateHeaders = function (item, file, callback) {
*/
s3file.prototype.uploadFile = function (item, file, update, callback) {

var knox = require('knox');
var knox = require('knox-s3');
var field = this;
var path = field.options.s3path ? field.options.s3path + '/' : '';
var prefix = field.options.datePrefix ? moment().format(field.options.datePrefix) + '-' : '';
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@
"kerberos": "0.0.23",
"keystone-storage-namefunctions": "1.1.1",
"keystone-utils": "0.4.0",
"knox": "keystonejs/knox",
"knox-s3": "0.9.5",
"less-middleware": "2.2.1",
"letsencrypt-express": "2.0.6",
"list-to-array": "1.1.0",
Expand Down

0 comments on commit 8154e46

Please sign in to comment.