This repository has been archived by the owner on Oct 22, 2021. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
NextCloud Integration #11
Open
Tratori
wants to merge
33
commits into
develop
Choose a base branch
from
feature/netxcloud-integration
base: develop
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from 2 commits
Commits
Show all changes
33 commits
Select commit
Hold shift + click to select a range
be65c24
some testing
Tratori 52b5094
packages for "debugging"
Tratori 22af6a3
who want to debug anyway
Tratori a546aab
some tests and fixed some ESLint issues
DevSchmidtchen 823df75
some tests and fixed some ESLint issues
DevSchmidtchen 4dcdd69
some more ESLint issues
DevSchmidtchen 04f9a33
updated packages and some testing
DevSchmidtchen 89dc863
Merge branch 'develop' into feature/netxcloud-integration
DevSchmidtchen 090bc56
bad implementation of needed props
Tratori 3ea6488
Merge branch 'feature/netxcloud-integration' of https://github.com/hp…
Tratori c13b8ff
update capabilities
Tratori 2e8416a
restore old webdav_root
Tratori e897153
add basic config
Tratori 72ed50b
statjc responses that make sense
Tratori b1e55d5
change settings so no full path is returned
Tratori c86a57d
preliminary solution for recursive updating of timestamps
DevSchmidtchen 51e417c
fixed timestamps on root directories
DevSchmidtchen 07e1930
some comments
DevSchmidtchen d2cb8b0
Merge branch 'develop' into feature/netxcloud-integration
DevSchmidtchen 7a618a5
updated packages
DevSchmidtchen c274cd3
also updating courses and should work with every WebFileSystem
DevSchmidtchen 8e3bca4
execute new function everytime a file gets updated in any way
DevSchmidtchen a9e5deb
removed TODO because this is not the default behaviour in other file …
DevSchmidtchen 034436e
updatedAt with teams
DevSchmidtchen 939e3b5
added TODO
DevSchmidtchen 7fc682f
lastModifiedDate on root directories
DevSchmidtchen 1a7f917
Merge branch 'develop' into feature/netxcloud-integration
DevSchmidtchen c17f05d
linked schulcloud-server PR which resolves updates of parent director…
DevSchmidtchen f164f13
updated npm
DevSchmidtchen 3fb1f09
remove unneeded stuff
Tratori 22d8d61
remove xml parser
Tratori 4042849
moving owncloud settings into own file
Tratori 9896b5c
Merge branch 'develop' into feature/netxcloud-integration
DevSchmidtchen File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -4,7 +4,8 @@ import WebFileSystem from "./WebFileSystem"; | |
import UserManager from "./UserManager"; | ||
import logger from './logger'; | ||
import {environment} from './config/globals'; | ||
import Propfind from "webdav-server/lib/server/v2/commands/Propfind"; | ||
var bodyParser = require('body-parser'); | ||
require('body-parser-xml')(bodyParser) | ||
|
||
const userManager = new UserManager() | ||
|
||
|
@@ -48,7 +49,7 @@ Calling GET /ocs/v2.php/apps/notifications/api/v2/notifications?format=json... | |
Calling GET /ocs/v2.php/core/navigation/apps?absolute=true&format=json... | ||
*/ | ||
app.use((req, res, next) => { | ||
logger.info('Calling ' + req.method + ' ' + req.originalUrl + '...') | ||
logger.error('Calling ' + req.method + ' ' + req.originalUrl + '...') | ||
next() | ||
}) | ||
|
||
|
@@ -100,13 +101,13 @@ const capabilities = { | |
} | ||
} | ||
|
||
app.get('/ocs/v1.php/cloud/capabilities?format=json', (req, res) => { | ||
app.get('/ocs/v1.php/cloud/capabilities', (req, res) => { | ||
logger.info('Requesting v1 capabilities (JSON)...') | ||
res.send(capabilities) | ||
}) | ||
|
||
// Seems to get requested much earlier, however, nextcloud tries to get /remote.php/webdav | ||
app.get('/ocs/v2.php/cloud/capabilities?format=json', (req, res) => { | ||
app.get('/ocs/v2.php/cloud/capabilities', (req, res) => { | ||
logger.info('Requesting v2 capabilities (JSON)...') | ||
res.send(capabilities) | ||
}) | ||
|
@@ -117,6 +118,17 @@ app.head('/remote.php/webdav/', (req, res, next) => { | |
res.send() | ||
}) | ||
|
||
const xmlParser = bodyParser.xml() | ||
app.propfind('/remote.php/dav/files/[email protected]/', xmlParser,(req, res, next) => { | ||
console.log(req.body) | ||
let oldUrl = req.url | ||
let urlParts = oldUrl.split('/') | ||
let path = urlParts.slice(5) | ||
req.url = '/remote.php/webdav/'+ path.join('/') | ||
logger.error(req.url) | ||
return app._router.handle(req,res,next) | ||
}) | ||
|
||
// root path doesn't seem to work that easily with all webdav clients, if it doesn't work simply put an empty string there | ||
app.use(webdav.extensions.express(environment.WEBDAV_ROOT, server)) | ||
|
||
|
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
shouldn't this value be dynamic?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yup! This is some sort of WIP/Testing