ansible-community / ara

ARA Records Ansible and makes it easier to understand and troubleshoot.
https://ara.recordsansible.org
GNU General Public License v3.0
1.84k stars 170 forks source link

No documention for embedded web server configuration #547

Open robschm opened 3 months ago

robschm commented 3 months ago

What is the issue ?

How do I correctly configure the ara web interface? At least the embedded server should be documented. There appears to be only documention for configuring the web server for the 0.x version of ara. Maybe I missed that part in the documentation?

ara-manage runserver did not work for me because of missing python dependencies. After installing some python dependencies, fixing some imports and configuring the settings.yaml file, I got it to work at last.

What should be happening ?

Update documention for quick configuration.

hakkika commented 3 months ago

I would like to know how did you manage to access the web ui from outside the server.

dmsimard commented 3 months ago

Hi, could you explain what kind of documentation you are expecting ? We can improve it.

For now, there is the README: https://github.com/ansible-community/ara?tab=readme-ov-file#requirements

and the docs: https://ara.readthedocs.io/en/latest/api-configuration.html

hakkika commented 3 months ago

I don’t know why, but the documentation refers to different variables by name compared to variables in settings.yml inside the container, e.g. ARA_DATABASE_ENGINE vs. DATABASE_ENGINE. Also, the name ALLOWED_HOSTS is misleading. I had to do a lot of googling until I realized, that it refers to the server itself, not the host trying to access it. It would also help, if there were examples and step by step instructions how to configure the server container to access an external database, e.g. MySQL or MariaDB

robschm commented 3 months ago

I think I got confused with 'API server', but as stated in the documentation, the api server contains a REST API and web interface. I thought I had to start the web server myself.

I did a second installation on Rocky Linux 9.4 minimal with podman, started the api-server and opened port 8000/tcp. At the beginning I got a 'Bad Request (400)' error, but after editing the ALLOWED_HOSTS variable (just added '*') , I could access the web ui from an external host. So maybe a little note for editing the ~/.ara/server/settings.ini file would help first time installers.

robschm commented 3 months ago

I would like to know how did you manage to access the web ui from outside the server.

On my first attempt with podman I could not access the web ui, because I did not know about the settings file. So I just ran the server locally. After installing some missing python libraries, I finally got the server running:

ara-manage runserver 0.0.0.0:8080

After adding '*' to ALLOWED_HOSTS in ~/.ara/server/settings.ini , I could access the web ui from outside the server.