aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAnthony Wang2022-07-12 23:00:08 -0500
committerAnthony Wang2022-07-12 23:00:08 -0500
commit5fe421046e18411418a38233e308a4e63b5be6e1 (patch)
treef999cb335a2df83e36de5f09c5d5ec7e3025706e
parent329b818740b74ae03716c4f94099f7728d911277 (diff)
Specify payload file using CLI arg for deliver.rb
-rw-r--r--comment (renamed from message)0
-rwxr-xr-x[-rw-r--r--]deliver.rb4
2 files changed, 3 insertions, 1 deletions
diff --git a/message b/comment
index 9742796..9742796 100644
--- a/message
+++ b/comment
diff --git a/deliver.rb b/deliver.rb
index b54de2d..c3f04ce 100644..100755
--- a/deliver.rb
+++ b/deliver.rb
@@ -1,9 +1,11 @@
+#!/usr/bin/ruby
+
# https://blog.joinmastodon.org/2018/06/how-to-implement-a-basic-activitypub-server/
require 'http'
require 'openssl'
-document = File.read('message')
+document = File.read(ARGV[0])
date = Time.now.utc.httpdate
keypair = OpenSSL::PKey::RSA.new(File.read('private.pem'))
signed_string = "(request-target): post /inbox\nhost: git.exozy.me\ndate: #{date}"