Skip to content

OGProxy - a replacement for iFramely

Announcements
  • Hi all,

    Iโ€™ve been working on a self-coded replacement for iFramely, and I now have a workable solution that

    • Is able to bypass CORS restrictions
    • Gets data as the client, so zero server load
    • Gets as close to iFramely hosted in terms of look and feel
    • Uses a cors-proxy with cache, so any data held in cache is used before the browser makes any requests
    • Super fast
    • Uses 100% proprietary code written by Phenomlab
    • Most importantly, itโ€™s completely FREE.

    Itโ€™s not perfect, and has some bugs (youโ€™ll no doubt see these pop up from time to time) - but itโ€™s working at around 97%, and active on this forum (yes, itโ€™s running in PROD ๐Ÿ™‚ )

    Hereโ€™s the CORS proxy running with node-cache

    465b6344-7772-4750-bdb4-f66a134e1c19-image.png

    Hereโ€™s what the unfurled links look like

    d4bf4eb9-cdf2-429c-90e7-9d0adc932d4a-image.png

    Itโ€™ll inherit the CSS of your site (potentially - you might have to make some minor changes).

    You can see it in action by just visiting posts that have an external URL in them. A good example is this link

    https://sudonix.org/topic/138/ai-a-new-dawn-or-the-demise-of-humanity

    I know most members here want this, so decided to write my own ๐Ÿ™‚ Itโ€™s not quite โ€œreadyโ€ yet, but will be soon.

    Any takers?

  • OMG Mark
    Very cool result. I take it for sure at 100% ;l
    If you want to test it on another Platforms or help for anythings, lโ€™m hรจreโ€ฆ

  • @DownPW I can provide advance code for testing, but itโ€™s subject to some refactoring. Up to you, but first come, first served, and I only want a limited amount of testers for obvious reasons whilst itโ€™s in Alpha.

  • No problem

  • Mark i m always here as you know ๐Ÿ™‚

  • Something of an updateโ€ฆ

    Iโ€™ve been looking at the overall design for the CORS proxy again today - perhaps with a fresher perspective (and less tired eyes) and found several ways to improve the overall efficiency of the proxy itself.

    I also changed the code base so it will now require the generation of an API key (donโ€™t worry too much about this as there are tons of generators online that can easily convert a phrase to either a sha256 (preferred) or md5 hash. You simply copy this key and place it in both the proxy server and in the custom js code in NodeBB, restart the proxy service, and youโ€™re good to go.

    I suspect youโ€™re wanting to know how the proxy part worksโ€ฆ This is a relatively simple nodeJS based server that runs as a daemon (using systemd) which takes input from the js code and processes it as if it were a GET request from a browser - in short, it collects OpenGraph (og) data from the target URL and then returns that data back to the js function which then creates a div block based on the bootstrap card element containing the information about the website - typically title, description, image and url which is the used to render the preview card.

    Iโ€™ve switched development of the newer proxy to dev so it doesnโ€™t impact production. As soon as this is ready, the current version running on this site will be replaced.

    Once final testing is completed, I will be in a position to provide an installation guide so you can try this out for yourselves.

    For info, the proxy will not render preview links pointing to your own domain by design. Iโ€™d recommend you leave it that way otherwise youโ€™ll encounter issues with performance and odd artefacts that arenโ€™t rendered properly because the lookup failed. Iโ€™ll be placing a check inside the code that ignores links that have the origin of your own domain.

    Finally, Iโ€™d recommend setting up a subdomain for the proxy service to run under. Itโ€™s cleaner, easier to manage, and will run independent of the root domain where your NodeBB instance runs. A simple nginx reverse proxy is required, and I will provide this as part of the guide.

  • @julian has just released nodebb-plugin-link-preview which might be a better fit depending on your needs. I will continue development for this solution though as it performs all requests client-side.

  • @phenomlab

    I have installed the first version published
    After a few tests, I have quite random results but the solution has the advantage of being easy to use

  • @DownPW Yes, thatโ€™s true, but I donโ€™t think itโ€™s as efficient. Iโ€™ve looked at the library being used in more detail last night, and whilst I like the approach, it has some nuances where I think performance could be an issue.

  • Another quick update. Julianโ€™s image preview plugin has gone though numerous iterations and now appears to work very well.

    However, there are some limitations from what I can see, given that the NodeBB plugin works server side. The implementation I am working on runs client side, and is extremely quick.

    Iโ€™ve chosen to use an existing library as this made more sense than effectively reinventing the wheel. This one is updated frequently (in fact yesterday was the last update) so less of a concern from the longevity perspective.

    I expect to have a fully functional beta available in the coming days. If you want to see progress around the latest code, this is available and running on https://sudonix.dev.

  • @phenomlab said in Potential replacement for iFramely:

    and now appears to work very well.

    Are you sure ๐Ÿ˜† After One hour !!

    fa4e9a3f-12ed-41cb-8c86-aae5c0934f59-image.png

  • your solution working fine. It should be as simple to implement as Julianโ€™s plugin and it would be perfect ^^

  • @DownPW yes, mine is doing the same now.

  • @DownPW itโ€™s not going to be a plugin as it requires itโ€™s own reverse proxy in a sub domain as I mentioned previously and everything is client side so a plugin would be pointless as it has no settings - only custom JS code.

  • I have literally one bug (a simple one) to resolve, then clean up the code and restyle done of the elements (@DownPW is right in the sense that they are a bit big ๐Ÿคฆ) and itโ€™s ready for testing.

    In reality, I expect this to work almost flawlessly on other user forums as the code has been though several iterations to ensure itโ€™s both lean and efficient. If you test it in sudonix.dev youโ€™ll see what I mean. I found an ingenuous way to extract the favicon - believe it or not, despite the year being 2023, web site owners donโ€™t understand how to structure meta tags properly ๐Ÿคฌ๐Ÿคฌ.

    I learned today that Google in fact has a hidden API that you can use to get the favicon from any site which not only works flawlessly, but itโ€™s extremely efficient and so, Iโ€™m using it in my code - pointless reinventing the wheel when you donโ€™t have to.

    The final โ€œbugโ€ isnโ€™t really a โ€œbugโ€ in the traditional sense. In fact, its nothing to do with my code, but one specific variable I look for in the headers of each URL being crawled is

    ogSiteName
    

    The โ€œogโ€ part is short for OpenGraph - an industry standard for years, yet often missing in headers. This has the undesired effect of returning undefined when it doesnโ€™t exist, meaning reviews look like this

    Screenshot_2023-06-11-22-40-27-43_e4424258c8b8649f6e67d283a50a2cbc.jpg

    Notice the โ€œundefinedโ€ text where the site title will be - that looks bad, to Iโ€™ll likely replace the with the domain name of the site of the title is missing.

    Seriously, if you havenโ€™t tested this out yet, if suggest to do so on sudonix.dev as soon as you can.

    Currently, this site is running nodebb-plugin-link-previews but will be switching to my client side version in the coming days.

    As soon as itโ€™s running here, Iโ€™ll release the code and a guide.

  • @phenomlab said in Potential replacement for iFramely:

    believe it or not, despite the year being 2023, web site owners donโ€™t understand how to structure meta tags properly ๐Ÿคฌ๐Ÿคฌ.

    Ha ha I believe you !!

    @phenomlab said in Potential replacement for iFramely:

    Notice the โ€œundefinedโ€ text where the site title will be - that looks bad, to Iโ€™ll likely replace the with the domain name of the site of the title is missing.

    yep be clearly better with domain name when OpenGraphi when he is absent in headers

    @phenomlab said in Potential replacement for iFramely:

    Seriously, if you havenโ€™t tested this out yet, if suggest to do so on sudonix.dev as soon as you can.

    Already tested, very fast ๐Ÿ˜‰

    @phenomlab said in Potential replacement for iFramely:

    Currently, this site is running nodebb-plugin-link-previews but will be switching to my client side version in the coming days.

    As soon as itโ€™s running here, Iโ€™ll release the code and a guide.

    Hell yeah ๐Ÿ˜‰

  • Ok, spent some time on this late last night, and the good news is that itโ€™s finished, and ready for you to try out.

    Please do remember that this isnโ€™t a plugin, but a client side js function with a server side proxy. However, donโ€™t be put off as the installation is simple, and you should be up and running in around 30 minutes maximum.

    It does require some technical knowledge and ability, but if youโ€™ve setup NodeBB, then you can do this easily - besides, there will be full documentation so you are taken through each step.

    Some other points to note are that not every site returns valid Open Graph data - in fact, some donโ€™t even return an image (yes, Reddit, Iโ€™m taking about you) when they are closed to the public, or behind a registration form / membership grant, or in some cases, a paywall.

    When this scenario is met, the problem arises that no valid image is being returned. I did toy with the idea of using a free random image API , and even wrote the code for it - then realised nature scenery didnโ€™t quite align with a tech site like Reddit.

    Ok - the only thing to do here is to generate your own image then, and bundle that in with the proxy. For this purpose, I chose an image (I have a subscription to stockphotosecrets.com, which is an annual cost to me. Iโ€™ve cancelled the subscription as I donโ€™t use it, but provided I downloaded the image before the term expires, I have the right to use any images after the fact) and then added some text parts to it so that it could then be used as a placeholder for when the image is absent.

    Hereโ€™s that image

    404.webp

    Itโ€™s sparse, but functional. And given my comment earlier around membership and paywalls, hereโ€™s what that specific scenario would look like when encountered

    Screenshot_2023-06-12-22-37-11-58_e4424258c8b8649f6e67d283a50a2cbc.jpg

    Before I go ahead and provide the documentation, code, and proxy server, Iโ€™d recommend you try out the latest code on sudonix.dev.

    Enjoy.

  • Mark could you please install to my site also?

  • @cagatay Let me put the guide together first, and see if you can get it working by yourself. Itโ€™s not a difficult installation, and once you understand how the components intersect and work together, I think youโ€™ll be fine. If the worst comes to it however, Iโ€™m always happy to help.

  • UPDATE: OGProxy is now live on this forum ๐Ÿ™‚

    https://sudonix.org/topic/498/setup-ogproxy-for-use-in-nodebb


Related Topics
  • Ch..ch..ch..ch..changes!

    Announcements
    16
    15 Votes
    16 Posts
    230 Views

    @phenomlab of course, to be recognised is fantastic.

    @phenomlab said in Ch..ch..ch..ch..changes!:

    Sadly, no. Web crawlers and scrapers are often JS based and read text only, so styles donโ€™t have any bearing.

    Iโ€™ve read mixed things about this, but no that does make sense, it was something I read a many years back when using Wordpress.

  • Planned sunset of NTFY plugin

    Pinned Announcements
    7
    8 Votes
    7 Posts
    189 Views

    Iโ€™ve noticed that Iโ€™m the only one subscribed to the push notifications on this site. If you were using NTFY previously, and have noticed that youโ€™ve not had any alerts for a while, itโ€™s because this feature has been disabled.

    Youโ€™ll now need to use the push notification to replace NTFY as mentioned in the first post.

  • ANNOUNCEMENT: Social Login Changes

    Announcements
    4
    6 Votes
    4 Posts
    467 Views

    @DownPW Always looking for ways to improve the overall experience.

  • ANNOUCEMENT: New NTFY Server

    Announcements
    9
    7 Votes
    9 Posts
    712 Views

    @crazycells thatโ€™s as good a test as any ๐Ÿ™‚

  • IMPORTANT: Theme / Swatch changes

    Announcements
    4
    6 Votes
    4 Posts
    287 Views

    @cagatay these changes arenโ€™t published anywhere presently, so nothing for you to do.

  • Theme retirement

    Announcements
    21
    16 Votes
    21 Posts
    1k Views

    I relented somewhat here and added another swatch - one I missed, which was previous called โ€œblackoutโ€. This specific one has been adapted to work on the new theming engine, but the others have been reclassified, and renamed to suit.

    image.png

    As a result, the theme you might have had will probably be reflecting something else, so you (might) need to change your themes accordingly. The changes are as follows

    Light -> No Change
    Cloudy -> Is now the old โ€œDimโ€
    Dim -> Is now the old โ€œDarkโ€
    Dark -> Now a new theme based on the revamped โ€œBlackoutโ€

  • Link Not Working

    Solved Customisation
    5
    1 Votes
    5 Posts
    279 Views

    @cagatay Good question, but one thatโ€™s likely best answered by the devs themselves. Could easily be done with a simple jQuery regex but that would really just be painting over rotten wood.

  • Testing out Webdock.io

    Moved Announcements
    2
    5 Votes
    2 Posts
    544 Views

    Just coming back to this thread for review (as I often do), and it looks like Webdock have increased their available offerings - some are extremely powerful, yet very competitive from the pricing perspective.

    image.png

    10 CPU cores, plus 20Gb RAM? Well worth a look (and the asking price) - thereโ€™s also a fixed IP which is hugely beneficial.

    Clearly, this is well beyond what most people will want to spend - itโ€™s more of an example (but interestingly, Sudonix runs on something not too different from the above).

    However, not all that glitters is gold ๐Ÿ˜• - just have a walk through the benchmark report I found below and youโ€™ll see a huge difference between Heztner and Webdock

    https://www.vpsbenchmarks.com/compare/hetzner_vs_webdock

    That being said, the amount of HTTP requests that Webdock handles in relation to Hetzner is superior - @DownPW you might want to have a look at this - thereโ€™s a free 24 hour trialโ€ฆ ๐Ÿ™‚

    5203639b-2f62-47e6-b87b-37580ce5deae-image.png