Specify payload file using CLI arg for deliver.rb

This commit is contained in:
Anthony Wang 2022-07-12 23:00:08 -05:00
parent 329b818740
commit 5fe421046e
Signed by: a
GPG key ID: BC96B00AEC5F2D76
2 changed files with 3 additions and 1 deletions

View file

4
deliver.rb Normal file → Executable file
View file

@ -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}"