Compare commits

..

No commits in common. "6852d63a4304afcefd41980bb290d1047ea6b5bf" and "7adda41c716878eba7ac7dad7fde70f093635ec9" have entirely different histories.

2 changed files with 8 additions and 9 deletions

View File

@ -1,5 +1,5 @@
(defsystem "activitypub-servist" (defsystem "activitypub-servist"
:depends-on ("alexandria" "clack" "dexador" "inferior-shell" "ironclad" "local-time" "purl" "str" "webtentacle" "yason") :depends-on ("alexandria" "clack" "dexador" "inferior-shell" "ironclad" "local-time" "purl" "str" "webtentacle" "yason")
:components ((:file "src/activitypub-servist"))) :components ((:file "activitypub-servist")))
;; (ql:quickload '(alexandria clack dexador inferior-shell ironclad local-time purl str webtentacle yason)) ;; (ql:quickload '(alexandria clack dexador inferior-shell ironclad local-time purl str webtentacle yason))

View File

@ -38,8 +38,8 @@
(".well-known/host-meta" . http-host-meta))) (".well-known/host-meta" . http-host-meta)))
(defvar *privkey* (alexandria:read-file-into-string #p"../enc/privkey.pem")) (defvar *privkey* (alexandria:read-file-into-string #p"enc/privkey.pem"))
(defvar *pubkey* (alexandria:read-file-into-string #p"../enc/pubkey.pem")) (defvar *pubkey* (alexandria:read-file-into-string #p"enc/pubkey.pem"))
@ -116,7 +116,7 @@ the plist in the docstring for its WEBTENTACLE:SERVER function."
type "application/activity+json") type "application/activity+json")
(href ,profile (href ,profile
rel "self" rel "self"
type "application/ld+json; profile=\"https://www.w3.org/ns/activitystreams\"") type "application/activity+json")
(template ,(str:concat "https://" (cdr userhost) "/ostatus_subscribe?acct={uri}") (template ,(str:concat "https://" (cdr userhost) "/ostatus_subscribe?acct={uri}")
rel "http://ostatus.org/schema/1.0/subscribe")))))) rel "http://ostatus.org/schema/1.0/subscribe"))))))
@ -142,7 +142,6 @@ the plist in the docstring for its WEBTENTACLE:SERVER function."
(yason:with-output-to-string* () (yason:with-output-to-string* ()
(yason:encode-alist (yason:encode-alist
`(("@context" . ("https://www.w3.org/ns/activitystreams" `(("@context" . ("https://www.w3.org/ns/activitystreams"
"https://w3id.org/security/v1"
"https://litepub.social/litepub/context.jsonld")) "https://litepub.social/litepub/context.jsonld"))
("endpoints" . ,(alexandria:plist-hash-table (list "sharedInbox" "https://etc.xwx.moe/inbox"))) ("endpoints" . ,(alexandria:plist-hash-table (list "sharedInbox" "https://etc.xwx.moe/inbox")))
("url" . ,user-root) ("url" . ,user-root)
@ -180,7 +179,7 @@ Mi ne estas knabino!!")
;; ———————————————————————————————————————— ;; ————————————————————————————————————————
(defun note-json (from to text) (defun note-json (from to text)
"The JSON of a user's actor." "The JSON of a user's actor."
(let* ((user-root from) (let* ((user-root (str:concat "https://etc.xwx.moe/u/" from))
(yason:*symbol-encoder* 'yason:encode-symbol-as-lowercase)) (yason:*symbol-encoder* 'yason:encode-symbol-as-lowercase))
(yason:with-output-to-string* () (yason:with-output-to-string* ()
(yason:encode-alist (yason:encode-alist
@ -474,11 +473,11 @@ returned values: An Ironclad private key, and an Ironclad public key."
(defun openssl-shell-sign-string (private-pem-string string) (defun openssl-shell-sign-string (private-pem-string string)
"Use the OpenSSL binary on the host system to RSS-SHA256 sign a STRING with a "Use the OpenSSL binary on the host system to RSS-SHA256 sign a STRING with a
private key." private key."
(alexandria:write-string-into-file private-pem-string #p"/tmp/private.pem" :if-does-not-exist :create :if-exists :overwrite) (alexandria:write-string-into-file private-pem-string #p"private.pem" :if-exists :overwrite)
(apply #'str:concat (apply #'str:concat
(inferior-shell:run/lines (inferior-shell:run/lines
`(inferior-shell:pipe `(inferior-shell:pipe
(printf ,string) (printf ,string)
(openssl dgst -sha256 -sign /tmp/private.pem -) (openssl dgst -sha256 -sign private.pem -)
(base64))))) (base64)))))