diff --git a/CHANGES b/CHANGES index a9727e02f..8dcf8ac76 100644 --- a/CHANGES +++ b/CHANGES @@ -1573,5 +1573,4 @@ * Ad graphite to services * Add labels and tags to apps * Ensure MySQL is storing data/time in UTC -* Set node to 8.15.1 (node 10.x broke ldap search) diff --git a/baseimage/initializeBaseUbuntuImage.sh b/baseimage/initializeBaseUbuntuImage.sh index 1573f5b11..2c05e71a2 100755 --- a/baseimage/initializeBaseUbuntuImage.sh +++ b/baseimage/initializeBaseUbuntuImage.sh @@ -56,10 +56,10 @@ apt-get -y install \ cp /usr/share/unattended-upgrades/20auto-upgrades /etc/apt/apt.conf.d/20auto-upgrades echo "==> Installing node.js" -mkdir -p /usr/local/node-8.15.1 -curl -sL https://nodejs.org/dist/v8.15.1/node-v8.15.1-linux-x64.tar.gz | tar zxvf - --strip-components=1 -C /usr/local/node-8.15.1 -ln -sf /usr/local/node-8.15.1/bin/node /usr/bin/node -ln -sf /usr/local/node-8.15.1/bin/npm /usr/bin/npm +mkdir -p /usr/local/node-10.15.1 +curl -sL https://nodejs.org/dist/v10.15.1/node-v10.15.1-linux-x64.tar.gz | tar zxvf - --strip-components=1 -C /usr/local/node-10.15.1 +ln -sf /usr/local/node-10.15.1/bin/node /usr/bin/node +ln -sf /usr/local/node-10.15.1/bin/npm /usr/bin/npm apt-get install -y python # Install python which is required for npm rebuild [[ "$(python --version 2>&1)" == "Python 2.7."* ]] || die "Expecting python version to be 2.7.x" diff --git a/scripts/installer.sh b/scripts/installer.sh index d9d3172e8..63463c756 100755 --- a/scripts/installer.sh +++ b/scripts/installer.sh @@ -64,12 +64,12 @@ if [[ ! `proftpd --version | grep "1.3.5"` ]]; then fi echo "==> installer: updating node" -if [[ "$(node --version)" != "v8.15.1" ]]; then - mkdir -p /usr/local/node-8.15.1 - $curl -sL https://nodejs.org/dist/v8.15.1/node-v8.15.1-linux-x64.tar.gz | tar zxvf - --strip-components=1 -C /usr/local/node-8.15.1 - ln -sf /usr/local/node-8.15.1/bin/node /usr/bin/node - ln -sf /usr/local/node-8.15.1/bin/npm /usr/bin/npm - rm -rf /usr/local/node-10.15.1 +if [[ "$(node --version)" != "v10.15.1" ]]; then + mkdir -p /usr/local/node-10.15.1 + $curl -sL https://nodejs.org/dist/v10.15.1/node-v10.15.1-linux-x64.tar.gz | tar zxvf - --strip-components=1 -C /usr/local/node-10.15.1 + ln -sf /usr/local/node-10.15.1/bin/node /usr/bin/node + ln -sf /usr/local/node-10.15.1/bin/npm /usr/bin/npm + rm -rf /usr/local/node-8.11.2 /usr/local/node-8.9.3 fi # this is here (and not in updater.js) because rebuild requires the above node diff --git a/src/test/backups-test.js b/src/test/backups-test.js index 6c4400fdc..561f664ef 100644 --- a/src/test/backups-test.js +++ b/src/test/backups-test.js @@ -70,8 +70,6 @@ function cleanupBackups(callback) { } describe('backups', function () { - this.timeout(10000); - before(function (done) { const BACKUP_DIR = path.join(os.tmpdir(), 'cloudron-backup-test'); diff --git a/src/test/eventlog-test.js b/src/test/eventlog-test.js index 362e8f9f2..22906dd08 100644 --- a/src/test/eventlog-test.js +++ b/src/test/eventlog-test.js @@ -28,8 +28,6 @@ function cleanup(done) { } describe('Eventlog', function () { - this.timeout(10000); - before(setup); after(cleanup); diff --git a/src/test/ldap-test.js b/src/test/ldap-test.js index 3e5dcc610..db34a083d 100644 --- a/src/test/ldap-test.js +++ b/src/test/ldap-test.js @@ -205,7 +205,6 @@ function cleanup(done) { } describe('Ldap', function () { - this.timeout(10000); before(setup); after(cleanup); @@ -215,7 +214,8 @@ describe('Ldap', function () { client.bind('cn=doesnotexist,ou=users,dc=cloudron', 'password', function (error) { expect(error).to.be.a(ldap.NoSuchObjectError); - client.unbind(done); + client.unbind(); + done(); }); }); @@ -224,7 +224,8 @@ describe('Ldap', function () { client.bind('cn=' + USER_0.id + ',ou=users,dc=cloudron', 'wrongpassword', function (error) { expect(error).to.be.a(ldap.InvalidCredentialsError); - client.unbind(done); + client.unbind(); + done(); }); }); @@ -233,7 +234,8 @@ describe('Ldap', function () { client.bind('cn=' + USER_0.id + ',ou=users,dc=cloudron', USER_0.password, function (error) { expect(error).to.be(null); - client.unbind(done); + client.unbind(); + done(); }); }); @@ -242,7 +244,8 @@ describe('Ldap', function () { client.bind('cn=' + USER_0.username + ',ou=users,dc=cloudron', USER_0.password, function (error) { expect(error).to.be(null); - client.unbind(done); + client.unbind(); + done(); }); }); @@ -251,7 +254,8 @@ describe('Ldap', function () { client.bind('cn=' + USER_0.email + ',ou=users,dc=cloudron', USER_0.password, function (error) { expect(error).to.be(null); - client.unbind(done); + client.unbind(); + done(); }); }); @@ -277,7 +281,8 @@ describe('Ldap', function () { client.bind('mail=' + USER_0.username + ',ou=users,dc=cloudron', USER_0.password, function (error) { expect(error).to.be.a(ldap.NoSuchObjectError); - client.unbind(done); + client.unbind(); + done(); }); }); @@ -289,7 +294,8 @@ describe('Ldap', function () { client.bind('cn=' + USER_1.id + ',ou=users,dc=cloudron', USER_1.password, function (error) { expect(error).to.be.a(ldap.NoSuchObjectError); - client.unbind(done); + client.unbind(); + done(); }); }); }); @@ -302,7 +308,8 @@ describe('Ldap', function () { client.bind('cn=' + USER_0.id + ',ou=users,dc=cloudron', USER_0.password, function (error) { expect(error).to.be(null); - client.unbind(done); + client.unbind(); + done(); }); }); }); @@ -322,7 +329,8 @@ describe('Ldap', function () { result.on('error', function (error) { expect(error).to.be.a(ldap.NoSuchObjectError); - client.unbind(done); + client.unbind(); + done(); }); result.on('end', function (result) { done(new Error('Should not succeed. Status ' + result.status)); @@ -353,7 +361,8 @@ describe('Ldap', function () { expect(entries[0].mail).to.equal(USER_0.email.toLowerCase()); expect(entries[1].username).to.equal(USER_1.username.toLowerCase()); expect(entries[1].mail).to.equal(USER_1.email.toLowerCase()); - client.unbind(done); + client.unbind(); + done(); }); }); }); @@ -382,7 +391,8 @@ describe('Ldap', function () { expect(entries[0].mail).to.equal(USER_0.email.toLowerCase()); expect(entries[1].username).to.equal(USER_1.username.toLowerCase()); expect(entries[1].mail).to.equal(USER_1.email.toLowerCase()); - client.unbind(done); + client.unbind(); + done(); }); }); }); @@ -447,7 +457,8 @@ describe('Ldap', function () { entries.sort(function (a, b) { return a.username > b.username; }); expect(entries[0].username).to.equal(USER_0.username.toLowerCase()); expect(entries[1].username).to.equal(USER_1.username.toLowerCase()); - client.unbind(done); + client.unbind(); + done(); }); }); }); @@ -472,7 +483,8 @@ describe('Ldap', function () { expect(entries.length).to.equal(1); expect(entries[0].username).to.equal(USER_0.username.toLowerCase()); expect(entries[0].memberof.length).to.equal(2); - client.unbind(done); + client.unbind(); + done(); }); }); }); @@ -611,7 +623,8 @@ describe('Ldap', function () { expect(entries[1].cn).to.equal('admins'); // if only one entry, the array becomes a string :-/ expect(entries[1].memberuid).to.equal(USER_0.id); - client.unbind(done); + client.unbind(); + done(); }); }); }); @@ -642,7 +655,8 @@ describe('Ldap', function () { expect(entries[1].cn).to.equal('admins'); // if only one entry, the array becomes a string :-/ expect(entries[1].memberuid).to.equal(USER_0.id); - client.unbind(done); + client.unbind(); + done(); }); }); }); @@ -667,7 +681,8 @@ describe('Ldap', function () { expect(entries.length).to.equal(1); expect(entries[0].cn).to.equal('users'); expect(entries[0].memberuid.length).to.equal(3); - client.unbind(done); + client.unbind(); + done(); }); }); }); @@ -740,7 +755,8 @@ describe('Ldap', function () { expect(entries[1].cn).to.equal('admins'); // if only one entry, the array becomes a string :-/ expect(entries[1].memberuid).to.equal(USER_0.id); - client.unbind(done); + client.unbind(); + done(); }); }); }); @@ -785,6 +801,7 @@ describe('Ldap', function () { }); }); + // ldapsearch -LLL -E pr=10/noprompt -x -h localhost -p 3002 -b cn=userName0@example.com,ou=mailboxes,dc=cloudron objectclass=mailbox function ldapSearch(dn, filter, callback) { var client = ldap.createClient({ url: 'ldap://127.0.0.1:' + config.get('ldapPort') }); @@ -794,9 +811,8 @@ describe('Ldap', function () { }; function done(error, entries) { - client.unbind(function () { - callback(error, entries); - }); + client.unbind(); + callback(error, entries); } client.search(dn, opts, function (error, result) { @@ -920,7 +936,8 @@ describe('Ldap', function () { client.bind('cn=' + USER_0.username + '@example.com,domain=example.com,ou=mailboxes,dc=cloudron', USER_0.password + 'nope', function (error) { expect(error).to.be.a(ldap.NoSuchObjectError); - client.unbind(done); + client.unbind(); + done(); }); }); @@ -982,7 +999,8 @@ describe('Ldap', function () { client.bind('cn=' + USER_0.username + '@example.com,ou=sendmail,dc=cloudron', USER_0.password + 'nope', function (error) { expect(error).to.be.a(ldap.InvalidCredentialsError); - client.unbind(done); + client.unbind(); + done(); }); }); @@ -991,7 +1009,8 @@ describe('Ldap', function () { client.bind('cn=' + USER_0.email + ',ou=sendmail,dc=cloudron', USER_0.password + 'nope', function (error) { expect(error).to.be.a(ldap.NoSuchObjectError); - client.unbind(done); + client.unbind(); + done(); }); }); @@ -1041,7 +1060,8 @@ describe('Ldap', function () { client.bind('cn=hacker.app@example.com,ou=sendmail,dc=cloudron', 'nope', function (error) { expect(error).to.be.a(ldap.NoSuchObjectError); - client.unbind(done); + client.unbind(); + done(); }); }); @@ -1050,7 +1070,8 @@ describe('Ldap', function () { client.bind('cn=' + APP_0.location + '.app@example.com,ou=sendmail,dc=cloudron', 'nope', function (error) { expect(error).to.be.a(ldap.NoSuchObjectError); - client.unbind(done); + client.unbind(); + done(); }); }); @@ -1074,7 +1095,8 @@ describe('Ldap', function () { client.bind('cn=' + USER_0.username + '@example.com,ou=recvmail,dc=cloudron', USER_0.password + 'nope', function (error) { expect(error).to.be.a(ldap.NoSuchObjectError); - client.unbind(done); + client.unbind(); + done(); }); }); @@ -1083,7 +1105,8 @@ describe('Ldap', function () { client.bind('cn=' + USER_0.email + ',ou=recvmail,dc=cloudron', USER_0.password + 'nope', function (error) { expect(error).to.be.a(ldap.NoSuchObjectError); - client.unbind(done); + client.unbind(); + done(); }); }); @@ -1132,7 +1155,8 @@ describe('Ldap', function () { client.bind('cn=hacker.app@example.com,ou=recvmail,dc=cloudron', 'nope', function (error) { expect(error).to.be.a(ldap.NoSuchObjectError); - client.unbind(done); + client.unbind(); + done(); }); }); @@ -1141,7 +1165,8 @@ describe('Ldap', function () { client.bind('cn=' + APP_0.location + '.app@example.com,ou=recvmail,dc=cloudron', 'nope', function (error) { expect(error).to.be.a(ldap.NoSuchObjectError); - client.unbind(done); + client.unbind(); + done(); }); });