IguanaCMS - The first ever CMS written in FreeBasic

User projects written in or related to FreeBASIC.
operator+
Posts: 40
Joined: Dec 29, 2021 10:47

Re: IguanaCMS - The first ever CMS written in FreeBasic

Post by operator+ »

I will revisit your project later when I switch to Linux. Windows is simply not for a web server. Windows 7 will be retired soon and I will switch to Linux but not Windows 10 nor 11. But not now. Good luck with your project. Bye.
Julcar
Posts: 141
Joined: Oct 19, 2010 18:52
Contact:

Re: IguanaCMS - The first ever CMS written in FreeBasic

Post by Julcar »

operator+ wrote:
Julcar wrote:Ok, if you see the text "main" is a good signal, that means that you are indeed executing index.exe, now make sure that sitelist.json is present in the same folder as index.exe and configured with the right base path (the folder where /data can be found).
Going to http://127.0.0.1/users/register.html I only saw 403 Forbidden. I followed your instructions so I have sitelist.json next to index.exe and it already points to the correct location.
Change in data/settings.json the property site_fancy_url from true to false, as tinyweb does not support url rewrite, this way your url will look as http://127.0.0.1/cgi-bin/index.exe?module=users
operator+
Posts: 40
Joined: Dec 29, 2021 10:47

Re: IguanaCMS - The first ever CMS written in FreeBasic

Post by operator+ »

Julcar wrote:
operator+ wrote:
Julcar wrote:Ok, if you see the text "main" is a good signal, that means that you are indeed executing index.exe, now make sure that sitelist.json is present in the same folder as index.exe and configured with the right base path (the folder where /data can be found).
Going to http://127.0.0.1/users/register.html I only saw 403 Forbidden. I followed your instructions so I have sitelist.json next to index.exe and it already points to the correct location.
Change in data/settings.json the property site_fancy_url from true to false, as tinyweb does not support url rewrite, this way your url will look as http://127.0.0.1/cgi-bin/index.exe?module=users
I was tempted to try again but your new link gives the same result. Only a blank page with the text main. I followed your instructions without any errors so it's my best. Yours is not ready to use outside of your very own computer. But I appreciate your efforts and patience.
caseih
Posts: 2157
Joined: Feb 26, 2007 5:32

Re: IguanaCMS - The first ever CMS written in FreeBasic

Post by caseih »

To be clear, the problem is not with IguanaCMS. It's with your Apache configuration. Something is misconfigured, and IguanaCMS isn't even being run, so IguanaCMS is clearly not the problem. Apache on Windows has always been a bit difficult compared to a native Unix environment. Perhaps there's a better, simpler web server designed to run on Windows that supports CGI that you could try.
Julcar
Posts: 141
Joined: Oct 19, 2010 18:52
Contact:

Re: IguanaCMS - The first ever CMS written in FreeBasic

Post by Julcar »

operator+ wrote:
Julcar wrote:
operator+ wrote: Going to http://127.0.0.1/users/register.html I only saw 403 Forbidden. I followed your instructions so I have sitelist.json next to index.exe and it already points to the correct location.
Change in data/settings.json the property site_fancy_url from true to false, as tinyweb does not support url rewrite, this way your url will look as http://127.0.0.1/cgi-bin/index.exe?module=users
I was tempted to try again but your new link gives the same result. Only a blank page with the text main. I followed your instructions without any errors so it's my best. Yours is not ready to use outside of your very own computer. But I appreciate your efforts and patience.
Definitivelly you're doing something wrong, because if you see the main word in a blank window then you can be sure about these facts:

1) tinyweb is executing properly index.exe
2) index.exe is sending that output after being executed
3) index.exe is unable to find the data folder

Let me explain what means that "main" string:
IguanaCMS creates the html output using a lot of tiny template snippets in sort of layers, the upper layer is the "main" snippet which calls the "content" layer which calls the "page" layer and so on, so if the main layer cannot be parsed, it fails gracefully but showing the text you see

I am suspecting you have the right base path in sitelist.json, but not converted to json string format (i.e. escaping slashes and/or backslashes)

Please paste your sitelist.json here
operator+
Posts: 40
Joined: Dec 29, 2021 10:47

Re: IguanaCMS - The first ever CMS written in FreeBasic

Post by operator+ »

caseih wrote:To be clear, the problem is not with IguanaCMS. It's with your Apache configuration. Something is misconfigured, and IguanaCMS isn't even being run, so IguanaCMS is clearly not the problem. Apache on Windows has always been a bit difficult compared to a native Unix environment. Perhaps there's a better, simpler web server designed to run on Windows that supports CGI that you could try.
We are talking about TinyWeb Server, not Apache.
operator+
Posts: 40
Joined: Dec 29, 2021 10:47

Re: IguanaCMS - The first ever CMS written in FreeBasic

Post by operator+ »

Julcar wrote:Please paste your sitelist.json here
Here you are:

Code: Select all

{
  "default_site" : {
    "default_base_path" : "C:\\other\\download"
  }
}
Julcar
Posts: 141
Joined: Oct 19, 2010 18:52
Contact:

Re: IguanaCMS - The first ever CMS written in FreeBasic

Post by Julcar »

operator+ wrote:
Julcar wrote:Please paste your sitelist.json here
Here you are:

Code: Select all

{
  "default_site" : {
    "default_base_path" : "C:\\other\\download"
  }
}
you have missing the final backslash, it should be:

Code: Select all

{
  "default_site" : {
    "default_base_path" : "C:\\other\\download\\"
  }
}
you can also place this html file as index.html in root folder

Code: Select all

<html>
  <head>
    <meta http-equiv="Refresh" content="1;url=cgi-bin/index.exe">
    <script type="text/javascript">
      window.location="cgi-bin/index.exe";
    </script>
  </head>
  <body>
  </body>
</html>
now your settings.json should look like this

Code: Select all

{
  "site_title" : "IguanaCMS" ,
  "site_description" : "Keep it simple, keep it light!" ,
  "site_keywords" : "" ,
  "site_url" : "http:\/\/127.0.0.1\/cgi-bin\/index.exe" ,
  "site_admin" : "Administrator" ,
  "site_email" : "contact@example.com" ,
  "site_encoding" : "windows-1252" ,
  "site_template" : "default" ,
  "site_language" : "en-US" ,
  "site_timezone" : 0 ,
  "site_index_type" : "page" ,
  "site_index_page" : "home" ,
  "site_index_module" : "users" ,
  "site_fancy_url" : false ,
  "site_fancy_url_extension" : ".html" ,
  "site_cache_mode" : "static" ,
  "site_uploads_path" : "uploads\/" ,
  "site_smtp_server" : "localhost"
}
Update: Also I noticed a little bug inside url creation function, make sure to update to this commit
operator+
Posts: 40
Joined: Dec 29, 2021 10:47

Re: IguanaCMS - The first ever CMS written in FreeBasic

Post by operator+ »

Finally I saw User Login. Thank you very much. I will start experimenting with it.
Julcar
Posts: 141
Joined: Oct 19, 2010 18:52
Contact:

Re: IguanaCMS - The first ever CMS written in FreeBasic

Post by Julcar »

operator+ wrote:Finally I saw User Login. Thank you very much. I will start experimenting with it.
I've just noticed something: Tinyweb also has a bug, a Set-Cookie header cannot co-exists with a Location Header, and that's just the way I manage users login, so, in order to bypass this you have to comment lines 183 and 217 in modules/users.bas (both lines sends a Location Header) and recompile
Julcar
Posts: 141
Joined: Oct 19, 2010 18:52
Contact:

Re: IguanaCMS - The first ever CMS written in FreeBasic

Post by Julcar »

Also, be prepared to find bugs regarding parameters in url leading to nowhere, to be honest almost 100% of my tests are with fancy urls activated, so now I am giving some time to fix these bugs, so stay tuned with my repo timeline.
operator+
Posts: 40
Joined: Dec 29, 2021 10:47

Re: IguanaCMS - The first ever CMS written in FreeBasic

Post by operator+ »

Julcar wrote:Also, be prepared to find bugs regarding parameters in url leading to nowhere, to be honest almost 100% of my tests are with fancy urls activated, so now I am giving some time to fix these bugs, so stay tuned with my repo timeline.
Not worth it. No one ever use TinyWeb as a serious thing. I will setup a Linux VM to try the real Apache (will be time consuming, don't expect instant feedback). I'm rather waiting for SCGI support.
operator+
Posts: 40
Joined: Dec 29, 2021 10:47

Re: IguanaCMS - The first ever CMS written in FreeBasic

Post by operator+ »

Have no idea but it failed to compile under Linux. On Windows it's no problems.

Code: Select all

test@devuan:~/test$ ./compile.sh
IguanaCMS Build Script
modules/publisher.bas(247) error 42: Variable not declared, HTTP_Open in 'HTTP_Open("POST", OAuth_GetProvider("api_url") + RequestEndPoint)'
modules/publisher.bas(249) error 42: Variable not declared, HTTP_SetTimeOuts in 'HTTP_SetTimeOuts()'
modules/publisher.bas(251) error 42: Variable not declared, HTTP_SetRequestHeader in 'HTTP_SetRequestHeader("Content-Type", "application/x-www-form-urlencoded; Charset=" + Settings(SITE_ENCODING))'
modules/publisher.bas(253) error 3: Expected End-of-Line, found 'HTTP_SetRequestHeader' in 'HTTP_SetRequestHeader("Authorization", OAuthHeader)'
modules/publisher.bas(255) error 42: Variable not declared, HTTP_Send in 'HTTP_Send(OAuth_GetRequestParams())'
modules/publisher.bas(257) error 42: Variable not declared, HTTP_GetResponseHeader in 'ResponseStatus = HTTP_GetResponseHeader("Status")'
modules/publisher.bas(286) error 3: Expected End-of-Line, found 'HTTP_Open' in 'HTTP_Open("POST", OAuth_GetProvider("api_url") + RequestEndPoint)'
modules/publisher.bas(288) error 3: Expected End-of-Line, found 'HTTP_SetTimeOuts' in 'HTTP_SetTimeOuts()'
modules/publisher.bas(290) error 3: Expected End-of-Line, found 'HTTP_SetRequestHeader' in 'HTTP_SetRequestHeader("Content-Type", "application/x-www-form-urlencoded; Charset=" + Settings(SITE_ENCODING))'
modules/publisher.bas(292) error 3: Expected End-of-Line, found 'HTTP_Send' in 'HTTP_Send(OAuth_GetRequestParams())'
modules/publisher.bas(292) error 133: Too many errors, exiting
Julcar
Posts: 141
Joined: Oct 19, 2010 18:52
Contact:

Re: IguanaCMS - The first ever CMS written in FreeBasic

Post by Julcar »

Yes, the linux compiler script is a bit outdated and needs to be fixed, what I need is some more spare time xD
operator+
Posts: 40
Joined: Dec 29, 2021 10:47

Re: IguanaCMS - The first ever CMS written in FreeBasic

Post by operator+ »

Julcar wrote:Yes, the linux compiler script is a bit outdated and needs to be fixed, what I need is some more spare time xD
This shouldn't be the build script. I think it's the code itself is not tested on Linux and to some extern being Windows only. I'm not sure, though.
Post Reply