From b5aadcde74b7bb17a61aa6086945eacb9e3e194a Mon Sep 17 00:00:00 2001 From: Dennis Schwerdel Date: Tue, 23 May 2017 15:08:50 +0200 Subject: [PATCH] Caching ldap auth and fixed tests --- CHANGELOG | 24 +----------------------- CloudronManifest.json | 2 +- nginx.conf | 3 +++ test/test.js | 21 ++++++++++++++++----- 4 files changed, 21 insertions(+), 29 deletions(-) diff --git a/CHANGELOG b/CHANGELOG index 14c66d4..949afee 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -2,26 +2,4 @@ * Initial version [0.1.1] -* Added screenshots - -[0.2.0] -* Updated to 2017-01-25T03-14-52Z - -[0.2.1] -* Updated to 2017-02-16T01-47-30Z -* This version fixes the settings bug - -[0.2.2] -* New base image 0.10.0 - -[0.2.3] -* Updated to 2017-03-16T21-50-32Z - -[0.2.4] -* Updated to 2017-04-25T01-27-49Z - -[0.2.5] -* Updated to 2017-04-29T00-40-27Z - -[0.2.6] -* Updated to 2017-05-05T01-14-51Z +* Huge speedup by caching ldap diff --git a/CloudronManifest.json b/CloudronManifest.json index 939343e..11a7c10 100644 --- a/CloudronManifest.json +++ b/CloudronManifest.json @@ -5,7 +5,7 @@ "description": "file://DESCRIPTION.md", "changelog": "file://CHANGELOG", "tagline": "Decentralized file synchronization", - "version": "0.1.0", + "version": "0.1.1", "healthCheckPath": "/check", "httpPort": 8000, "addons": { diff --git a/nginx.conf b/nginx.conf index c79dee3..d9bf65b 100644 --- a/nginx.conf +++ b/nginx.conf @@ -28,6 +28,9 @@ http { proxy_buffering off; proxy_cache_path /tmp/proxy_cache levels=1:2 keys_zone=my_cache:10m max_size=100m inactive=60m use_temp_path=off; proxy_cache my_cache; + auth_ldap_cache_enabled on; + auth_ldap_cache_expiration_time 300000; + auth_ldap_cache_size 100; server { error_log /dev/stderr warn; diff --git a/test/test.js b/test/test.js index f751dec..5d27f95 100644 --- a/test/test.js +++ b/test/test.js @@ -63,10 +63,20 @@ describe('Application life cycle test', function () { }); } + function loadPageWait(callback) { + browser.manage().deleteAllCookies(); + setTimeout(function() { + browser.get('https://' + username + ':' + password + '@' + app.fqdn); + pageLoaded(function() { + callback(); + }); + }, 60000); //Timeout since, reconfigure lacks health-check + } + function loadPage(callback) { browser.manage().deleteAllCookies(); browser.get('https://' + username + ':' + password + '@' + app.fqdn); - pageLoaded(function() { + pageLoaded(function() { callback(); }); } @@ -94,16 +104,17 @@ describe('Application life cycle test', function () { } function removeFolder(callback) { + browser.get('https://' + username + ':' + password + '@' + app.fqdn); pageLoaded(function() { browser.findElement(by.css('#folders button')).click(); setTimeout(function() { browser.findElement(by.css('#folder-0 button[ng-click*=editFolder]')).click(); setTimeout(function() { browser.findElement(by.css('[ng-click*=deleteFolder]')).click().then(function() { - setTimeout(callback, 500); //This needs to run for some time + setTimeout(callback, 1000); //This needs to run for some time }); - }, 500); //No way to check for visibility of angular-js components - }, 500); //No way to check for visibility of angular-js components + }, 1000); //No way to check for visibility of angular-js components + }, 1000); //No way to check for visibility of angular-js components }); } @@ -147,7 +158,7 @@ describe('Application life cycle test', function () { expect(app).to.be.an('object'); }); - it('can load page', loadPage); + it('can load page', loadPageWait); it('can add folder', addFolder); it('can remove folder', removeFolder);