Merge pull request #8261 from CvH/12.0/filebrowser

filebrowser: initial addon
This commit is contained in:
Rudi Heitbaum 2023-10-30 23:03:02 +11:00 committed by GitHub
commit 1e06cb67dd
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
13 changed files with 126 additions and 0 deletions

View File

@ -0,0 +1 @@
initial release

Binary file not shown.

After

Width:  |  Height:  |  Size: 22 KiB

View File

@ -0,0 +1,40 @@
# SPDX-License-Identifier: GPL-2.0-only
# Copyright (C) 2023-present Team LibreELEC (https://libreelec.tv)
PKG_NAME="filebrowser"
PKG_VERSION="2.25.0"
PKG_REV="0"
PKG_LICENSE="Apache License 2.0"
PKG_SITE="https://filebrowser.org"
PKG_DEPENDS_TARGET="toolchain:host"
PKG_SECTION="service"
PKG_SHORTDESC="Filebrowser: a web based filemanger"
PKG_LONGDESC="Filebrowser (${PKG_VERSION}): is a web based file managing interface and it can be used to upload, delete, preview, rename and edit your files."
PKG_TAR_STRIP_COMPONENTS="no"
PKG_TOOLCHAIN="manual"
case "${ARCH}" in
"aarch64")
PKG_SHA256="18563c11ed0876de75fc3b6b4bf9596b4ce2a484bf75215ffcf2d3f5662880f3"
PKG_URL="https://github.com/filebrowser/filebrowser/releases/download/v${PKG_VERSION}/linux-arm64-filebrowser.tar.gz"
;;
"arm")
PKG_SHA256="63348c3ae98123afabb36ebe50990f43c54432e0502d81b94547dc41954727ab"
PKG_URL="https://github.com/filebrowser/filebrowser/releases/download/v${PKG_VERSION}/linux-armv7-filebrowser.tar.gz"
;;
"x86_64")
PKG_SHA256="287209e2d8b8cccbfe8d84b39a272e16517c4fc2e6eae6e2cedd57519d30b3b2"
PKG_URL="https://github.com/filebrowser/filebrowser/releases/download/v${PKG_VERSION}/linux-amd64-filebrowser.tar.gz"
;;
esac
PKG_SOURCE_NAME="filebrowser-${PKG_VERSION}-${ARCH}.tar.gz"
PKG_IS_ADDON="yes"
PKG_ADDON_NAME="Web File Browser"
PKG_ADDON_PROJECTS="any !RPi1"
PKG_ADDON_TYPE="xbmc.service"
addon() {
mkdir -p ${ADDON_BUILD}/${PKG_ADDON_ID}/bin
cp -r ${PKG_BUILD}/filebrowser ${ADDON_BUILD}/${PKG_ADDON_ID}/bin
}

View File

@ -0,0 +1,14 @@
#!/bin/sh
# SPDX-License-Identifier: GPL-2.0-only
# Copyright (C) 2023-present Team LibreELEC (https://libreelec.tv)
. /etc/profile
oe_setup_addon service.filebrowser
ADDON_SETTINGS="$ADDON_HOME/settings.xml"
chmod a+x $ADDON_DIR/bin/*
exec "$ADDON_DIR/bin/filebrowser" -d "$ADDON_HOME/database.db" -l stdout -r "/storage" -a "0.0.0.0" -p "$FILEBROWSER_PORT"

View File

@ -0,0 +1,20 @@
# SPDX-License-Identifier: GPL-2.0-only
# Copyright (C) 2016-present Team LibreELEC (https://libreelec.tv)
import subprocess
import xbmc
import xbmcaddon
class Monitor(xbmc.Monitor):
def __init__(self, *args, **kwargs):
xbmc.Monitor.__init__(self)
self.id = xbmcaddon.Addon().getAddonInfo('id')
def onSettingsChanged(self):
subprocess.call(['systemctl', 'restart', self.id])
if __name__ == "__main__":
Monitor().waitForAbort()

View File

@ -0,0 +1,26 @@
# Kodi Media Center language file
# Addon Name: filebrowser
# Addon id: service.filebrowser
# Addon Provider: Team LibreELEC
msgid ""
msgstr ""
msgctxt "#30000"
msgid "Settings"
msgstr ""
msgctxt "#30001"
msgid "Web Port"
msgstr ""
msgctxt "#30002"
msgid "Default Login http://ip-of-htpc:9977"
msgstr ""
msgctxt "#30003"
msgid "Username: admin"
msgstr ""
msgctxt "#30004"
msgid "Password: admin"
msgstr ""

Binary file not shown.

After

Width:  |  Height:  |  Size: 83 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 197 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 47 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 94 KiB

View File

@ -0,0 +1,9 @@
<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<settings>
<category label="30000">
<setting id="FILEBROWSER_PORT" type="text" label="30001" default="9977" />
<setting label="30002" type="lsep" />
<setting label="30003" type="action" action="" />
<setting label="30004" type="action" action="" />
</category>
</settings>

View File

@ -0,0 +1,3 @@
<settings version="2">
<setting id="FILEBROWSER_PORT" default="true">9977</setting>
</settings>

View File

@ -0,0 +1,13 @@
[Unit]
Description=Filebrowser Service
After=network-online.service
[Service]
ExecStart=/bin/sh -c "exec sh /storage/.kodi/addons/service.filebrowser/bin/filebrowser.start"
TimeoutStopSec=2
Restart=always
RestartSec=2
StartLimitInterval=0
[Install]
WantedBy=kodi.target