Distribute posts from remote

This commit is contained in:
Akihiko Odaki
2018-04-02 17:11:14 +09:00
parent aa94035987
commit ce7efc4dbb
12 changed files with 417 additions and 353 deletions

View File

@ -6,10 +6,14 @@ import queue from '../../queue';
import parseAcct from '../../acct/parse';
const app = express();
app.disable('x-powered-by');
app.use(bodyParser.json());
app.post('/@:user/inbox', async (req, res) => {
app.disable('x-powered-by');
app.post('/@:user/inbox', bodyParser.json({
type() {
return true;
}
}), async (req, res) => {
let parsed;
req.headers.authorization = 'Signature ' + req.headers.signature;
@ -51,6 +55,7 @@ app.post('/@:user/inbox', async (req, res) => {
type: 'performActivityPub',
actor: user._id,
outbox: req.body,
distribute: true,
}).save();
return res.status(202).end();