Web GUI folder configuration

Installation and configuration.
nospitters
Posts: 8
Joined: Sat Apr 10, 2021 12:31 pm

Web GUI folder configuration

Post by nospitters »

hi,

with default settings the web UI browser access is like that
http://127.0.0.1:51000

but i want something like that:
http://127.0.0.1:51000/MyWebGui

how to setup such a folder-structure? (in apache i would create an alias in the config...)
User avatar
timurhai
Site Admin
Posts: 911
Joined: Sun Jan 15, 2017 8:40 pm
Location: Russia, Korolev
Contact:

Re: Web GUI folder configuration

Post by timurhai »

Hi!
I can't check it right now, but whether some custom GUI works not on:
http://127.0.0.1:51000/MyWebGui/my_index.html ?

If it works, you are asking for afserver to provide some index.html, if just folder specified?
Timur Hairulin
CGRU 3.3.1, Ubuntu 20.04, 22.04, MS Windows 10 (clients only).
nospitters
Posts: 8
Joined: Sat Apr 10, 2021 12:31 pm

Re: Web GUI folder configuration

Post by nospitters »

i refer to afserver and its configuration in "../afanasy/config_default.json".
afserver always looks into "../afanasy/browser/index.html" (hardcoded?) and sets this as a httpd root-directory...
i.e. if i move the "browser" folder to other location like "..MyWebGui/browser/", i cant define "../MyWebGui/" as a httpd root directory, so that in firefox the adress looks like "http://server_ip/browser/"...hope its clear what i mean...
User avatar
timurhai
Site Admin
Posts: 911
Joined: Sun Jan 15, 2017 8:40 pm
Location: Russia, Korolev
Contact:

Re: Web GUI folder configuration

Post by timurhai »

Aserver httpd root folder is the entire CGRU root folder, and can't be other, as some scripts and icons are global (used by various cgru tools, not only web gui).
If get request is empty it returns /afanasy/browser/index.html - this is hardcoded, but it is not a big deal to make it configurable.
But the entire root folder is configurable:
https://github.com/CGRU/cgru/blob/maste ... t.json#L13
Timur Hairulin
CGRU 3.3.1, Ubuntu 20.04, 22.04, MS Windows 10 (clients only).
nospitters
Posts: 8
Joined: Sat Apr 10, 2021 12:31 pm

Re: Web GUI folder configuration

Post by nospitters »

i see...
my intension was to serve the WebGui over the internet, so users can reach the WebGui in a browser-adress like "http://www.host.com:51000/WebGui/index.html"
and NOT "http://www.host.com:51000", since "host.com" has also several internet pages to show...
User avatar
timurhai
Site Admin
Posts: 911
Joined: Sun Jan 15, 2017 8:40 pm
Location: Russia, Korolev
Contact:

Re: Web GUI folder configuration

Post by timurhai »

Now i does not see... ))
Why now you can't use http://www.host.com:51000/WebGui/index.html ?
Timur Hairulin
CGRU 3.3.1, Ubuntu 20.04, 22.04, MS Windows 10 (clients only).
nospitters
Posts: 8
Joined: Sat Apr 10, 2021 12:31 pm

Re: Web GUI folder configuration

Post by nospitters »

???
i think we misunderstood...

i try to explain:
by default the Web Interface is configured that it looks to "../afanasy/browser/index.html", wich is the dokument root of the WebGui...
this is mapped for a internet-browser so that the adress looks like "http://www.host.com:51000"
when i change the "af_http_serve_dir" to "c:/xxx/xxx" then it looks to "../xxx/xxx/afanasy/browser/index.html" but is also mapped to "http://www.host.com:51000". (btw. this doesnt work, because i cant move the browser folder to other location...)
so i need something like an alias folder wich has a name i.e. "MyWebGui" and looks into ""../afanasy/browser/" as the dokument root, so it can map the adress to "http://www.host.com:51000/MyWebGui"
User avatar
timurhai
Site Admin
Posts: 911
Joined: Sun Jan 15, 2017 8:40 pm
Location: Russia, Korolev
Contact:

Re: Web GUI folder configuration

Post by timurhai »

So, if you could configure what afserver should return on an empty request (now it is build in):
https://github.com/CGRU/cgru/blob/maste ... nasy.h#L49
It will fit your needs?

You what to configure any site root location and to return just index.html (not /afanasy/browser/index.html)?

Or misunderstanding again? ))
Timur Hairulin
CGRU 3.3.1, Ubuntu 20.04, 22.04, MS Windows 10 (clients only).
nospitters
Posts: 8
Joined: Sat Apr 10, 2021 12:31 pm

Re: Web GUI folder configuration

Post by nospitters »

i think you misunderstand...(or maybe i misunderstand?)
but this can be override at the moment with "af_http_serve_dir" in the config, right?

nevertheless whatever i will put inside it will always return the "root" internet-adress "http://host:51000" and NOT a subfolder like "http://host:51000/SubFolder/"
(i mean i want to reach the index.html from a subfolder inside the internet-browser...)

in apache httpd.conf there is the ability to configure a root-dir (which is accessed as "http://host:80") AND a alias folder i.e. named WebGUI (which is accessed as "http://host:80/WebGUI")
User avatar
timurhai
Site Admin
Posts: 911
Joined: Sun Jan 15, 2017 8:40 pm
Location: Russia, Korolev
Contact:

Re: Web GUI folder configuration

Post by timurhai »

It will return any location w/o any change, for example http://host:51000/SubFolder/
But on empty location http://host:51000 it returns http://host:51000/afanasy/browser/index.html

AfServer is not Apache, it is just a 177 code lines web server:
https://github.com/CGRU/cgru/blob/maste ... ttpget.cpp
( the simplest, i think )
Timur Hairulin
CGRU 3.3.1, Ubuntu 20.04, 22.04, MS Windows 10 (clients only).
Post Reply