diff options
author | pdp8 <pdp8@pdp8.info> | 2023-07-17 19:09:02 +0200 |
---|---|---|
committer | pdp8 <pdp8@pdp8.info> | 2023-07-17 19:09:02 +0200 |
commit | 4ca1c5555f18703d1dac673b1a77d1c919fb4787 (patch) | |
tree | 2f57783bdc1786e09737196a2fae07a720452d4f /activitypub.rb | |
parent | 2e614738f72c9af634c4a630693d06f144bc24df (diff) |
write to json instead of direcories
Diffstat (limited to 'activitypub.rb')
-rw-r--r-- | activitypub.rb | 20 |
1 files changed, 13 insertions, 7 deletions
diff --git a/activitypub.rb b/activitypub.rb index aef92a7..7416cca 100644 --- a/activitypub.rb +++ b/activitypub.rb @@ -6,26 +6,32 @@ require 'digest/sha2' require 'sinatra' SOCIAL_DIR = '/srv/social/' -INBOX_DIR = File.join(SOCIAL_DIR, 'inbox') PUBLIC_DIR = File.join(SOCIAL_DIR, 'public') +PRIVATE_DIR = File.join(SOCIAL_DIR, 'private') OUTBOX_DIR = File.join(PUBLIC_DIR, 'outbox') -FOLLOWERS = File.join(PUBLIC_DIR, 'followers') -FOLLOWING_DIR = File.join(PUBLIC_DIR, 'following') -TAGS = File.join(PUBLIC_DIR, 'tags') + +INBOX = File.join(PRIVATE_DIR, 'inbox.json') +FOLLOWERS = File.join(PUBLIC_DIR, 'followers.json') +FOLLOWING = File.join(PUBLIC_DIR, 'following.json') +OUTBOX = File.join(PUBLIC_DIR, 'outbox.json') +SHARED = File.join(PUBLIC_DIR, 'shared.json') +VISITED = File.join(PRIVATE_DIR, 'visited') USER = 'pdp8' SOCIAL_DOMAIN = 'social.pdp8.info' MENTION = "#{USER}@#{SOCIAL_DOMAIN}" +WEBFINGER = File.join(PUBLIC_DIR, MENTION + '.json') SOCIAL_URL = "https://#{SOCIAL_DOMAIN}" ACTOR = File.join(SOCIAL_URL, USER) OUTBOX_URL = File.join(SOCIAL_URL, 'outbox') -FOLLOWING_URL = File.join(SOCIAL_URL, 'following') + +CONTENT_TYPE = 'application/activity+json' +# CONTENT_TYPE = 'application/ld+json; profile="https://www.w3.org/ns/activitystreams"' enable :sessions set :session_secret, File.read('.secret').chomp -# set :default_content_type, 'application/activity+json' -set :default_content_type, 'application/ld+json; profile="https://www.w3.org/ns/activitystreams"' +set :default_content_type, CONTENT_TYPE set :port, 9292 require_relative 'helpers' |