Legacy-Research-Engine icon indicating copy to clipboard operation
Legacy-Research-Engine copied to clipboard

Setting up a server, where we can host documents to be displayed in the extension

Open blackforestboi opened this issue 8 years ago • 25 comments

There are some pages currently in the extension, that will be updated fairly often, like the FAQ or the contributions page. If we now want to update them, we have to update the tool and also the version number. This is rather unsuitable circumstance.

The idea is that we put those documents all on a server and then implement them into an iFrame inside the extension. And in case there is no internet connection, the page is just cached.


Want to back this issue? Post a bounty on it! We accept bounties via Bountysource.

blackforestboi avatar Nov 21 '16 18:11 blackforestboi

Let's set up an endpoint on AWS(or RedHat?). I can make a Python Flask app that delivers the pages.

bohrium272 avatar Nov 26 '16 14:11 bohrium272

cool. how would the versioning work then? Just uploading updated files via ftp?

blackforestboi avatar Nov 26 '16 14:11 blackforestboi

Yeah. The client side would be an iframe. We can change the HTML whenever we want.

bohrium272 avatar Nov 26 '16 14:11 bohrium272

perfect.

blackforestboi avatar Nov 26 '16 14:11 blackforestboi

I tried using raw html files from the repository in an iframe. Except for the header and the left navigation pane, everything was in an iframe. However that messed up the css and the javascript files so it was not displayed correctly. I think putting everything in the iframe is the way to go.

bohrium272 avatar Dec 06 '16 13:12 bohrium272

Does it automatically include the Css file? How would you be able to just separate the innerhtml from the raw file? did you create a new one or used the existing FAQ.html?

blackforestboi avatar Dec 07 '16 10:12 blackforestboi

In the current FAQ.html, I took all the code from the div at line 184 and put that into a new html file. I replaced that div in FAQ.html with an iframe linking it to the new html file. It broke the page. So I included all the CSS and JS files from FAQ.html into the new html file, it still didn't work properly. Hence finally, I took the whole page and put that into a new html and henceforth into an iframe.

bohrium272 avatar Dec 07 '16 11:12 bohrium272

and this way it works?

blackforestboi avatar Dec 07 '16 11:12 blackforestboi

Yes it does. screenshot from 2016-12-07 16-52-29

bohrium272 avatar Dec 07 '16 11:12 bohrium272

Cool :)

2 questions:

  1. Why are the inner boxes so crammed togethre?
  2. can we get rid of the visible frame surounding the iframe?

blackforestboi avatar Dec 07 '16 11:12 blackforestboi

and lastly. if we really make an iframe of the whole thing, we probably wont need an iframe. :) We could just load the whole page.

blackforestboi avatar Dec 07 '16 11:12 blackforestboi

Looks fine now? screenshot from 2016-12-07 17-02-20

bohrium272 avatar Dec 07 '16 11:12 bohrium272

What did you change?

Nope, not really ideal. Have you installed the plugin itself to see how it is looking now? There it is responsive so that its not too wide ad not too narrow.

blackforestboi avatar Dec 07 '16 11:12 blackforestboi

There's a frameborder property of iframe which if set to 0 shows no border around the iframe. Along with that, I remove the div with class col-md-8 to make the section fill the width. It still is responsive.

bohrium272 avatar Dec 07 '16 11:12 bohrium272

I put the col-md8 for a purpose of not being too wide. looks bad on even slightly bigger screens. My question was rather why it was so crammed together by just using the styles as they were. Why was it rendered that way on your screen? (Is it like that also with the current plugin?)

Also, as we use the whole page we might not have to use an iframe but rather a cache for the page, that is stored locally and as soon as a new update is available it would update it?

blackforestboi avatar Dec 07 '16 11:12 blackforestboi

(Is it like that also with the current plugin?)

can you make the screenshot for how the plugin looks on your screen? works also for chromium btw.

blackforestboi avatar Dec 07 '16 12:12 blackforestboi

screenshot from 2016-12-07 18-55-20

bohrium272 avatar Dec 07 '16 13:12 bohrium272

Sorry, I mean the current one. The version from the chrome app store.

blackforestboi avatar Dec 07 '16 13:12 blackforestboi

screenshot from 2016-12-07 19-04-12

bohrium272 avatar Dec 07 '16 13:12 bohrium272

Thanks :)

So why was the inner part so crammed before? Because of the iframe?

What happens if we now just link the whole page (https://cdn.rawgit.com/WorldBrain/Research-Engine/master/extension/assets/FAQ.html)? (Hint: i just tested opening the page, it then changes every link to be rendered by rawgit. which is suboptimal.

Also it somehow does not render the sidebar correctly :/

Seems like this approach is for now just a suboptimal work-around.

I think also for later purposes, having a server that can update these things is better. We might want to handle more data there as well. Gives us more flexibility. I have another few use cases for the server. For example to send out notifications to the extension. These notifications have to be entered somewhere anyway.

What do you think @arpitgogia ?

blackforestboi avatar Dec 07 '16 13:12 blackforestboi

If that's the case then let's go ahead with the server. It isn't much of a hassle.

So why was the inner part so crammed before? Because of the iframe?

Yes that's probably the reason.

bohrium272 avatar Dec 07 '16 14:12 bohrium272

ok good. Then the server it is:) Thanks for investigating!

blackforestboi avatar Dec 07 '16 14:12 blackforestboi

@dvigneshwer Ok what is missing here is:

  • [ ] set up on AWS as described in the "server"-repo
  • [ ] separate the inner part of the contribute.html page into a single HTML file
  • [ ] use this html file and put it into the extension as an iFrame

Important:

  1. Only the inner part of the contribute page should go into the iframe so without the sidebars, those should be the ones from the extension (the title can still be there)
  2. Make sure all the styles and formats stay the same as they are now. In our first try there was a lot of distortion.

blackforestboi avatar Dec 15 '16 12:12 blackforestboi

Adding to the discussion, we can use AWS CodeDeploy to automatically deploy a branch from a GitHub repository.

bohrium272 avatar Dec 15 '16 18:12 bohrium272