Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix Mastodon discovery #83

Merged
merged 2 commits into from
May 22, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .env.example
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,6 @@ PORT=3000
SECRET=YOUR_GITHUB_WEBHOOK_SECRET
INBOX=https://test.skohub.io/inbox?target={id}
FOLLOWERS=https://test.skohub.io/followers?subject={id}
ACTOR=https://test.skohub.io{+path}
ACTOR=https://test.skohub.io/{+path}
PUBLIC_KEY="-----BEGIN PUBLIC KEY-----\nMIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAyr05JFWnpFGTr423+IRU\nHOgAuoF0RSxdwPpvXbX5uh+2jUBvhXzzklhc5nwfE3XruHTifJWyXFWucJlDPEI1\nxR5p0C0zfqY74ioEoKorifc8no8ZDTQRvIIEqNe0Ezbe085Foc3UWG1kimPcPlqU\nnsgCYgO4UWJ27qABE+yGDykZALdMlAt+dwOPD10NcqmvupH5pgWZJJ9vW2ErTaDt\n2R52JIpqH6CvCsI7jpLyYH60W0N0J0sjSH95lZnyVDYDbplIEPUPpGKYSVJW+dNU\nCxReZBiwS76VDQhyl1lT5JusRCogvsX/bwJrIZ8fJcOBArDx2skknzUHKkjNITsD\nTwIDAQAB\n-----END PUBLIC KEY-----\n"
BUILD_URL=https://test.skohub.io/build
11 changes: 5 additions & 6 deletions gatsby-node.js
Original file line number Diff line number Diff line change
Expand Up @@ -82,10 +82,10 @@ exports.sourceNodes = async ({
if (type === 'Concept') {
Object.assign(node, {
followers: followersUrlTemplate.expand({
id: ((process.env.BASEURL || '') + getPath(node.id))
id: `${process.env.BASEURL || ''}/${getPath(node.id)}`.substr(1)
}),
inbox: inboxUrlTemplate.expand({
id: ((process.env.BASEURL || '') + getPath(node.id))
id: `${process.env.BASEURL || ''}/${getPath(node.id)}`.substr(1)
})
})
}
Expand All @@ -110,10 +110,9 @@ exports.createPages = async ({ graphql, actions: { createPage } }) => {
conceptsInScheme.data.allConcept.edges.forEach(({ node: concept }) => {
const json = omitEmpty(Object.assign({}, concept, context.jsonld))
const jsonld = omitEmpty(Object.assign({}, concept, context.jsonld))
const actorPath = (process.env.BASEURL || '') + getPath(concept.id)
const actorPath = `${process.env.BASEURL || ''}/${getPath(concept.id)}`.substr(1)
const actor = actorUrlTemplate.expand({ path: actorPath })
const jsonas = omitEmpty({
context: context.as,
const jsonas = Object.assign(omitEmpty({
id: actor,
type: 'Service',
name: t(concept.prefLabel),
Expand All @@ -125,7 +124,7 @@ exports.createPages = async ({ graphql, actions: { createPage } }) => {
owner: actor,
publicKeyPem: process.env.PUBLIC_KEY
}
})
}), context.as)

if (getFilePath(concept.id) === getFilePath(conceptScheme.id)) {
// embed concepts in concept scheme
Expand Down