aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
-rw-r--r--CHANGELOG2
-rw-r--r--CloudronManifest.json5
-rw-r--r--DESCRIPTION.md2
-rw-r--r--package-lock.json2
-rw-r--r--package.json2
-rw-r--r--src/auth.js10
6 files changed, 13 insertions, 10 deletions
diff --git a/CHANGELOG b/CHANGELOG
index 09b33b8..f9879db 100644
--- a/CHANGELOG
+++ b/CHANGELOG
@@ -85,3 +85,5 @@
85[5.6.0] 85[5.6.0]
86* Add SFTP support 86* Add SFTP support
87 87
88[5.7.0]
89* Update to latest app package manifest
diff --git a/CloudronManifest.json b/CloudronManifest.json
index 8ed67dc..dc463ba 100644
--- a/CloudronManifest.json
+++ b/CloudronManifest.json
@@ -10,10 +10,11 @@
10 "hosting", 10 "hosting",
11 "server" 11 "server"
12 ], 12 ],
13 "version": "5.6.0", 13 "version": "5.7.0",
14 "healthCheckPath": "/api/healthcheck", 14 "healthCheckPath": "/api/healthcheck",
15 "httpPort": 3000, 15 "httpPort": 3000,
16 "manifestVersion": 1, 16 "manifestVersion": 2,
17 "minBoxVersion": "4.1.4",
17 "website": "https://git.cloudron.io/cloudron/surfer", 18 "website": "https://git.cloudron.io/cloudron/surfer",
18 "documentationUrl": "https://cloudron.io/documentation/apps/surfer/", 19 "documentationUrl": "https://cloudron.io/documentation/apps/surfer/",
19 "contactEmail": "support@cloudron.io", 20 "contactEmail": "support@cloudron.io",
diff --git a/DESCRIPTION.md b/DESCRIPTION.md
index 10a95f0..b57b004 100644
--- a/DESCRIPTION.md
+++ b/DESCRIPTION.md
@@ -1,4 +1,4 @@
1This app packages Surfer <upstream>5.5.0</upstream> 1This app packages Surfer <upstream>5.7.0</upstream>
2 2
3### Overview 3### Overview
4 4
diff --git a/package-lock.json b/package-lock.json
index 4c373b0..dccc4ed 100644
--- a/package-lock.json
+++ b/package-lock.json
@@ -1,6 +1,6 @@
1{ 1{
2 "name": "cloudron-surfer", 2 "name": "cloudron-surfer",
3 "version": "5.5.0", 3 "version": "5.7.0",
4 "lockfileVersion": 1, 4 "lockfileVersion": 1,
5 "requires": true, 5 "requires": true,
6 "dependencies": { 6 "dependencies": {
diff --git a/package.json b/package.json
index 2e86673..7b8c0ff 100644
--- a/package.json
+++ b/package.json
@@ -1,6 +1,6 @@
1{ 1{
2 "name": "cloudron-surfer", 2 "name": "cloudron-surfer",
3 "version": "5.5.0", 3 "version": "5.7.0",
4 "description": "Simple file server", 4 "description": "Simple file server",
5 "main": "server.js", 5 "main": "server.js",
6 "scripts": { 6 "scripts": {
diff --git a/src/auth.js b/src/auth.js
index 80fa122..96f3045 100644
--- a/src/auth.js
+++ b/src/auth.js
@@ -12,8 +12,8 @@ var passport = require('passport'),
12 HttpSuccess = require('connect-lastmile').HttpSuccess, 12 HttpSuccess = require('connect-lastmile').HttpSuccess,
13 webdavErrors = require('webdav-server').v2.Errors; 13 webdavErrors = require('webdav-server').v2.Errors;
14 14
15const LDAP_URL = process.env.LDAP_URL; 15const LDAP_URL = process.env.CLOUDRON_LDAP_URL;
16const LDAP_USERS_BASE_DN = process.env.LDAP_USERS_BASE_DN; 16const LDAP_USERS_BASE_DN = process.env.CLOUDRON_LDAP_USERS_BASE_DN;
17const LOCAL_AUTH_FILE = path.resolve(process.env.LOCAL_AUTH_FILE || './.users.json'); 17const LOCAL_AUTH_FILE = path.resolve(process.env.LOCAL_AUTH_FILE || './.users.json');
18const TOKENSTORE_FILE = path.resolve(process.env.TOKENSTORE_FILE || './.tokens.json'); 18const TOKENSTORE_FILE = path.resolve(process.env.TOKENSTORE_FILE || './.tokens.json');
19const AUTH_METHOD = (LDAP_URL && LDAP_USERS_BASE_DN) ? 'ldap' : 'local'; 19const AUTH_METHOD = (LDAP_URL && LDAP_USERS_BASE_DN) ? 'ldap' : 'local';
@@ -79,16 +79,16 @@ passport.deserializeUser(function (id, done) {
79 79
80function verifyUser(username, password, callback) { 80function verifyUser(username, password, callback) {
81 if (AUTH_METHOD === 'ldap') { 81 if (AUTH_METHOD === 'ldap') {
82 var ldapClient = ldapjs.createClient({ url: process.env.LDAP_URL }); 82 var ldapClient = ldapjs.createClient({ url: process.env.CLOUDRON_LDAP_URL });
83 ldapClient.on('error', function (error) { 83 ldapClient.on('error', function (error) {
84 console.error('LDAP error', error); 84 console.error('LDAP error', error);
85 }); 85 });
86 86
87 ldapClient.bind(process.env.LDAP_BIND_DN, process.env.LDAP_BIND_PASSWORD, function (error) { 87 ldapClient.bind(process.env.CLOUDRON_LDAP_BIND_DN, process.env.CLOUDRON_LDAP_BIND_PASSWORD, function (error) {
88 if (error) return callback(error); 88 if (error) return callback(error);
89 89
90 var filter = `(|(uid=${username})(mail=${username})(username=${username})(sAMAccountName=${username}))`; 90 var filter = `(|(uid=${username})(mail=${username})(username=${username})(sAMAccountName=${username}))`;
91 ldapClient.search(process.env.LDAP_USERS_BASE_DN, { filter: filter }, function (error, result) { 91 ldapClient.search(process.env.CLOUDRON_LDAP_USERS_BASE_DN, { filter: filter }, function (error, result) {
92 if (error) return callback(error); 92 if (error) return callback(error);
93 93
94 var items = []; 94 var items = [];