mirror of
https://framagit.org/les/gancio.git
synced 2025-01-31 08:32:23 +01:00
WIP: caldav
This commit is contained in:
parent
ef0894d077
commit
6b623725a2
3 changed files with 27 additions and 0 deletions
15
server/api/controller/caldav.js
Normal file
15
server/api/controller/caldav.js
Normal file
|
@ -0,0 +1,15 @@
|
|||
const { Collection, Filter, Event, Tag, Place } = require('../models/models')
|
||||
|
||||
const log = require('../../log')
|
||||
const { col: Col, queryParamToBool } = require('../../helpers')
|
||||
const { Op, Sequelize } = require('sequelize')
|
||||
|
||||
const caldavController = {
|
||||
|
||||
async wellknown (req, res) {
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
module.exports = caldavController
|
|
@ -287,6 +287,13 @@ module.exports = {
|
|||
next()
|
||||
},
|
||||
|
||||
async caldav (req, res, next) {
|
||||
if (req.method === 'PRODFIND') {
|
||||
return res.sendStatus(400)
|
||||
}
|
||||
next()
|
||||
},
|
||||
|
||||
async isGeocodingEnabled(req, res, next) {
|
||||
if (res.locals.settings.allow_geolocation) {
|
||||
next()
|
||||
|
|
|
@ -38,9 +38,11 @@ async function main () {
|
|||
const placeController = require('./api/controller/place')
|
||||
const collectionController = require('./api/controller/collection')
|
||||
const authController = require('./api/controller/oauth')
|
||||
const caldavController = require('./api/controller/caldav')
|
||||
|
||||
// rss / ics feed
|
||||
app.use(helpers.feedRedirect)
|
||||
app.use(helpers.caldav)
|
||||
app.get('/feed/:format/tag/:tag', cors(), tagController.getEvents)
|
||||
app.get('/feed/:format/place/:placeName', cors(), placeController.getEvents)
|
||||
app.get('/feed/:format/collection/:name', cors(), collectionController.getEvents)
|
||||
|
@ -48,6 +50,9 @@ async function main () {
|
|||
|
||||
app.use('/event/:slug', helpers.APRedirect)
|
||||
|
||||
// caldav
|
||||
app.use('/.well-known/caldav', caldavController.wellknown)
|
||||
|
||||
// federation api / activitypub / webfinger / nodeinfo
|
||||
app.use('/federation', federation)
|
||||
app.use('/.well-known', webfinger)
|
||||
|
|
Loading…
Reference in a new issue