blob: eefae9b716b337fe1bc22cb8240ae5e7d56483fa (
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
|
# frozen_string_literal: true
require 'uri'
require 'base64'
require 'digest/sha2'
require 'sinatra'
USER = 'pdp8'
WWW_DOMAIN = 'pdp8.info'
WWW_URL = "https://#{WWW_DOMAIN}"
SOCIAL_DOMAIN = "social.#{WWW_DOMAIN}"
SOCIAL_DIR = '/srv/social/'
INBOX = File.join(SOCIAL_DIR, 'inbox')
PUBLIC_DIR = File.join(SOCIAL_DIR, 'public')
OUTBOX = File.join(PUBLIC_DIR, 'outbox')
FOLLOWERS = File.join(PUBLIC_DIR, 'followers')
FOLLOWING = File.join(PUBLIC_DIR, 'following')
TAGS = File.join(PUBLIC_DIR, 'tags')
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 :default_content_type, 'application/activity+json'
set :port, 9292
require_relative 'helpers'
require_relative 'client'
require_relative 'server'
|