From 3a87028b34c969744f6c63ba73947cfa32156e7d Mon Sep 17 00:00:00 2001 From: pdp8 Date: Sat, 9 Sep 2023 16:02:50 +0200 Subject: update and clean-inbox added, no outbox send for delete, recursive create for objects with activities (lemmy) --- application.rb | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) (limited to 'application.rb') diff --git a/application.rb b/application.rb index a03d98c..5236685 100644 --- a/application.rb +++ b/application.rb @@ -1,10 +1,8 @@ -# frozen_string_literal: true - require 'uri' require 'base64' require 'digest/sha2' +require 'time' require 'rack/protection' -# require 'rack/contrib' require 'sinatra' SOCIAL_DIR = '/srv/social/' @@ -25,15 +23,13 @@ INBOX = { dir: File.join(SOCIAL_DIR, 'inbox') } OUTBOX = { dir: File.join(SOCIAL_DIR, 'outbox'), url: File.join(SOCIAL_URL, 'outbox') } TAGS = { dir: File.join(PUBLIC_DIR, 'tags'), url: File.join(SOCIAL_URL, 'tags') } FOLLOWERS_URL = 'https://social.pdp8.info/followers' +VISITED = File.join(INBOX[:dir], 'visited') +ACTIVITIES = %i[create announce follow accept undo delete like update move] CONTENT_TYPE = 'application/activity+json' # CONTENT_TYPE = 'application/ld+json; profile="https://www.w3.org/ns/activitystreams"' use Rack::Protection -# use Rack::MailExceptions do |mail| -# mail.to 'info@pdp8.info' -# mail.smtp false -# end enable :sessions set :environment, :production -- cgit v1.2.3