Recent

Author Topic: Free CGI hosting for Lazarus binaries?  (Read 4957 times)

maurobio

  • Hero Member
  • *****
  • Posts: 640
  • Ecology is everything.
    • GitHub
Free CGI hosting for Lazarus binaries?
« on: June 23, 2023, 03:09:07 am »
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,
UCSD Pascal / Burroughs 6700 / Master Control Program
Delphi 7.0 Personal Edition
Lazarus 3.8 - FPC 3.2.2 on GNU/Linux Mint 19.1/20.3, Windows XP SP3, Windows 7 Professional, Windows 10 Home

PierceNg

  • Sr. Member
  • ****
  • Posts: 425
    • SamadhiWeb
Re: Free CGI hosting for Lazarus binaries?
« Reply #1 on: June 23, 2023, 03:34:09 am »
Can 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

  • Hero Member
  • *****
  • Posts: 2039
Re: Free CGI hosting for Lazarus binaries?
« Reply #2 on: June 23, 2023, 10:46:21 am »
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

  • Hero Member
  • *****
  • Posts: 8835
  • Programming + Glam Metal + Tae Kwon Do = Me
Re: Free CGI hosting for Lazarus binaries?
« Reply #3 on: June 23, 2023, 11:35:34 am »
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

  • Hero Member
  • *****
  • Posts: 640
  • Ecology is everything.
    • GitHub
Re: Free CGI hosting for Lazarus binaries?
« Reply #4 on: June 23, 2023, 01:34:19 pm »
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  :D - to develop Android apps using LAMW to spent my time with older things. Life is short.

With best regards,
UCSD Pascal / Burroughs 6700 / Master Control Program
Delphi 7.0 Personal Edition
Lazarus 3.8 - FPC 3.2.2 on GNU/Linux Mint 19.1/20.3, Windows XP SP3, Windows 7 Professional, Windows 10 Home

domasz

  • Hero Member
  • *****
  • Posts: 617
Re: Free CGI hosting for Lazarus binaries?
« Reply #5 on: June 23, 2023, 02:50:05 pm »
Get yourself a cheap VPS and then you can install anything you want, including fpc.

maurobio

  • Hero Member
  • *****
  • Posts: 640
  • Ecology is everything.
    • GitHub
Re: Free CGI hosting for Lazarus binaries?
« Reply #6 on: June 23, 2023, 03:04:07 pm »
Hi, @domasz!

"Cheao" for me should be equal to "gratis"!

Best regards,
UCSD Pascal / Burroughs 6700 / Master Control Program
Delphi 7.0 Personal Edition
Lazarus 3.8 - FPC 3.2.2 on GNU/Linux Mint 19.1/20.3, Windows XP SP3, Windows 7 Professional, Windows 10 Home

domasz

  • Hero Member
  • *****
  • Posts: 617
Re: Free CGI hosting for Lazarus binaries?
« Reply #7 on: June 23, 2023, 03:23:31 pm »
You can also install server software on your own computer

rvk

  • Hero Member
  • *****
  • Posts: 6948
Re: Free CGI hosting for Lazarus binaries?
« Reply #8 on: June 23, 2023, 03:24:06 pm »
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  :D )

maurobio

  • Hero Member
  • *****
  • Posts: 640
  • Ecology is everything.
    • GitHub
Re: Free CGI hosting for Lazarus binaries?
« Reply #9 on: June 23, 2023, 03:33:22 pm »
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,
UCSD Pascal / Burroughs 6700 / Master Control Program
Delphi 7.0 Personal Edition
Lazarus 3.8 - FPC 3.2.2 on GNU/Linux Mint 19.1/20.3, Windows XP SP3, Windows 7 Professional, Windows 10 Home

rvk

  • Hero Member
  • *****
  • Posts: 6948
Re: Free CGI hosting for Lazarus binaries?
« Reply #10 on: June 23, 2023, 03:35:44 pm »
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

  • Hero Member
  • *****
  • Posts: 640
  • Ecology is everything.
    • GitHub
Re: Free CGI hosting for Lazarus binaries?
« Reply #11 on: June 23, 2023, 03:48:17 pm »
Hi, @rvk!

Quote
I 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,
UCSD Pascal / Burroughs 6700 / Master Control Program
Delphi 7.0 Personal Edition
Lazarus 3.8 - FPC 3.2.2 on GNU/Linux Mint 19.1/20.3, Windows XP SP3, Windows 7 Professional, Windows 10 Home

BeniBela

  • Hero Member
  • *****
  • Posts: 958
    • homepage
Re: Free CGI hosting for Lazarus binaries?
« Reply #12 on: June 23, 2023, 04:28:38 pm »
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

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.


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

  • Hero Member
  • *****
  • Posts: 640
  • Ecology is everything.
    • GitHub
Re: Free CGI hosting for Lazarus binaries?
« Reply #13 on: June 23, 2023, 04:38:56 pm »
Hi, @BeniBela!

Quote
If 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,
UCSD Pascal / Burroughs 6700 / Master Control Program
Delphi 7.0 Personal Edition
Lazarus 3.8 - FPC 3.2.2 on GNU/Linux Mint 19.1/20.3, Windows XP SP3, Windows 7 Professional, Windows 10 Home

rvk

  • Hero Member
  • *****
  • Posts: 6948
Re: Free CGI hosting for Lazarus binaries?
« Reply #14 on: June 23, 2023, 04:42:57 pm »
If it is open-source, you can host it on Sourceforge
Nope. Not FPC CGI.


https://sourceforge.net/p/forge/documentation/Project%20Web%20and%20Developer%20Web/

Quote
The 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).
« Last Edit: June 23, 2023, 04:47:08 pm by rvk »

 

TinyPortal © 2005-2018