diff --git a/config/show_config b/config/show_config index 34b3b30c7..566d7edd6 100644 --- a/config/show_config +++ b/config/show_config @@ -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" diff --git a/distributions/JELOS/options b/distributions/JELOS/options index ada961260..1a8b20f99 100644 --- a/distributions/JELOS/options +++ b/distributions/JELOS/options @@ -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" diff --git a/packages/network/simple-http-server/package.mk b/packages/network/simple-http-server/package.mk new file mode 100644 index 000000000..634fdf481 --- /dev/null +++ b/packages/network/simple-http-server/package.mk @@ -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/ +} diff --git a/packages/network/simple-http-server/system.d/simple-http-server.service b/packages/network/simple-http-server/system.d/simple-http-server.service new file mode 100644 index 000000000..f942ebcaa --- /dev/null +++ b/packages/network/simple-http-server/system.d/simple-http-server.service @@ -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 diff --git a/packages/virtual/network/package.mk b/packages/virtual/network/package.mk index 0d7ca0cf6..de77b99ef 100644 --- a/packages/virtual/network/package.mk +++ b/packages/virtual/network/package.mk @@ -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 diff --git a/projects/Amlogic/devices/S922X/options b/projects/Amlogic/devices/S922X/options index 21793470b..66a843bcb 100644 --- a/projects/Amlogic/devices/S922X/options +++ b/projects/Amlogic/devices/S922X/options @@ -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" diff --git a/projects/PC/devices/AMD64/options b/projects/PC/devices/AMD64/options index 4f50349f3..fdf0f3ff2 100644 --- a/projects/PC/devices/AMD64/options +++ b/projects/PC/devices/AMD64/options @@ -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" diff --git a/projects/Rockchip/devices/RK3326/options b/projects/Rockchip/devices/RK3326/options index 005eb5fcb..3b385933f 100644 --- a/projects/Rockchip/devices/RK3326/options +++ b/projects/Rockchip/devices/RK3326/options @@ -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" diff --git a/projects/Rockchip/devices/RK3399/options b/projects/Rockchip/devices/RK3399/options index a0dfa6dbf..417bb4253 100644 --- a/projects/Rockchip/devices/RK3399/options +++ b/projects/Rockchip/devices/RK3399/options @@ -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" diff --git a/projects/Rockchip/devices/RK3566-X55/options b/projects/Rockchip/devices/RK3566-X55/options index 5d0b81281..6fa8d7261 100644 --- a/projects/Rockchip/devices/RK3566-X55/options +++ b/projects/Rockchip/devices/RK3566-X55/options @@ -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" diff --git a/projects/Rockchip/devices/RK3566/options b/projects/Rockchip/devices/RK3566/options index ff8acbc0c..771deed4b 100644 --- a/projects/Rockchip/devices/RK3566/options +++ b/projects/Rockchip/devices/RK3566/options @@ -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" diff --git a/projects/Rockchip/devices/RK3588/options b/projects/Rockchip/devices/RK3588/options index 58130a351..74b6521dc 100755 --- a/projects/Rockchip/devices/RK3588/options +++ b/projects/Rockchip/devices/RK3588/options @@ -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"