Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
PUBLIC
/
surfer-okd
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Pipelines
Wiki
Snippets
Settings
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit b979e487
authored
Jun 17, 2019
by
Johannes Zellner
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Bump manifest format
1 parent
df0c8653
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
13 additions
and
10 deletions
CHANGELOG
CloudronManifest.json
DESCRIPTION.md
package-lock.json
package.json
src/auth.js
CHANGELOG
View file @
b979e48
...
@@ -85,3 +85,5 @@
...
@@ -85,3 +85,5 @@
[5.6.0]
[5.6.0]
* Add SFTP support
* Add SFTP support
[5.7.0]
* Update to latest app package manifest
CloudronManifest.json
View file @
b979e48
...
@@ -10,10 +10,11 @@
...
@@ -10,10 +10,11 @@
"hosting"
,
"hosting"
,
"server"
"server"
],
],
"version"
:
"5.
6
.0"
,
"version"
:
"5.
7
.0"
,
"healthCheckPath"
:
"/api/healthcheck"
,
"healthCheckPath"
:
"/api/healthcheck"
,
"httpPort"
:
3000
,
"httpPort"
:
3000
,
"manifestVersion"
:
1
,
"manifestVersion"
:
2
,
"minBoxVersion"
:
"4.1.4"
,
"website"
:
"https://git.cloudron.io/cloudron/surfer"
,
"website"
:
"https://git.cloudron.io/cloudron/surfer"
,
"documentationUrl"
:
"https://cloudron.io/documentation/apps/surfer/"
,
"documentationUrl"
:
"https://cloudron.io/documentation/apps/surfer/"
,
"contactEmail"
:
"support@cloudron.io"
,
"contactEmail"
:
"support@cloudron.io"
,
...
...
DESCRIPTION.md
View file @
b979e48
This app packages Surfer
<upstream>
5.
5
.0
</upstream>
This app packages Surfer
<upstream>
5.
7
.0
</upstream>
### Overview
### Overview
...
...
package-lock.json
View file @
b979e48
{
{
"name"
:
"cloudron-surfer"
,
"name"
:
"cloudron-surfer"
,
"version"
:
"5.
5
.0"
,
"version"
:
"5.
7
.0"
,
"lockfileVersion"
:
1
,
"lockfileVersion"
:
1
,
"requires"
:
true
,
"requires"
:
true
,
"dependencies"
:
{
"dependencies"
:
{
...
...
package.json
View file @
b979e48
{
{
"name"
:
"cloudron-surfer"
,
"name"
:
"cloudron-surfer"
,
"version"
:
"5.
5
.0"
,
"version"
:
"5.
7
.0"
,
"description"
:
"Simple file server"
,
"description"
:
"Simple file server"
,
"main"
:
"server.js"
,
"main"
:
"server.js"
,
"scripts"
:
{
"scripts"
:
{
...
...
src/auth.js
View file @
b979e48
...
@@ -12,8 +12,8 @@ var passport = require('passport'),
...
@@ -12,8 +12,8 @@ var passport = require('passport'),
HttpSuccess
=
require
(
'connect-lastmile'
).
HttpSuccess
,
HttpSuccess
=
require
(
'connect-lastmile'
).
HttpSuccess
,
webdavErrors
=
require
(
'webdav-server'
).
v2
.
Errors
;
webdavErrors
=
require
(
'webdav-server'
).
v2
.
Errors
;
const
LDAP_URL
=
process
.
env
.
LDAP_URL
;
const
LDAP_URL
=
process
.
env
.
CLOUDRON_
LDAP_URL
;
const
LDAP_USERS_BASE_DN
=
process
.
env
.
LDAP_USERS_BASE_DN
;
const
LDAP_USERS_BASE_DN
=
process
.
env
.
CLOUDRON_
LDAP_USERS_BASE_DN
;
const
LOCAL_AUTH_FILE
=
path
.
resolve
(
process
.
env
.
LOCAL_AUTH_FILE
||
'./.users.json'
);
const
LOCAL_AUTH_FILE
=
path
.
resolve
(
process
.
env
.
LOCAL_AUTH_FILE
||
'./.users.json'
);
const
TOKENSTORE_FILE
=
path
.
resolve
(
process
.
env
.
TOKENSTORE_FILE
||
'./.tokens.json'
);
const
TOKENSTORE_FILE
=
path
.
resolve
(
process
.
env
.
TOKENSTORE_FILE
||
'./.tokens.json'
);
const
AUTH_METHOD
=
(
LDAP_URL
&&
LDAP_USERS_BASE_DN
)
?
'ldap'
:
'local'
;
const
AUTH_METHOD
=
(
LDAP_URL
&&
LDAP_USERS_BASE_DN
)
?
'ldap'
:
'local'
;
...
@@ -79,16 +79,16 @@ passport.deserializeUser(function (id, done) {
...
@@ -79,16 +79,16 @@ passport.deserializeUser(function (id, done) {
function
verifyUser
(
username
,
password
,
callback
)
{
function
verifyUser
(
username
,
password
,
callback
)
{
if
(
AUTH_METHOD
===
'ldap'
)
{
if
(
AUTH_METHOD
===
'ldap'
)
{
var
ldapClient
=
ldapjs
.
createClient
({
url
:
process
.
env
.
LDAP_URL
});
var
ldapClient
=
ldapjs
.
createClient
({
url
:
process
.
env
.
CLOUDRON_
LDAP_URL
});
ldapClient
.
on
(
'error'
,
function
(
error
)
{
ldapClient
.
on
(
'error'
,
function
(
error
)
{
console
.
error
(
'LDAP error'
,
error
);
console
.
error
(
'LDAP error'
,
error
);
});
});
ldapClient
.
bind
(
process
.
env
.
LDAP_BIND_DN
,
process
.
env
.
LDAP_BIND_PASSWORD
,
function
(
error
)
{
ldapClient
.
bind
(
process
.
env
.
CLOUDRON_LDAP_BIND_DN
,
process
.
env
.
CLOUDRON_
LDAP_BIND_PASSWORD
,
function
(
error
)
{
if
(
error
)
return
callback
(
error
);
if
(
error
)
return
callback
(
error
);
var
filter
=
`(|(uid=
${
username
}
)(mail=
${
username
}
)(username=
${
username
}
)(sAMAccountName=
${
username
}
))`
;
var
filter
=
`(|(uid=
${
username
}
)(mail=
${
username
}
)(username=
${
username
}
)(sAMAccountName=
${
username
}
))`
;
ldapClient
.
search
(
process
.
env
.
LDAP_USERS_BASE_DN
,
{
filter
:
filter
},
function
(
error
,
result
)
{
ldapClient
.
search
(
process
.
env
.
CLOUDRON_
LDAP_USERS_BASE_DN
,
{
filter
:
filter
},
function
(
error
,
result
)
{
if
(
error
)
return
callback
(
error
);
if
(
error
)
return
callback
(
error
);
var
items
=
[];
var
items
=
[];
...
...
Write
Preview
Markdown
is supported
Attach a file
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to post a comment