Page 1 of 1

Cannot configure authentication (for web UI)

Posted: Tue Dec 11, 2018 7:00 am
by KonstantinDmitriev
Hello!

For some reason I cannot get web authentication working - it doesn't asks username/password when I open web UI in browser.

I have generated .htdigest file with "CGRU" realm and placed it into /opt/cgru/.
af_ip_trust mask also configured, and I am connecting from external network.
Afserver reports that "Digest file loaded, authentication is enabled."
Do not know where to dig. Any help is appreciated!

See full configs and logs below.

Code: Select all

CGRU version: 2.2.3
Build at: Nov 1 2017 23:47:41
Build revision: b4c9e867366d2ce011b5e6095fa503501b4db229
/opt/cgru/config.json

Code: Select all

{"cgru_config":{

    "af_ip_trust":["192.168.*.*"],
        "":"Mask should have at least one '.' for IPv4 or one ':' for IPv6.",
    "af_digest_file":".htdigest",

"":"User:",
    "af_errors_avoid_host":10,
    "af_task_error_retries":10,
    "af_task_errors_same_host":10,
    "af_errors_forgivetime":180,
    "af_max_run_tasks_per_host":-1,
    "af_jobs_life_time":0,

"":"Monitor: (server side - any gui)",
    "af_monitor_zombietime":100,

    "":""
}}

Code: Select all

render@f54bdae09a26:/opt/cgru$ ls -al /opt/cgru  
total 208
drwxrwxrwx  1 root   root  4096 Dec 11 06:36 .
drwxr-xr-x  1 root   root  4096 Dec  3 11:00 ..
-rw-r--r--  1 root   root    46 Dec 11 06:07 .htdigest
-rw-r--r--  1 root   root  2397 Nov  1  2017 README.md
drwxrwxrwx  1 root   root  4096 Dec 11 06:36 afanasy
drwxrwxrwx  2 root   root  4096 Dec  3 11:00 bin
-rw-r--r--  1 root   root   459 Dec 11 06:52 config.json
-rw-r--r--  1 render root  2418 Dec 11 06:36 config_default.json
drwxrwxrwx 16 root   root  4096 Dec  3 11:00 examples
-rw-r--r--  1 root   root 17056 Nov  1  2017 favicon.ico
-rw-r--r--  1 root   root   435 Nov  1  2017 htaccess_example
drwxrwxrwx  4 root   root  4096 Dec  3 11:00 icons
-rw-r--r--  1 root   root 28410 Nov  1  2017 index.html
drwxrwxrwx  5 root   root  4096 Dec  3 11:00 lib
-rw-r--r--  1 root   root  7809 Nov  1  2017 player.html
drwxrwxrwx 13 root   root  4096 Dec  3 11:00 plugins
-rw-r--r--  1 root   root    41 Nov  1  2017 revision.txt
drwxrwxrwx  5 root   root  4096 Dec  3 11:00 rules
-rw-r--r--  1 root   root 52522 Nov  1  2017 rules.php
-rwxr-xr-x  1 root   root   709 Nov  1  2017 setup.sh
-rwxr-xr-x  1 root   root   112 Nov  1  2017 setup_README.sh
-rw-r--r--  1 root   root   147 Nov  1  2017 setup_afanasy.sh
-rwxr-xr-x  1 root   root   729 Nov  1  2017 setup_python.sh
drwxrwxrwx  3 root   root  4096 Dec  3 11:00 software_setup
drwxrwxrwx  5 root   root  4096 Dec  3 11:00 start
-rwxr-xr-x  1 root   root    36 Nov  1  2017 start.command
-rwxr-xr-x  1 root   root   306 Nov  1  2017 start.sh
drwxrwxrwx  6 root   root  4096 Dec  3 11:00 utilities
-rw-r--r--  1 root   root     6 Nov  1  2017 version.txt
LOG:

Code: Select all

Compilation date = 'Nov  1 2017 23:47:41'
CGRU version = '2.2.3'
Afanasy build revision = 'b4c9e867366d2ce011b5e6095fa503501b4db229'
Python version = '3.5.2'
GCC version = '5.4.0'
RLIMIT_NOFILE: Files descriptors limit: 1048576
RLIMIT_NPROC: Processes (threads) limit: -1
Config file does not exist:
/home/render/.cgru/config.json
Digest file loaded, authentication is enabled.
Database connection "AFDB_update" is not working.
Tue 11 Dec 06:56.52: INFO    Reading store file: "/var/tmp/afanasy/server.json"
AFERROR: AFDB_upTables: Database connect failed: could not translate host name "db" to address: Name or service not known

Tue 11 Dec 06:56.52: INFO    Getting renders from store...
Tue 11 Dec 06:56.52: INFO    0 renders found.
Tue 11 Dec 06:56.52: INFO    0 renders registered.
Tue 11 Dec 06:56.52: INFO    Getting users from store...
Tue 11 Dec 06:56.52: INFO    2 users found.
Tue 11 Dec 06:56.52: INFO    2 users registered from store.
Tue 11 Dec 06:56.52: INFO    Getting jobs from store...
Tue 11 Dec 06:56.52: INFO    3 jobs found.
System job retrieved from store.
Tue 11 Dec 06:56.52: Job registered: "afanasy"[1]: afadmin[0] - 15937 bytes.
Tue 11 Dec 06:56.52: Job registered: "RenderChan - project-eco-all.blend - /home/render/5-eco.right"[3]: morevna@0695e4ef554e[0] - 66993 bytes.
Tue 11 Dec 06:56.52: Job registered: "RenderChan - project-eco-all.blend - /home/render/5-eco"[2]: morevna@8c6bb4ca1bc2[1] - 66883 bytes.
Tue 11 Dec 06:56.52: INFO    3 jobs registered from store.
Tue 11 Dec 06:56.52: INFO    Raising 10 threads to process incoming connections...
Tue 11 Dec 06:56.52: INFO    Raising 10 threads to read/write sockets...
Tue 11 Dec 06:56.52: INFO    Raised 10 threads.
Available addresses:
IP = '0.0.0.0'
Tue 11 Dec 06:56.52: INFO    Run thread started.IPv6 is disabled by config.
Using IPv4 addresses family.

Listening 51000 port...
Tue 11 Dec 06:56.53: Monitor registered: morevna@pc[1] e'firefox' 176.50.253.60
Tue 11 Dec 06:56.57: Monitor registered: coord@pc[2] e'chrome' 176.50.253.60
Tue 11 Dec 06:57.42: Server load profiling:                                                                          
Clients per second: 2.04, Now: 2 (processed 100 connections in last 49.01 seconds).                                  
Prep: 10.34, Proc: 8.81, Post: 1016.21, Total: 1035.37 ms.                                                           
                                                                                                                     
Tue 11 Dec 06:57.45: New Render registered:  ON                     215b318c4f21@morevna[1] 10.5.84.97

Re: Cannot configure authentication (for web UI)

Posted: Tue Dec 11, 2018 1:49 pm
by timurhai
Hi.
Sorry, this was not in changes log, but authentication was skipped since 2.1.0.
Afanasy networking changed much that time, but authentication was very raw and undocumented.
Nobody uses it that time (at least i do not know), and i have no time develop it.
But later i want to back to this issue.

btw
I know that some use VPN or (and) SSH (that can to redirect port) for a remote farm monitoring.

Re: Cannot configure authentication (for web UI)

Posted: Tue Aug 09, 2022 5:36 pm
by Febulix
I just stumbled over the af_digest_file in config_default.json and could not find any documentantion. Now I discovered this post.
So if it's not in use anymore, maybe the lines in config_default.json and other potential code leftovers should be removed?

Re: Cannot configure authentication (for web UI)

Posted: Wed Aug 10, 2022 7:38 am
by timurhai
Hi!
It was removed only because it should be much rewritten when afanasy network workflow changed.
But it is in plans to rewrite it, so the code is kept.