Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Feature Request] Specify WebUI password on command line (retroshare-service) #2642

Closed
ann4belle opened this issue Oct 26, 2022 · 8 comments
Closed

Comments

@ann4belle
Copy link

At the moment, the only way to specify the WebUI password (and thus enable the WebUI) is to pass the -W flag and enter the password when prompted. Due to this, running retroshare-service as an actual service (as opposed to running it manually via a terminal) is impossible. This could be worked around by writing a "launcher" script to provide the requested input, but I feel it would be better if this option were simply included in the program, or was at least a cmake option. (Note: I built my copy of retroshare-service with RS_SERVICE_TERMINAL_WEBUI_PASSWORD - would building it without that option disable the password requirement, or otherwise allow some version of the behavior I'm requesting?)

@ann4belle
Copy link
Author

Update: attempted to work around this limitation using this python script:

import subprocess

retroshare = subprocess.Popen(['retroshare-service', '-s', '-P', '0.0.0.0', '-W', '-U', 'list'], stdin=subprocess.PIPE)
retroshare.communicate(input=b'boop\nboop\n1\n')

It launches successfully, but triggers the same behavior in #2641 - trying to access the WebUI at port 9092 returns HTTP 404. The rest of the JSON API responds, so it is listening - it simply refuses to read the WebUI. Specifying -B /usr/local/share/retroshare/webui/ (the location of the webui) does not help.

Reading the output, it appears to be setting the password correctly. I have no idea what might be going wrong here.

@defnax
Copy link
Contributor

defnax commented Oct 27, 2022

hi we need some one to build the required packages im not sure whats is needed.
But webui needs profile generation feature too:

RetroShare/RSNewWebUI#60

@ann4belle
Copy link
Author

ann4belle commented Oct 27, 2022

@defnax if the API of libretroshare was actually documented anywhere it'd probably be easier to just write a new service from that. I suspect that a big part of the reason retroshare-service is so wonky is that the API is completely undocumented (or at least, the docs aren't anywhere I can find) and everyone working on it has to figure out what each bit of code does for themselves.

@defnax
Copy link
Contributor

defnax commented Oct 28, 2022

@ann4belle
Copy link
Author

C++ code isn't exactly API documentation, but at least it's better than nothing. I suppose to bypass this issue and #2641 you could run the WebUI using a separate server, but that kinda defeats the point of having RS_WEBUI as an option when compiling retroshare-service.

I'd try to fix whatever is wrong with retroshare-service in #2641 and add this feature but it's frankly well outside of my skill level to even find what's causing the bug or where the feature would go.

@csoler
Copy link
Contributor

csoler commented Oct 28, 2022

I will take a look at it and keep you posted.

@ann4belle
Copy link
Author

With #2641 now mitigated by PR 53 on libretroshare, using Python's subprocess.Popen and passing the password twice via communicate() now works as a workaround for this issue.

@G10h4ck
Copy link
Contributor

G10h4ck commented Oct 23, 2023

AFAIU this bug is solved

@G10h4ck G10h4ck closed this as completed Oct 23, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants