improve installation/documentation

This commit is contained in:
lesion
2019-07-03 16:58:24 +02:00
parent 6a96193ffc
commit 412e6f7dae
11 changed files with 131 additions and 129 deletions

View File

@@ -59,13 +59,13 @@ ${event.description.length > 200 ? event.description.substr(0, 200) + '...' : ev
const type = msg.event
if (type === 'delete') {
const activitypub_id = msg.data
const activitypub_id = String(msg.data)
const event = await Comment.findOne({ where: { activitypub_id } })
if (event) await event.destroy()
return
}
const activitypub_id = msg.data.in_reply_to_id
const activitypub_id = String(msg.data.in_reply_to_id)
if (!activitypub_id) return
let event = await Event.findOne({ where: { activitypub_id } })
if (!event) {

View File

@@ -1,7 +1,11 @@
'use strict'
module.exports = (sequelize, DataTypes) => {
const comment = sequelize.define('comment', {
activitypub_id: DataTypes.STRING(18),
activitypub_id: {
type: DataTypes.STRING(18),
index: true,
unique: true,
},
data: DataTypes.JSON
}, {})
comment.associate = function (models) {

View File

@@ -6,7 +6,11 @@ const sharp = require('sharp')
const consola = require('consola')
const config = require('config')
mkdirp.sync(config.upload_path + '/thumb')
try {
mkdirp.sync(config.upload_path + '/thumb')
} catch (e) {
consola.error(e)
}
const DiskStorage = {
_handleFile(req, file, cb) {