Free CGI hosting for Lazarus binaries? lazarus / 38-Networking and Web Programming ---------------------------------------------------------------------- maurobio · 2023-06-23 01:09 Dear ALL, Can someone out there suggest a reliable free hosting service which offers CGI support for Lazarus binaries compiled under Linux? I have found a few searching Googly, but in the end (usually after a long registration process) I just discovered that the "CGI support"  offered by most free hosting services is for Perl scripts only. Thanks in advance! With best regards, ---------------------------------------------------------------------- PierceNg · 2023-06-23 01:34 Quote from: maurobio on June 23, 2023, 03:09:07 amCan someone out there suggest a reliable free hosting service which offers CGI support for Lazarus binaries compiled under Linux? Figure out how to use Docker and use free container hosting services by AWS, Azure, etc. ---------------------------------------------------------------------- Warfley · 2023-06-23 08:46 There are a few problems with hosting native CGI applications why this isn't provided often. First and most simply, security reasons. When hosting scripts like PHP or Perl you can configure the interpreter to just use a certain maximum amount of memory, be restricted to certain directories, only access to certain APIs, etc. The second problem is dependencies. Most native Linux applications have a set of dependencies, like a certain libc version, or other libraries like sqlite, and these often in specific versions. An application built on one system may not run on another system just because it runs Linux. It must have the correct versions of all the dependencies, and these versions may clash between different applications. So you also need a form of encapsulation here. This is why you usually don't have hosters providing you the ability to just push native applications onto their servers. What is used instead is as PierceNg has already wrote, that containerization is used. Here your application runs in a virtual environment, that you configure with all the required libraries and other dependencies, and that can be managed or deployed through software fetching from repositories like the docker hub. ---------------------------------------------------------------------- Leledumbo · 2023-06-23 09:35 Azure and AWS provide 12 months/750 hours burstable free vm instances, while Oracle and Google provides an always free tier (with limits, of course). Of course you must setup the VM to serve the CGI by yourself, it's unlike Perl CGI / PHP where many hostings provide preconfigured environment where all you need to do is upload your scripts. ---------------------------------------------------------------------- maurobio · 2023-06-23 11:34 Hi, @PierceNg, @Warfley, @Leledumbo! Thanks for your answers. I have used old & good CGI protocol for about thirty years, so I am aware of its cons, but also of its pros (simplicity foremost amongst them). Perhaps I still dwell in the sweet pioneering illusions of the early Web, where everything was simpler. Please don't be shocked, but until the suggestion by PierceNg I had never heard of "Docker"! I took a quick look at it - the concept seems truly interesting, but I much doubt that I would have the time, the patience, and the brains (not necessarily in that order!) to "figure out" how to use it and then spent yet more time with AWS, Azure, etcetera! I would like just an old-fashioned server providing support for simple CGI scripts as binary executables. Notice that many free web hosting services claim that they offer such support, but in practice they don't - HelioHost.org is an honourable exception, but nowadays it is quite difficult to earn free space there (not too mention that it now offer only the horrible Plesk as its control panel!). Anyway, I am already struggling - although with most rewarding results  - to develop Android apps using LAMW to spent my time with older things. Life is short. With best regards, ---------------------------------------------------------------------- domasz · 2023-06-23 12:50 Get yourself a cheap VPS and then you can install anything you want, including fpc. ---------------------------------------------------------------------- maurobio · 2023-06-23 13:04 Hi, @domasz! "Cheao" for me should be equal to "gratis"! Best regards, ---------------------------------------------------------------------- domasz · 2023-06-23 13:23 You can also install server software on your own computer ---------------------------------------------------------------------- rvk · 2023-06-23 13:24 You didn't really elaborate about the use case but you could consider hosting it yourself. A simple server (raspberry pi or something else) on your own local network with one http(s) port forwarded to that server. You could make it as simple as you like and use a DNS server (like duckdns.org) to create a static domain-name. (https://maurobio.duckdns.org) Maybe you already thought of this and dismissed it but I thought it worth mentioning. (Ha, domasz just beat me to it  ) ---------------------------------------------------------------------- maurobio · 2023-06-23 13:33 Hi, @domasz, @rvk! I of course run a local server (currently, WampServer for Windows) but it is only for test purposes. I cannot keep a local server at home running 24x7, this is out of question! Best regards, ---------------------------------------------------------------------- rvk · 2023-06-23 13:35 I understand that you don't want a Windows machine 24/7 powered on. But a raspberry pi is very doable and power efficiënt. I don't think there are many other options (especially not free and reliable). ---------------------------------------------------------------------- maurobio · 2023-06-23 13:48 Hi, @rvk! QuoteI don't think there are many other options (especially not free and reliable). Other than someone donating space on an adequate server, I also don't think there are many options remaining. I am playing with the idea of porting my old CGI program as an Android app, in which all code will run on the device and therefore no web server will be required. It is a simple program anyway, which just provides a "mashup" of querying different online databases and returning the results as an HTML page. Best regards, ---------------------------------------------------------------------- BeniBela · 2023-06-23 14:28 If it is open-source, you can host it on Sourceforge I wrote this in FPC for XPath testing: https://www.videlibri.de/cgi- bin/xidelcgi Quote from: Warfley on June 23, 2023, 10:46:21 amThere are a few problems with hosting native CGI applications why this isn't provided often. First and most simply, security reasons. When hosting scripts like PHP or Perl you can configure the interpreter to just use a certain maximum amount of memory, be restricted to certain directories, only access to certain APIs, etc. My site is really risky. It evaluates the XPath, the user uploads. XPath is Turing-complete. Even without hacking, the user can run arbitrary code on the server. And XPath can load arbitrary files. I blocked the Xpath file loading functions, but I just noticed I forgot to  block the json loading function. (because it is new. When I blacklisted the functions, it did not exist). So the user could open any file on the server. Good thing, he would get an error message, "this file is not a json file". Bad thing, it would show the first line,  "this file is not a json file because of that character in this line".... Now I have found a way to disable the file  access functions in the RTL:  https://github.com/benibela/xidel/blob/master/xidelcgi.lpr#L435-L479 That should be secure, even if someone manages to call something ---------------------------------------------------------------------- maurobio · 2023-06-23 14:38 Hi, @BeniBela! QuoteIf it is open-source, you can host it on Sourceforge My project is completely free and open source, distributed with a GNU License. But I didn't know SourceForge (where I have had an account for almost twenty years now, but rarely use since the advent of GitHub) provided support for CGI programs! Could you please elaborate? Thanks a lot! With best regards, ---------------------------------------------------------------------- rvk · 2023-06-23 14:42 Quote from: BeniBela on June 23, 2023, 04:28:38 pmIf it is open- source, you can host it on Sourceforge Nope. Not FPC CGI. https://sourceforge.net/p/forge/documentation/Project%20Web%20and%20De veloper%20Web/ QuoteThe project web services support the following CGI languages: Perl Python Tcl (tclsh) Shell scripts Compiled CGI scripts are allowed, but are not supported.I assume they mean compiled Perl etc. And not compiled FPC (because that's not a scripting language). ---------------------------------------------------------------------- BeniBela · 2023-06-23 16:33 Quote from: maurobio on June 23, 2023, 04:38:56 pm But I didn't know SourceForge (where I have had an account for almost twenty years now, but rarely use since the advent of GitHub) provided support for CGI programs! Could you please elaborate? Each project gets a webspace, where you can upload anything Quote from: rvk on June 23, 2023, 04:42:57 pmI assume they mean compiled Perl etc. And not compiled FPC (because that's not a scripting language). They mean anything compiled ---------------------------------------------------------------------- rvk · 2023-06-23 17:18 Quote from: BeniBela on June 23, 2023, 06:33:35 pmQuote from: rvk on June 23, 2023, 04:42:57 pmI assume they mean compiled Perl etc. And not compiled FPC (because that's not a scripting language). They mean anything compiled If that's true then I wonder if a CGI van overcome this limitation? QuoteOutbound connectivity Due to past abuse, outbound access to other hosts from the web servers is strictly prohibited and is blocked by firewall rules. This includes access to other SourceForge.net hosts; the only exception to this policy is access to our project database servers. SCM server access is not available from the project web servers. Any content needed from other SourceForge.net hosts should be retrieved and stored as a file or database entry that may then be accessed from scripts on the project web servers. (And I understand TS wants to gather info from other sources) ---------------------------------------------------------------------- domasz · 2023-06-23 17:26 Quote from: Warfley on June 23, 2023, 10:46:21 amThe second problem is dependencies. Most native Linux applications have a set of dependencies, like a certain libc version, or other libraries like sqlite, and these often in specific versions. Here's a crazy idea that I actually used successfully on Debian- compiling the program in Lazarus for Windows and then using Wine on Debian to run it. ---------------------------------------------------------------------- maurobio · 2023-06-23 17:52 Hi, @BenBela! QuoteEach project gets a webspace, where you can upload anything I surely know this, I have still several pages hosted there! What surprised me is that they would allow the use of compiled CGI programs as binary executables (they don't). Also, my application is a mashup, is collates data from several public online biodiversity databases and presents the results to the user in a single page; I doubt the security-concerned boys at SourceForge would allow this (even if the data sources I use are all public and don't pose any 'security risks'; but the Web of today is a world of paranoia and evil...) Best regards, ---------------------------------------------------------------------- delphius · 2023-06-26 14:59 Quote from: maurobio on June 23, 2023, 07:52:20 pmmy application is a mashup, is collates data from several public online biodiversity databases and presents the results to the user in a single page I registered a free account on the first available free hosting service, which supports executing Perl and CGI scripts, at https://freehostingnoads.net/ I signed up, obtained the hosting, and took a free domain at http://delphius.atwebpages.com/. I created a test Perl script, it works http://delphius.atwebpages.com/index.html And then I made a "Hello, World!" free pascal app and cross-compiled it for Linux. I placed it next to the Perl script. You can find it at http://delphius.atwebpages.com/test.cgi. Everything is working fine  Either I don't fully understand the task, or someone is unnecessarily dramatizing the situation. Please don't consider it as an advertisement, but I genuinely clicked on the first available hosting service that provides the required services. ---------------------------------------------------------------------- maurobio · 2023-06-26 15:10 Ave, @delphius!!! Quam tu?. Great, I will take a look at that ASAP! Sure, you did understand the problem and solved it nicely! "One does need an elephant when just a horse suffices to reach the nearest town". (I presume you understand what I mean  ). Gratus! With warmest regards, ---------------------------------------------------------------------- maurobio · 2023-06-26 21:02 Hi, @delphius! Unfortunately, I have yet not even the opportunity to test any CGI program in that free hosting server because, after completing the registration process, I got the error message: Quote(0x060) There is a problem at the moment! Please try again later I did not received any verification/activation email as should be expected. When I "tried again later", I restarted the registration process, filling-up the required fields, but then I have been presented with a screen saying that: Quote It appears that your are already a member! Due to the large volume of signups we only allow one free account per user. 1. If you still wish to host your site with us, please choose a paid hosting plan or buy a domain with the free plan! 2. If you have forgotten your account password, please use our lost password tool. 3. If you feel that this message is an error, and you do not have an account with us, please contact our support team. I then went back to the registration screen and there I found a link saying that "If you already have an account with us click here". When I "clicked there", I filled-up my email and password and then the message below appeared: QuoteThe user you have specified does not exist. So, I feel like Schrödinger's cat, existing and not existing at the same time as a registered user of that hosting service! Perhaps it is not necessary to remark that there are no "lost password tool" anywhere in that website. With warmest regards, ---------------------------------------------------------------------- delphius · 2023-06-27 03:30 Quote from: maurobio on June 26, 2023, 11:02:37 pmafter completing the registration process, I got the error message: Some kind of mysticism. The whole registration process from finding the right site to the moment when I started uploading the script to the hosting took about three minutes ---------------------------------------------------------------------- Thaddy · 2023-06-27 08:53 If it is just for development I can create a subdomain for you that supports 64 bit - linux cgi binaries at http://thaddy.org . It is http only, but for testing cgi's that is perfectly reasonable. My https sites are not on the same server. For permanent hosting - where you need https -this is not suitable. But feel free to ask if it is just for experiments. I can also setup a database for you:progress or mariadb. ( note https is possible to test with a self-signed certificate that you have to accept in your key chain and I will provide ) This particular server is my test server and rather isolated from anything else. Only access is through certificate, not password, for (s)ftp and ssh access. The server drops any password access attempts > /dev/null... ---------------------------------------------------------------------- maurobio · 2023-06-27 11:06 Ave, @delphius! QuoteSome kind of mysticism By Jove, it may be! Best regards, ---------------------------------------------------------------------- maurobio · 2023-06-27 11:15 Hi, @Thaddy! QuoteIf it is just for development I can create a subdomain for you that supports 64 bit - linux cgi binaries Thanks a lot for your kind offer, but I will have to decline because I am looking for a server where I can host my application on a more or less permanent basis, open to use by anyone. For development I already use a WAMP/LAMP local server. That said, my application is just a simple (although hundred of lines long) old-style CGI program which takes a biological species name and fetches data from several online biodiversity databases, presenting them in a single page for a quick-and-dirty look at what data is available for the target species (see attached image). The program does not use any database on the server (MySQL, MariaDB, etc.) and the full source code will be available on my GitHub repository as soon as I finish some needed polishing and documentation of the code. With warmest regards, ---------------------------------------------------------------------- delphius · 2023-06-27 17:30 Quote from: maurobio on June 27, 2023, 01:06:45 pmBy Jove, it may be! in my opinion, miracles certainly happen, but quite rarely. I wrote to you in pm, may be it will help. ---------------------------------------------------------------------- maurobio · 2023-06-27 20:42 Ave, @delphius! Quotein my opinion, miracles certainly happen, but quite rarely. Otherwise, they would be "miracles"!  QuoteI wrote to you in pm, may be it will help. Thank you very much!  With warmest regards,