diff options
author | Anthony Wang | 2022-07-12 23:00:08 -0500 |
---|---|---|
committer | Anthony Wang | 2022-07-12 23:00:08 -0500 |
commit | 5fe421046e18411418a38233e308a4e63b5be6e1 (patch) | |
tree | f999cb335a2df83e36de5f09c5d5ec7e3025706e /deliver.rb | |
parent | 329b818740b74ae03716c4f94099f7728d911277 (diff) |
Specify payload file using CLI arg for deliver.rb
Diffstat (limited to 'deliver.rb')
-rwxr-xr-x[-rw-r--r--] | deliver.rb | 4 |
1 files changed, 3 insertions, 1 deletions
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}" |