WIP: caldav

This commit is contained in:
lesion 2023-07-31 10:20:14 +02:00
parent ef0894d077
commit 6b623725a2
No known key found for this signature in database
GPG key ID: 352918250B012177
3 changed files with 27 additions and 0 deletions

View 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

View file

@ -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()

View file

@ -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)