Kais DevBlog

More or less structred thoughts

Creating and using a self-signed certificate for local testing

Posted in Structr by Kai on Nov 13, 2021

Sometimes developing functionality requires our installation to have a valid certificate. There are many reasons, for example some JavaScript APIs are only available on HTTPS (for example navigator.mediaDevices - see the full list). This works on localhost because some, if not all, browsers have an exception for localhost. But if we want to connect our mobile phone to that installation we will be getting errors if the connection is not secure.

Read more
Fix SSL connection problems to remote servers

Posted in Structr by Kai on Aug 06, 2021

If you get an error when making a connection to a remote server (for example using $.GET()) with the following error message it might look that there is something wrong or malicious going on with the SSL certificate of the remote server.

PKIX path building failed:
sun.security.provider.certpath.SunCertPathBuilderException:
unable to find valid certification path to requested target

But maybe the SSL certificate is simply not included in the default java trust store. If you trust(!) the certificate there is a simple fix for this…

Read more
Launching FeedWorm

Posted in Structr by Kai on Apr 19, 2021

Most of the previous articles were created while building my new side-project FeedWorm. FeedWorm is a simple RSS reader application with notification functionality for feeds. Notifications can either be emails or Telegram messages.

The idea started when I failed to see a question in the StackOverflow tag "structr" and thought that it is kind of tedious to check that tag daily to know about questions. StackOverflow removed the functionality to get notified about new questions some time around introducing "Teams" which offers that functionality at a price. This is completely in their right and I'm not mad about that. I just thought "Well, Structr has a nice RSS feed integration and StackOverflow still offers the RSS feed, so why not create a simple app?". The feature creep started setting in and as I was having fun I added more and more features. 

There are still quite a few features I'd like to build but at a certain point you have to release an initial version or you'll never do. This is where we are right now. FeedWorm is based on TailwindCSS, has Telegram integration and also supports notifications via mail. Obviously it also has an SSL certificate from LetsEncrypt which gets updated automatically.

If you are interested, visist https://feedworm.com and see if you like it. Feedback is also very welcome on my twitter.

Integrating a Telegram Bot with Structr (Part 2 - WebHooks)

Posted in Structr by Kai on Apr 09, 2021

In part 1 of this article, we got the basic Telegram integration going. As it often goes, in the initial version the easiest approach was used and now that we know a bit more, we want to implement a better approach. We would like to use the WebHooks feature of the Telegram API. This reduces load on our server and we also don't spam their servers with requests. Luckily with Structr and our previous code this is pretty easy. We are basically 90% there. In this article we will enable WebHooks in our project and figure out the remaining 10%.

Read more
Server-sent Events in Structr Applications

Posted in Structr by Kai on Apr 02, 2021

One of my previous posts about communcation via a Telegram Bot reminded me that Structr also has support server-sent events using the EventSource interface. This enables us to push live updates to users with a few lines of JavaScript. In this post we will extend the example application from the previous post and create a small example with an auto-updating progress-bar using this pattern. With a little imagination we can adapt this basic example to more advanced scenarios. Let's get started...

Read more