Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
les
gancio
Commits
280d4bec
Commit
280d4bec
authored
Jul 31, 2019
by
les
Browse files
.
parent
940eaead
Changes
2
Hide whitespace changes
Inline
Side-by-side
server/api/controller/user.js
View file @
280d4bec
...
...
@@ -125,7 +125,7 @@ const userController = {
federation
.
sendEvent
(
event
,
req
.
user
)
// send notification (mastodon/email/confirmation)
notifier
.
notifyEvent
(
event
.
id
)
//
notifier.notifyEvent(event.id)
},
...
...
server/federation/helpers.js
View file @
280d4bec
...
...
@@ -8,13 +8,13 @@ const Helpers = {
// get the URI of the actor object and append 'inbox' to it
const
toInbox
=
to
+
'
/inbox
'
const
toOrigin
=
new
URL
(
to
)
.
hostname
const
toPath
=
toInbox
.
replace
(
toOrigin
,
''
)
const
toOrigin
=
new
URL
(
to
)
const
toPath
=
toInbox
.
replace
(
toOrigin
.
origin
,
''
)
// get the private key
const
privkey
=
user
.
rsa
.
privateKey
const
signer
=
crypto
.
createSign
(
'
sha256
'
)
const
d
=
new
Date
()
const
stringToSign
=
`(request-target): post
${
toPath
}
\nhost:
${
toOrigin
}
\ndate:
${
d
.
toUTCString
()}
`
const
stringToSign
=
`(request-target): post
${
toPath
}
\nhost:
${
toOrigin
.
hostname
}
\ndate:
${
d
.
toUTCString
()}
`
console
.
error
(
'
stringToSign
'
,
stringToSign
)
signer
.
update
(
stringToSign
)
...
...
@@ -24,9 +24,9 @@ const Helpers = {
const
header
=
`keyId="
${
config
.
baseurl
}
/federation/u/
${
user
.
username
}
",headers="(request-target) host date",signature="
${
signature_b64
}
"`
console
.
error
(
'
header
'
,
header
)
request
({
url
:
i
nbox
,
url
:
toI
nbox
,
headers
:
{
'
Host
'
:
toOrigin
,
'
Host
'
:
toOrigin
.
hostname
,
'
Date
'
:
d
.
toUTCString
(),
'
Signature
'
:
header
},
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment