sa3eedDev / FileBrowserMMP

Web file browser using FileBrowser for the Miyoo Mini+
GNU General Public License v3.0
9 stars 2 forks source link

Issues on Onion 4.2 Dev #1

Closed XK9274 closed 1 year ago

XK9274 commented 1 year ago

With the standard config.json file contents the app shows as a blank (no image, no text) entry for me on Onion 4.2 beta.

{
    "label":    "Web File Browser",
    "icon": "/mnt/SDCARD/App/FileBrowser/filebrowser.png",
    "launch":   "launch.sh",
    "description":  "FileBrowser server"
}

I've renamed the zipfile output to Filebrowser and uploaded, editing the config.json & amending it to:

{
"label":"Web File Browser",
"icon":"filebrowser.png",
"launch":"launch.sh",
"description":"FileBrowser server"
}

Resolved this.

However, the app now starts but shortly after exits out. and fails to load the server. Loading filebrowser from the directory gives:

/mnt/SDCARD/App/Filebrowser # ./filebrowser
2023/03/29 09:18:03 No config file used
2023/03/29 09:18:03 listen tcp 192.168.1.30:80: bind: cannot assign requested address

Your IP string appears to work:

/mnt/SDCARD/App/Filebrowser # IP=$(ip route get 1 | awk '{print $NF;exit}')
/mnt/SDCARD/App/Filebrowser # echo $IP
192.168.1.215

And starting your filebrowser from Putty also works and the webpage loads:

/mnt/SDCARD/App/Filebrowser # ./filebrowser -a $IP -p 80  -r /mnt/SDCARD &
/mnt/SDCARD/App/Filebrowser # 2023/03/29 09:24:23 No config file used
2023/03/29 09:24:23 Listening on 192.168.1.215:80

ETC: However starting the app on the miyoo with the launch.sh does not. It's probably due to the process being killed when the app does..

XK9274 commented 1 year ago

Took a look at the launch.sh and managed to resolve this with :


#!/bin/sh
echo $0 $*

IP=$(ip route get 1 | awk '{print $NF;exit}')

LD_PRELOAD=/mnt/SDCARD/miyoo/lib/libpadsp.so /mnt/SDCARD/.tmp_update/bin/infoPanel -t "Launching http FileBrowser" -m "http FileBrowser has been launched: $IP" --auto &

pkill -9 wpa_supplicant
pkill -9 udhcpc
pkill -9 ./filebrowser

cd /mnt/SDCARD/App/FileBrowser/
./filebrowser config set --branding.name "Onion"
./filebrowser config set --branding.files "/mnt/SDCARD/App/FileBrowser/theme"
nohup ./filebrowser -a $IP -p 80 -r /mnt/SDCARD -l /mnt/SDCARD/HTTPLOG.txt &
sa3eedDev commented 1 year ago

Hello, Thank you for your feedback. the config file be updated, no need to have the absolute path of the image. the app should just give you a message that is has been launched and closes, but it keep working in the background.
if you want to launch from terminal (You don't need to) use launch.sh not filebrowser or copy the last command in launch.sh

XK9274 commented 1 year ago

Forgot about this issue, yeah that was my bad i had problems with my build back then. Your version of filebrowser is great & added in to tweaks now! Closing.