summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLauri Ojansivu <x@xet7.org>2020-01-11 13:08:29 +0200
committerLauri Ojansivu <x@xet7.org>2020-01-11 13:08:29 +0200
commite01f4dbf1393a789faaa2f38b53d2effad827e86 (patch)
treeed8a456d8455a4f2a7d89723269e4352ccfb6dd5
parent5bece0dd1e8bb97d8ef07908179fb5735d097115 (diff)
downloadwekan-e01f4dbf1393a789faaa2f38b53d2effad827e86.tar.gz
wekan-e01f4dbf1393a789faaa2f38b53d2effad827e86.tar.bz2
wekan-e01f4dbf1393a789faaa2f38b53d2effad827e86.zip
Change Buffer to Buffer.alloc on Node v12. Try to fix Snap.
-rw-r--r--fix-download-unicode/cfs_access-point.txt8
-rw-r--r--models/export.js2
-rw-r--r--models/wekanCreator.js2
-rw-r--r--packages/wekan-ldap/server/ldap.js4
-rw-r--r--packages/wekan-oidc/oidc_server.js6
-rwxr-xr-xrebuild-wekan.sh2
-rw-r--r--sandstorm.js2
-rw-r--r--snapcraft.yaml27
8 files changed, 29 insertions, 24 deletions
diff --git a/fix-download-unicode/cfs_access-point.txt b/fix-download-unicode/cfs_access-point.txt
index 8e3359d0..145218df 100644
--- a/fix-download-unicode/cfs_access-point.txt
+++ b/fix-download-unicode/cfs_access-point.txt
@@ -451,14 +451,14 @@ FS.HTTP.Handlers.Get = function (ref) {
if(userAgent.indexOf('msie') >= 0 || userAgent.indexOf('trident') >= 0 || userAgent.indexOf('chrome') >= 0) {
ref.filename = encodeURIComponent(ref.filename);
} else if(userAgent.indexOf('firefox') >= 0) {
- ref.filename = new Buffer(ref.filename).toString('binary');
+ ref.filename = new Buffer.alloc(ref.filename).toString('binary');
} else {
/* safari*/
- ref.filename = new Buffer(ref.filename).toString('binary');
- }
+ ref.filename = new Buffer.alloc(ref.filename).toString('binary');
+ }
} catch (ex){
ref.filename = 'tempfix';
- }
+ }
return originalHandler.call(this, ref);
};
// 221
diff --git a/models/export.js b/models/export.js
index cc979ce0..69aaf619 100644
--- a/models/export.js
+++ b/models/export.js
@@ -138,7 +138,7 @@ export class Exporter {
// [Old] for attachments we only export IDs and absolute url to original doc
// [New] Encode attachment to base64
const getBase64Data = function(doc, callback) {
- let buffer = new Buffer(0);
+ let buffer = new Buffer.alloc(0);
// callback has the form function (err, res) {}
const tmpFile = path.join(
os.tmpdir(),
diff --git a/models/wekanCreator.js b/models/wekanCreator.js
index ec85d93f..26d34170 100644
--- a/models/wekanCreator.js
+++ b/models/wekanCreator.js
@@ -441,7 +441,7 @@ export class WekanCreator {
});
} else if (att.file) {
file.attachData(
- new Buffer(att.file, 'base64'),
+ new Buffer.alloc(att.file, 'base64'),
{
type: att.type,
},
diff --git a/packages/wekan-ldap/server/ldap.js b/packages/wekan-ldap/server/ldap.js
index bd2cd1fb..9d9f7f9d 100644
--- a/packages/wekan-ldap/server/ldap.js
+++ b/packages/wekan-ldap/server/ldap.js
@@ -286,14 +286,14 @@ export default class LDAP {
if (attribute) {
filter = new this.ldapjs.filters.EqualityFilter({
attribute,
- value: new Buffer(id, 'hex'),
+ value: new Buffer.alloc(id, 'hex'),
});
} else {
const filters = [];
Unique_Identifier_Field.forEach((item) => {
filters.push(new this.ldapjs.filters.EqualityFilter({
attribute: item,
- value : new Buffer(id, 'hex'),
+ value : new Buffer.alloc(id, 'hex'),
}));
});
diff --git a/packages/wekan-oidc/oidc_server.js b/packages/wekan-oidc/oidc_server.js
index 326238da..5a0f82cd 100644
--- a/packages/wekan-oidc/oidc_server.js
+++ b/packages/wekan-oidc/oidc_server.js
@@ -131,9 +131,9 @@ var getTokenContent = function (token) {
if (token) {
try {
var parts = token.split('.');
- var header = JSON.parse(new Buffer(parts[0], 'base64').toString());
- content = JSON.parse(new Buffer(parts[1], 'base64').toString());
- var signature = new Buffer(parts[2], 'base64');
+ var header = JSON.parse(new Buffer.alloc(parts[0], 'base64').toString());
+ content = JSON.parse(new Buffer.alloc(parts[1], 'base64').toString());
+ var signature = new Buffer.alloc(parts[2], 'base64');
var signed = parts[0] + '.' + parts[1];
} catch (err) {
this.content = {
diff --git a/rebuild-wekan.sh b/rebuild-wekan.sh
index 7e61854e..c80f17b8 100755
--- a/rebuild-wekan.sh
+++ b/rebuild-wekan.sh
@@ -111,7 +111,7 @@ do
npm_call -g install node-gyp
# Latest fibers for Meteor 1.8.x
sudo mkdir -p /usr/local/lib/node_modules/fibers/.node-gyp
- npm_call -g install fibers@4.0.1
+ npm_call -g install fibers
# Install Meteor, if it's not yet installed
curl https://install.meteor.com | bash
sudo chown -R $(id -u):$(id -g) $HOME/.npm $HOME/.meteor
diff --git a/sandstorm.js b/sandstorm.js
index 3cd84fc3..5bf3bbe0 100644
--- a/sandstorm.js
+++ b/sandstorm.js
@@ -55,7 +55,7 @@ if (isSandstorm && Meteor.isServer) {
const parsedDescriptor = Capnp.parse(
Powerbox.PowerboxDescriptor,
- new Buffer(descriptor, 'base64'),
+ new Buffer.alloc(descriptor, 'base64'),
{ packed: true },
);
diff --git a/snapcraft.yaml b/snapcraft.yaml
index ab93384b..bb1cb05c 100644
--- a/snapcraft.yaml
+++ b/snapcraft.yaml
@@ -1,5 +1,5 @@
name: wekan
-version: 0
+version: '0'
version-script: git describe --tags | cut -c 2-
summary: The open-source kanban
description: |
@@ -12,6 +12,11 @@ description: |
confinement: strict
grade: stable
+base: core18
+
+environment:
+ npm_config_unsafe_perm: "true"
+ NODE_ENV: "production"
architectures:
- amd64
@@ -65,9 +70,9 @@ apps:
parts:
mongodb:
- source: https://fastdl.mongodb.org/linux/mongodb-linux-x86_64-ubuntu1604-4.2.2.tgz
+ source: https://repo.mongodb.org/apt/ubuntu/dists/bionic/mongodb-org/4.2/multiverse/binary-amd64/mongodb-org-server_4.2.2_amd64.deb
plugin: dump
- stage-packages: [libssl1.0.0]
+ stage-packages: [libssl1.1]
filesets:
mongo:
- usr
@@ -81,21 +86,16 @@ parts:
wekan:
source: .
plugin: nodejs
- node-engine: 12.14.1
- node-packages:
- - node-gyp
- - node-pre-gyp
- - fibers
build-packages:
- ca-certificates
- apt-utils
- build-essential
- - python
-# - python3
+# - python
+ - python3
- g++
- capnproto
- curl
- - libcurl3
+ - libcurl4
- execstack
- nodejs
- npm
@@ -106,6 +106,11 @@ parts:
rm -rf ~/.meteor ~/.npm /usr/local/lib/node_modules
# Create the OpenAPI specification
rm -rf .build
+ npm -g install n
+ n 12.14.1
+ npm install -g node-gyp
+ npm install -g node-pre-gyp
+ npm install -g fibers
#mkdir -p .build/python
#cd .build/python
#git clone --depth 1 -b master https://github.com/Kronuz/esprima-python