YunoHost-Apps / yacy_ynh

Libre and decentralized search engine for YunoHost
GNU General Public License v3.0
7 stars 7 forks source link

Log-in to protected admin-page not possible #10

Closed hermann-san closed 2 years ago

hermann-san commented 2 years ago

Describe the bug

after installing Yacy, I can access the search page and also the admin page, but the log-in to the secured admin area doesn't work. After I've click on the log-in link, it tries to loead a page, but nothing happens. I keep tries to load the page.

Hardware: **VPS bought online **
YunoHost version: 4.3.6.3
I have access to my server: Through SSH | through the webadmin | direct access via keyboard / screen | ...
Are you in a special context or did you perform some particular tweaking on your YunoHost instance?: no
Using, or trying to install package version/branch: 1.0~ynh1

Steps to reproduce

Fresh install and log-in to the admin page. 

Expected behavior

Log-in should be successful. It appears that there is some problem with the enviroment path and the password. With su permission I went to path /var/www/yacy on the console and tried to set the password with ./passwd , but there is an error message. I'm not sure if I#m on the right path to solve this. Dunno how to change the environment path. Error:

/var/www/yacy/bin# ./passwd.sh 
Invalid YaCy DATA folder path : /var/www/yacy/DATA
Please fill the YACY_DATA_PATH environment variable with a valid YaCy DATA folder path.

Logs


Jun 15 19:43:09 systemd[1]: Started YaCy search server.
Jun 16 00:11:14 systemd[1]: Stopping YaCy search server...
Jun 16 00:11:14 stopYACY.sh[15209]: **Invalid YaCy DATA folder path : DATA**
Jun 16 00:11:14 stopYACY.sh[15209]: **Please fill the YACY_DATA_PATH environment variable with a valid YaCy DATA folder path.**
Jun 16 00:11:14 systemd[1]: yacy.service: Control process exited, code=exited, status=2/INVALIDARGUMENT
Jun 16 00:11:22 systemd[1]: yacy.service: Main process exited, code=exited, status=143/n/a
Jun 16 00:11:22 systemd[1]: yacy.service: Failed with result 'exit-code'.
Jun 16 00:11:22 systemd[1]: Stopped YaCy search server.
Jun 16 00:11:22 systemd[1]: Starting YaCy search server...
yalh76 commented 2 years ago

The good command is in the install script:

https://github.com/YunoHost-Apps/yacy_ynh/blob/ca4d54e5e6c1bc7d772e375f6193b46f886034a5/scripts/install#L129

That can be converted to:

sudo -u yacy YACY_DATA_PATH=/home/yunohost.app/yacy/DATA /var/www/yacy/bin/passwd.sh youpassword

hermann-san commented 2 years ago

can I execute this myself or will this be fixed in an update? I've tried it , but got an error message


$ sudo -u yacy YACY_DATA_PATH=/home/yunohost.app/yacy/DATA /var/www/yacy/bin/passwd.sh mypassword
[sudo] password for admin: 
Sorry, user admin is not allowed to execute '/var/www/yacy/bin/passwd.sh mypassword' as yacy on 

Then I did su to switch to root first

sudo -u yacy YACY_DATA_PATH=/home/yunohost.app/yacy/DATA /var/www/yacy/bin/passwd.sh hHj.%SBXnNQ+Q63Zj21f
Setting new YaCy administrator password...
YaCy server appears to be running. Calling the ConfigAccounts_p API...
curl: (22) The requested URL returned error: 500 Server Error
Password setting failed

I got the complex password issue, but I believe that is or will be fixed in another issue

sudo -u yacy YACY_DATA_PATH=/home/yunohost.app/yacy/DATA /var/www/yacy/bin/passwd.sh mypassword
Setting new YaCy administrator password...
YaCy server appears to be running. Calling the ConfigAccounts_p API...
Password successfully changed for User Name 'admin'.

So now I can get to the admin page and things are fine for me. Thanks for your help