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

Deploy test server #12

Merged
merged 8 commits into from
May 15, 2019
Merged

Deploy test server #12

merged 8 commits into from
May 15, 2019

Conversation

literarymachine
Copy link
Contributor

Deployed to https://test.skohub.io/

$ node src/subscriber.js https://test.skohub.io/hub http://test.lobid.org/gnd/118696432
$ curl -i -H "Content-Type: application/ld+json" "https://test.skohub.io/inbox?target=http://test.lobid.org/gnd/118696432" -d '{"foo": "bar"}'
HTTP/1.1 202 Accepted

@acka47 acka47 added this to Review in SkoHub Apr 29, 2019
@acka47
Copy link
Member

acka47 commented Apr 30, 2019

When I try this, I get the 202 Accepted but do not see the notification being logged by the subscriber. Shouldn't it be that way?

@fsteeg
Copy link
Contributor

fsteeg commented Apr 30, 2019

The commands from #12 (comment) work fine (but like for Adrian, nothing is logged by the subscriber).

However I have problems with the README steps:

  • Basic setup, curl -i "localhost:3000/inbox?target=https://test.lobid.org/gnd/118696432" (I added the test subdomain, this should work, right?) -> 400 Bad Request, Invalid link headers for target URL (same in master)
  • Further down, node src/subscriber.js http://localhost:3000/hub http://$address:$port/some/random/path (I set address and port to my publisher) -> Could not connect to hub http://localhost:3000/hub (works in master)

@literarymachine
Copy link
Contributor Author

Basic setup, curl -i "localhost:3000/inbox?target=https://test.lobid.org/gnd/118696432" (I added the test subdomain, this should work, right?) -> 400 Bad Request, Invalid link headers for target URL (same in master)

This is expected behavior. The Link headers returned by http://test.lobid.org/gnd/118696432 do no point to localhost:3000 but to https://test.skohub.io:

$ curl -i http://test.lobid.org/gnd/118696432
HTTP/1.1 200 OK
Date: Tue, 30 Apr 2019 08:53:11 GMT
Server: Apache/2.4.10 (Linux/SUSE)
Link: <https://test.skohub.io/inbox?target=http://test.lobid.org/gnd/118696432>; rel=http://www.w3.org/ns/ldp#inbox, <https://test.skohub.io/hub>; rel=hub, <http://test.lobid.org/gnd/118696432>; rel=self
Access-Control-Allow-Origin: *

Thus the inbox at localhost:3000 rejects the request as of #7. I need to update the README accordingly. Please also note that we agreed to use the http URIs for lobid targets in hbz/lobid-gnd#184 (comment).

@fsteeg
Copy link
Contributor

fsteeg commented Apr 30, 2019

I see. Also, since it's the same in master it's not actually relevant for this PR. The second point however seems to be related to the changes here, since it works for me in master:

Further down, node src/subscriber.js http://localhost:3000/hub http://$address:$port/some/random/path (I set address and port to my publisher) -> Could not connect to hub http://localhost:3000/hub (works in master)

@literarymachine
Copy link
Contributor Author

Further down, node src/subscriber.js http://localhost:3000/hub http://$address:$port/some/random/path (I set address and port to my publisher) -> Could not connect to hub http://localhost:3000/hub (works in master)

This was also due to the Link headers, see 9f62eda for an updated README. To test the PR though, it is not necessary to run the hub locally. The hub is running at https://test.skohub.io/hub, looking into #12 (comment) now (was working when I opened the PR).

@literarymachine
Copy link
Contributor Author

When I try this, I get the 202 Accepted but do not see the notification being logged by the subscriber. Shouldn't it be that way?

Doh, I tested this by running the subscriber on https://test.skohub.io - it obviously cannot work when you run the subscriber locally, because the hub cannot POST to your local machine. We will have to think about a proper test setup, or even better yet implement a subscriber for lobid-gnd.

In the meantime, you can use https://test.skohub.io/deck/ to test subscriptions in the browser using WebSocket. Use wss://test.skohub.io as the hub URL and subscribe e.g. to http://test.lobid.org/gnd/118696432:

image

Then send a notification to the inbox of http://test.lobid.org/gnd/118696432:

$ curl -i -H "Content-Type: application/ld+json" "https://test.skohub.io/inbox?target=http://test.lobid.org/gnd/118696432" -d '{"foo": "bar"}'

And see it logged in the browser:

image

Copy link
Contributor

@fsteeg fsteeg left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This was also due to the Link headers, see 9f62eda for an updated README.

Great, with this the local setup works for this branch.

In the meantime, you can use https://test.skohub.io/deck/ to test subscriptions in the browser using WebSocket.

And this works too.

At this point @dr0i could enable hbz/lobid-resources#986 (comment), which we could also test with SkoDeck.

@literarymachine literarymachine merged commit 12287d8 into master May 15, 2019
SkoHub automation moved this from Review to Done May 15, 2019
@literarymachine literarymachine deleted the 10-deployTestServer branch May 15, 2019 10:47
@acka47 acka47 removed this from Done in SkoHub Oct 29, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants