summaryrefslogtreecommitdiff
path: root/activitypub.rb
blob: fd8583e1bca675045064784e818fa06c6b03c131 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
# TODO
# server
# fix failed follows
# federation
# boost
# thread expansion
# include own posts in threads
# implement remaining activities
# test with pleroma etc

# client
# post form
# parse hashtags in post
# client post media
require 'uri'
require 'base64'
require 'digest/sha2'
require 'sinatra'
require_relative 'helpers.rb'

USER = "pdp8"
WWW_DOMAIN = "pdp8.info"
WWW_URL = "https://#{WWW_DOMAIN}"
SOCIAL_DOMAIN = "social.#{WWW_DOMAIN}"

ACCOUNT = "#{USER}@#{SOCIAL_DOMAIN}"
SOCIAL_URL = "https://#{SOCIAL_DOMAIN}"
ACTOR = File.join(SOCIAL_URL, USER)

enable :sessions
set :session_secret, File.read(".secret").chomp
set :default_content_type, 'application/ld+json; profile="https://www.w3.org/ns/activitystreams"'
set :port, 9292

require_relative 'server.rb'
require_relative 'client.rb'