Request a file explorer via web

I have dietpi into a x86 pc and its awesome!
I have three hdd connected in SATA and a posibility to copy files is through ssh with Midnight Commander (mc) I think that this is more quickly than make it thrugh in samba., another posibility is make it with a web broser like https://filebrowser.org or another similar.
The installation is curl -fsSL https://filebrowser.org/get.sh | bash and it run with filebrowser -r /path/to/your/files and making some configurations like the port or the ip with filebrowser config set [flags]but I don´t know how to do it like a service in dietpi.

Ok…got it working…but it was a booger!

daemonize wouldn’t work (it would start the program but wouldn’t pass on the arguments from the config file I had created)…so I had to build a simple systemctl service file
using this https://www.howtogeek.com/687970/how-to-run-a-linux-program-at-startup-with-systemd/
I created a file in /etc/systemd/system called filebrowser.service

[Unit]
Description=filebrowser service start

Wants=network.target
After=syslog.target network-online.target

[Service]
Type=simple
Environment="SCRIPT_ARGS= -a 192.168.0.100 -p 8888 -r /mnt/dietpi_userdata"
ExecStart=/usr/local/bin/filebrowser $SCRIPT_ARGS
Restart=on-failure
RestartSec=10
KillMode=process

[Install]
WantedBy=multi-user.target

I had to create the Environment line to pass the correct script arguments to the filebrower command
then followed the howto in the above howtogeek link to test and ensure the service was working

Now seeing

root@M-340C:/etc/systemd/system# service filebrowser status
● filebrowser.service - filebrowser service start
   Loaded: loaded (/etc/systemd/system/filebrowser.service; enabled; vendor preset: enabled)
   Active: active (running) since Tue 2021-03-02 02:05:32 CST; 4min 46s ago
 Main PID: 30416 (filebrowser)
    Tasks: 10 (limit: 4915)
   Memory: 10.0M
   CGroup: /system.slice/filebrowser.service
           └─30416 /usr/local/bin/filebrowser -a 192.168.0.100 -p 8888 -r /mnt/dietpi_userdata

Mar 02 02:05:32 M-340C systemd[1]: filebrowser.service: Main process exited, code=exited, status=1/FAILURE
Mar 02 02:05:32 M-340C systemd[1]: filebrowser.service: Failed with result 'exit-code'.
Mar 02 02:05:32 M-340C systemd[1]: Stopped filebrowser service start.
Mar 02 02:05:32 M-340C systemd[1]: Started filebrowser service start.
Mar 02 02:05:32 M-340C filebrowser[30416]: 2021/03/02 02:05:32 No config file used
Mar 02 02:05:32 M-340C filebrowser[30416]: 2021/03/02 02:05:32 Listening on 192.168.0.100:8888
Mar 02 02:05:47 M-340C filebrowser[30416]: 2021/03/02 02:05:47 /api/renew: 403 192.168.0.10 <nil>

And I get access to the filebrowser website on port 8888, default username/password is admin

I did find a webgui MC commander called cloud commander that might be useful

I had to play around with it some to get it working

I installed the version 14 of nodesource (don’t use lower versions, they are outdated and depreciated)

curl -sL https://deb.nodesource.com/setup_14.x | sudo -E bash -
sudo apt-get install -y nodejs

Then installed cloudcmd as sudo

sudo npm i cloudcmd -g --force

Then ran the program

$ cloudcmd

Came up on port 8000

Edited for brevity of course

Hi!

The first solution work well but when I reboot it doesn´t work (it´s a security feature :rofl: ) I need to restart the service with

 systemctl restart filebrowser

and the second solution with cloud commander I have this error

root@DietPi:~# cloudcmd
/usr/local/lib/node_modules/cloudcmd/bin/cloudcmd.mjs:5
import {createRequire} from 'module';
       ^

SyntaxError: Unexpected token {
    at Module._compile (internal/modules/cjs/loader.js:760:23)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:827:10)
    at Module.load (internal/modules/cjs/loader.js:685:32)
    at Function.Module._load (internal/modules/cjs/loader.js:620:12)
    at Function.Module.runMain (internal/modules/cjs/loader.js:877:12)
    at internal/main/run_main_module.js:21:11

did you set systemctl enable filebrowser to have the service started during boot?

No, because I’m a bit noob with linux.

Now it works, thanks a lot

I got the same error on mine…I did a bit of fiddling with it to get it to work…
I also ran cloudcmd as a user rather than root…not sure if that helps