Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wiki-js
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
1
Issues
1
List
Board
Labels
Milestones
Merge Requests
1
Merge Requests
1
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Jacklull
wiki-js
Commits
db14239e
Commit
db14239e
authored
Apr 22, 2019
by
Nick
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
feat: dropbox auth module + uploads folder boot fix
parent
9b8a8867
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
26 additions
and
19 deletions
+26
-19
admin-storage.vue
client/components/admin/admin-storage.vue
+0
-12
purge-uploads.js
server/jobs/purge-uploads.js
+1
-0
authentication.js
server/modules/authentication/dropbox/authentication.js
+14
-5
definition.yml
server/modules/authentication/dropbox/definition.yml
+11
-2
yarn.lock
yarn.lock
+0
-0
No files found.
client/components/admin/admin-storage.vue
View file @
db14239e
...
...
@@ -262,18 +262,6 @@ export default {
})
this
.
$store
.
commit
(
`loadingStop`
,
'admin-storage-savetargets'
)
},
getStatusColor
(
state
)
{
switch
(
state
)
{
case
'pending'
:
return
'purple lighten-2'
case
'operational'
:
return
'green'
case
'error'
:
return
'red'
default
:
return
'grey darken-2'
}
},
getDefaultSchedule
(
val
)
{
return
moment
.
duration
(
val
).
format
(
'y [years], M [months], d [days], h [hours], m [minutes]'
)
},
...
...
server/jobs/purge-uploads.js
View file @
db14239e
...
...
@@ -10,6 +10,7 @@ module.exports = async () => {
try
{
const
uplTempPath
=
path
.
resolve
(
process
.
cwd
(),
WIKI
.
config
.
paths
.
data
,
'uploads'
)
await
fs
.
ensureDir
(
uplTempPath
)
const
ls
=
await
fs
.
readdir
(
uplTempPath
)
const
fifteenAgo
=
moment
().
subtract
(
15
,
'minutes'
)
...
...
server/modules/authentication/dropbox/authentication.js
View file @
db14239e
...
...
@@ -5,6 +5,7 @@
// ------------------------------------
const
DropboxStrategy
=
require
(
'passport-dropbox-oauth2'
).
Strategy
const
_
=
require
(
'lodash'
)
module
.
exports
=
{
init
(
passport
,
conf
)
{
...
...
@@ -14,12 +15,20 @@ module.exports = {
clientID
:
conf
.
clientId
,
clientSecret
:
conf
.
clientSecret
,
callbackURL
:
conf
.
callbackURL
},
(
accessToken
,
refreshToken
,
profile
,
cb
)
=>
{
WIKI
.
models
.
users
.
processProfile
(
profile
).
then
((
user
)
=>
{
return
cb
(
null
,
user
)
||
true
}).
catch
((
err
)
=>
{
return
cb
(
err
,
null
)
||
true
},
async
(
accessToken
,
refreshToken
,
profile
,
cb
)
=>
{
console
.
info
(
profile
)
try
{
const
user
=
await
WIKI
.
models
.
users
.
processProfile
({
profile
:
{
...
profile
,
picture
:
_
.
get
(
profile
,
'_json.profile_photo_url'
,
''
)
},
providerKey
:
'dropbox'
})
cb
(
null
,
user
)
}
catch
(
err
)
{
cb
(
err
,
null
)
}
})
)
}
...
...
server/modules/authentication/dropbox/definition.yml
View file @
db14239e
...
...
@@ -5,7 +5,16 @@ author: requarks.io
logo
:
https://static.requarks.io/logo/dropbox.svg
color
:
blue darken-2
website
:
https://dropbox.com
isAvailable
:
true
useForm
:
false
props
:
clientId
:
String
clientSecret
:
String
clientId
:
type
:
String
title
:
App Key
hint
:
Application Client ID
order
:
1
clientSecret
:
type
:
String
title
:
App Secret
hint
:
Application Client Secret
order
:
2
yarn.lock
View file @
db14239e
This diff was suppressed by a .gitattributes entry.
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
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 comment