Merge pull request #2566 from NeoTheFox/simple-http-server

Simple http server
This commit is contained in:
fewtarius 2023-12-22 09:52:39 -05:00 committed by GitHub
commit 129ec34150
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
12 changed files with 85 additions and 1 deletions

View file

@ -105,6 +105,7 @@ show_config() {
config_message="${config_message}\n - SAMBA mounting support:\t\t $SAMBA_SUPPORT"
config_message="${config_message}\n - SAMBA server support:\t\t $SAMBA_SERVER"
config_message="${config_message}\n - SFTP server support:\t\t\t $SFTP_SERVER"
config_message="${config_message}\n - HTTP server support:\t\t\t $SIMPLE_HTTP_SERVER"
config_message="${config_message}\n - OpenVPN support:\t\t\t $OPENVPN_SUPPORT"
config_message="${config_message}\n - WireGuard support:\t\t\t $WIREGUARD_SUPPORT"
config_message="${config_message}\n - ZeroTier support:\t\t\t $ZEROTIER_SUPPORT"

View file

@ -77,6 +77,9 @@
# build and install SFTP Server (yes / no)
SFTP_SERVER="yes"
# build and install Simple HTTP Server (yes / no)
SIMPLE_HTTP_SERVER="no"
# build and install OpenVPN support (yes / no)
OPENVPN_SUPPORT="no"

View file

@ -0,0 +1,41 @@
# Copyright (C) 2019-present Team LibreELEC (https://libreelec.tv)
# Copyright (C) 2023 JELOS (https://github.com/JustEnoughLinuxOS)
# Copyright (C) 2023-present NeoTheFox (https://github.com/NeoTheFox)
PKG_NAME="simple-http-server"
PKG_VERSION="0.6.7"
PKG_LICENSE="MIT"
PKG_SITE="https://github.com/TheWaWaR/simple-http-server"
PKG_URL_ARM="https://github.com/TheWaWaR/simple-http-server/releases/download/v${PKG_VERSION}/armv7-unknown-linux-musleabihf-simple-http-server"
PKG_URL_AARCH64="https://github.com/TheWaWaR/simple-http-server/releases/download/v${PKG_VERSION}/aarch64-unknown-linux-musl-simple-http-server"
PKG_URL_X86_64="https://github.com/TheWaWaR/simple-http-server/releases/download/v${PKG_VERSION}/x86_64-unknown-linux-musl-simple-http-server"
PKG_LONGDESC="Simple http server in Rust"
PKG_TOOLCHAIN="manual"
unpack() {
mkdir -p ${PKG_BUILD}
case $ARCH in
x86_64)
PKG_URL=$PKG_URL_X86_64
;;
arm)
PKG_URL=$PKG_URL_ARM
;;
aarch64)
PKG_URL=$PKG_URL_AARCH64
;;
*)
echo "Unsupported architecture!"
;;
esac
curl -L $PKG_URL -o ${PKG_BUILD}/simple-http-server
}
makeinstall_target() {
mkdir -p ${INSTALL}/usr/bin
mkdir -p ${INSTALL}/usr/lib/systemd/system
install -Dm755 ${PKG_BUILD}/simple-http-server ${INSTALL}/usr/bin/
install -Dm644 ${PKG_DIR}/system.d/simple-http-server.service ${INSTALL}/usr/lib/systemd/system/
}

View file

@ -0,0 +1,14 @@
[Unit]
Description=simple-http-server
Wants=network-pre.target
After=network-pre.target
[Service]
ExecStart=/usr/bin/simple-http-server -i -p 80 -a root:$(get_setting root.password) -s -u /storage
Restart=always
KillMode=process
Restart=on-failure
RestartSec=10
[Install]
WantedBy=multi-user.target

View file

@ -19,6 +19,10 @@ if [ "${SAMBA_SERVER}" = "yes" ] || [ "$SAMBA_SUPPORT" = "yes" ]; then
PKG_DEPENDS_TARGET="${PKG_DEPENDS_TARGET} samba"
fi
if [ "${SIMPLE_HTTP_SERVER}" = "yes" ]; then
PKG_DEPENDS_TARGET="${PKG_DEPENDS_TARGET} simple-http-server"
fi
if [ "${OPENVPN_SUPPORT}" = "yes" ]; then
PKG_DEPENDS_TARGET="${PKG_DEPENDS_TARGET} openvpn"
fi

View file

@ -108,6 +108,9 @@
# build and install SFTP Server (yes / no)
SFTP_SERVER="yes"
# build and install Simple HTTP Server (yes / no)
SIMPLE_HTTP_SERVER="yes"
# build and install OpenVPN support (yes / no)
OPENVPN_SUPPORT="no"

View file

@ -92,6 +92,9 @@
# build and install SFTP Server (yes / no)
SFTP_SERVER="yes"
# build and install Simple HTTP Server (yes / no)
SIMPLE_HTTP_SERVER="yes"
# build and install OpenVPN support (yes / no)
OPENVPN_SUPPORT="no"

View file

@ -118,6 +118,9 @@
# build and install SFTP Server (yes / no)
SFTP_SERVER="yes"
# build and install Simple HTTP Server (yes / no)
SIMPLE_HTTP_SERVER="yes"
# build and install OpenVPN support (yes / no)
OPENVPN_SUPPORT="no"

View file

@ -118,6 +118,9 @@
# build and install SFTP Server (yes / no)
SFTP_SERVER="yes"
# build and install Simple HTTP Server (yes / no)
SIMPLE_HTTP_SERVER="yes"
# build and install OpenVPN support (yes / no)
OPENVPN_SUPPORT="no"

View file

@ -109,6 +109,9 @@
# build and install SFTP Server (yes / no)
SFTP_SERVER="yes"
# build and install Simple HTTP Server (yes / no)
SIMPLE_HTTP_SERVER="yes"
# build and install OpenVPN support (yes / no)
OPENVPN_SUPPORT="no"

View file

@ -109,6 +109,9 @@
# build and install SFTP Server (yes / no)
SFTP_SERVER="yes"
# build and install Simple HTTP Server (yes / no)
SIMPLE_HTTP_SERVER="yes"
# build and install OpenVPN support (yes / no)
OPENVPN_SUPPORT="no"

View file

@ -1,4 +1,4 @@
################################################################################
/################################################################################
# setup device defaults
################################################################################
@ -119,6 +119,9 @@
# build and install SFTP Server (yes / no)
SFTP_SERVER="yes"
# build and install Simple HTTP Server (yes / no)
SIMPLE_HTTP_SERVER="yes"
# build and install OpenVPN support (yes / no)
OPENVPN_SUPPORT="no"