WDCommunity / wdpksrc

Cross compilation framework to create native packages for the Western Digital My Cloud
BSD 3-Clause "New" or "Revised" License
218 stars 54 forks source link

Create RClone WebGui package #67

Open stefaang opened 3 years ago

stefaang commented 3 years ago

https://github.com/rclone/rclone-webui-react

This powerful tool now has a web GUI... it's still a bit rough but it's easy to setup, so it deserves a package.

stefaang commented 3 years ago

https://bintray.com/beta/#/tfl/wdpksrc/Rclone Let me know if it works as expected!

EDIT Default login credentials: mycloud - mycloud Edit the /shares/Volume_1/Nas_Prog/rclone/env to change them

bahusoid commented 3 years ago

has a web GUI

Is it supposed to be installed with package? Or needs to be installed manually? I hacked a little script to create OS3 package and it's installed successfully on my WDMyCloud Gen 2 - only no WEB GUI when I click Configure in NAS App details page.

I also tried to install it manually via ssh. It seems to be installed successfully:

root@WDMyCloud root # rclone rcd --rc-web-gui
2020/11/29 22:20:42 NOTICE: A new release for gui is present at https://github.com/rclone/rclone-webui-react/releases/download/v2.0.3/currentbuild.zip
2020/11/29 22:20:42 NOTICE: Downloading webgui binary. Please wait. [Size: 4750769, Path :  /home/root/.cache/rclone/webgui/v2.0.3.zip]
2020/11/29 22:20:55 NOTICE: Unzipping webgui binary
2020/11/29 22:20:58 NOTICE: Serving Web GUI
2020/11/29 22:20:58 NOTICE: Serving remote control on http://127.0.0.1:5572/
2020/11/29 22:20:58 ERROR : Failed to open Web GUI in browser: exec: "xdg-open": executable file not found in $PATH. Manually access it at: http://gui:Bzv3dK1NEft8DBlSusjEgg@127.0.0.1:5572/?login_token=Z3VpOkJ6djNkSzFORWZ0OERCbFN1c2pFZ2c%3D

But I wasn't able to access it from my PC... Didn't dig it any deeper but doesn't look like this WEB GUI is currently easily accessible for average users :)

P.S. Path for WEB GUI installation looks suspicious: /home/root/.cache/rclone/webgui Isn't it writing to internal partition with limited space?

stefaang commented 3 years ago

Thanks for the feedback. Yeah that cache is smt I still need to fix. The start script uses the OS5 way to get the local ipv4 address. For OS3 you can grep the apache config to get the same result.

On Sun, Nov 29, 2020, 21:44 Roman Artiukhin notifications@github.com wrote:

has a web GUI

Is it supposed to be installed with package? Or needs to be installed manually? I hacked a little script to create OS3 package and it's installed successfully on my WDMyCloud Gen 2 - only no WEB GUI when I click Configure in NAS App details page.

I also tried to install it manually via ssh. It seems to be installed successfully:

root@WDMyCloud root # rclone rcd --rc-web-gui 2020/11/29 22:20:42 NOTICE: A new release for gui is present at https://github.com/rclone/rclone-webui-react/releases/download/v2.0.3/currentbuild.zip 2020/11/29 22:20:42 NOTICE: Downloading webgui binary. Please wait. [Size: 4750769, Path : /home/root/.cache/rclone/webgui/v2.0.3.zip] 2020/11/29 22:20:55 NOTICE: Unzipping webgui binary 2020/11/29 22:20:58 NOTICE: Serving Web GUI 2020/11/29 22:20:58 NOTICE: Serving remote control on http://127.0.0.1:5572/ 2020/11/29 http://127.0.0.1:5572/2020/11/29 22:20:58 ERROR : Failed to open Web GUI in browser: exec: "xdg-open": executable file not found in $PATH. Manually access it at: http://gui:Bzv3dK1NEft8DBlSusjEgg@127.0.0.1:5572/?login_token=Z3VpOkJ6djNkSzFORWZ0OERCbFN1c2pFZ2c%3D

But I wasn't able to access it from my PC... Didn't dig it any deeper but doesn't look like this WEB GUI is currently easily accessible for average users :)

P.S. Path for WEB GUI installation looks suspicious: /home/root/.cache/rclone/webgui Isn't it writing to internal partition with limited space?

— You are receiving this because you modified the open/close state. Reply to this email directly, view it on GitHub https://github.com/WDCommunity/wdpksrc/issues/67#issuecomment-735451225, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAHN7UDL76NPPBVV6DPRTQTSSKXEVANCNFSM4TZFYE7A .

bahusoid commented 3 years ago

The start script uses the OS5 way to get the local ipv4 address

No it works for me too... The following command gives correct ip for me: https://github.com/WDCommunity/wdpksrc/blob/91819702d83af883e2e967cec0ffd78b20097a5e/wdpk/rclone/start.sh#L14

And you should really say somewhere login/password...

This part looks wrong for rclone (actually whole file is about nzbget): https://github.com/WDCommunity/wdpksrc/blob/91819702d83af883e2e967cec0ffd78b20097a5e/wdpk/rclone/remove.sh#L15-L20

stefaang commented 3 years ago

Okay, that's a copy pasta gone wrong. I'm not used to a lot of traffic here, I'll keep my merge requests open for a bit longer so they can be reviewed better. I intended to mention the credentials in the official announcement.. but it should've been mentionned here ofc.

stefaang commented 3 years ago
2020/11/29 22:20:58 NOTICE: Serving remote control on http://127.0.0.1:5572/

That should be smt like 192.168.0.100, the network IP of you NAS.. resolvable hostname would be even better.

bahusoid commented 3 years ago

Some progress.. Access from my PC opens request for login/password but then opens blank page with Not found message: image

stefaang commented 3 years ago

Worst case you just hard code the ipv4 in there, I'm sure that that works. But it's not really DHCP proof.

bahusoid commented 3 years ago

Worst case you just hard code the ipv4 in there

Yeah I fixed this part. It looks like this for me now: 2020/11/30 11:05:51 NOTICE: Serving remote control on http://192.168.1.97:5574/

And it's not the problem now as page is opened and credentials are requested. But Not Found page is opened - WEB GUI is not found or something...

stefaang commented 3 years ago

Try

./stop.sh $(pwd)
./clean.sh $(pwd) --> after fix the paths
./init.sh $(pwd)
./start.sh $(pwd)
bahusoid commented 3 years ago

Nope.. Same "Not Found" for me. :( Also starth.sh gave me

sh: missing ]
sh: missing ]

So I fixed it by adding && before echo:

[ ! -f /usr/bin/rclone ] && echo "rclone not found" >> /tmp/debug_apkg

[ -f /tmp/debug_apkg ] && echo "APKG_DEBUG: starting Rclone" >> /tmp/debug_apkg
bahusoid commented 3 years ago

I removed part with --config ${CONFIG} from start.sh and now it works for me...

rclone rcd --rc-web-gui-no-open-browser --rc-addr ${ADDRESS}:${PORT:-5574} --rc-user ${RCLONE_USER:-mycloud} --rc-pass ${RCLONE_PW:-mycloud}
bahusoid commented 3 years ago

Another annoyance is clicking Configure button in NAS App settings opens http://wdmycloud/rclone/index.html which redirects to https://rclone.org/docs/. Any way to make it open actual WEB GUI http://wdmycloud:5574?

bahusoid commented 3 years ago

And it again opens Not Found page for me... :( Looks like it's working but quite unstable for some reasons (at least on my device)

bahusoid commented 3 years ago

Not sure but maybe it's something user privileges related. Adding sudo to start.sh seems fixed the issue.. Seems Web UI was working when I run it from ssh and not working when I started it from App page...

D-stefaang commented 3 years ago

@bahusoid it's because the apps run under a different user.. but your manually made config file (by ssh root user) is not writable via the web UI

D-stefaang commented 3 years ago

the proper fix is to touch the config file during install to ensure it exists