From a178d2e97bb5a00c28bba9a80733a0aa12078468 Mon Sep 17 00:00:00 2001 From: elvito Date: Sat, 26 Apr 2025 10:56:52 +0200 Subject: [PATCH 01/11] Create librespeed-install.sh --- install/librespeed-install.sh | 1 + 1 file changed, 1 insertion(+) create mode 100644 install/librespeed-install.sh diff --git a/install/librespeed-install.sh b/install/librespeed-install.sh new file mode 100644 index 0000000..8b13789 --- /dev/null +++ b/install/librespeed-install.sh @@ -0,0 +1 @@ + From 473746a1a5470a19f61fd56315aa97ee777ffac9 Mon Sep 17 00:00:00 2001 From: elvito Date: Sat, 26 Apr 2025 10:57:10 +0200 Subject: [PATCH 02/11] Create librespeed.sh --- ct/librespeed.sh | 1 + 1 file changed, 1 insertion(+) create mode 100644 ct/librespeed.sh diff --git a/ct/librespeed.sh b/ct/librespeed.sh new file mode 100644 index 0000000..8b13789 --- /dev/null +++ b/ct/librespeed.sh @@ -0,0 +1 @@ + From ade09418e0959a5821cdfa830c354738c1c05f91 Mon Sep 17 00:00:00 2001 From: elvito Date: Sat, 26 Apr 2025 10:57:47 +0200 Subject: [PATCH 03/11] Create librespeed.json --- frontend/public/json/librespeed.json | 1 + 1 file changed, 1 insertion(+) create mode 100644 frontend/public/json/librespeed.json diff --git a/frontend/public/json/librespeed.json b/frontend/public/json/librespeed.json new file mode 100644 index 0000000..8b13789 --- /dev/null +++ b/frontend/public/json/librespeed.json @@ -0,0 +1 @@ + From d425d44f4dda440f0fa2d55e85bb5140bc2fbcd6 Mon Sep 17 00:00:00 2001 From: elvito Date: Sat, 26 Apr 2025 11:00:02 +0200 Subject: [PATCH 04/11] Update librespeed.sh --- ct/librespeed.sh | 56 ++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 56 insertions(+) diff --git a/ct/librespeed.sh b/ct/librespeed.sh index 8b13789..487df58 100644 --- a/ct/librespeed.sh +++ b/ct/librespeed.sh @@ -1 +1,57 @@ +#!/usr/bin/env bash +source <(curl -fsSL https://raw.githubusercontent.com/community-scripts/ProxmoxVED/refs/heads/main/misc/build.func) +# Copyright (c) 2021-2025 community-scripts ORG +# Author: elvito +# License: MIT | https://github.com/community-scripts/ProxmoxVE/raw/main/LICENSE +# Source: https://github.com/librespeed/speedtest + +APP="librespeed" +var_tags="speedtest" +var_cpu="1" +var_ram="512" +var_disk="4" +var_os="debian" +var_version="12" +var_unprivileged="1" + +header_info "$APP" +variables +color +catch_errors + +function update_script() { + header_info + check_container_storage + check_container_resources + + if [[ ! -f /opt/librespeed/index.html ]]; then + msg_error "No ${APP} Installation Found!" + exit + fi + RELEASE=$(curl -fsSL https://api.github.com/repos/librespeed/speedtest/releases/latest | grep "tag_name" | awk '{print substr($2, 2, length($2)-3)}') + if [[ ! -f /opt/librespeed/${APP}_version.txt ]] || [[ "${RELEASE}" != "$(cat /opt//librespeed/${APP}_version.txt)" ]]; then + msg_info "Updating $APP..." + temp_file=$(mktemp) + curl -fsSL "https://github.com/librespeed/speedtest/archive/refs/tags/${RELEASE}.zip" -o $temp_file + mkdir -p /temp + unzip -qu $temp_file -d /temp + cd /temp/speedtest-${RELEASE} + cp -u favicon.ico index.html speedtest.js speedtest_worker.js /opt/librespeed/ + cp -ru backend /opt/librespeed/ + echo "${RELEASE}" >"/opt/librespeed/librespeed_version.txt" + systemctl restart caddy + msg_ok "$APP has been updated." + else + msg_ok "No update required. ${APP} is already at ${RELEASE}" + fi + exit +} +start +build_container +description + +msg_ok "Completed Successfully!\n" +echo -e "${CREATING}${GN}${APP} setup has been successfully initialized!${CL}" +echo -e "${INFO}${YW} Access it using the following URL:${CL}" +echo -e "${TAB}${GATEWAY}${BGN}http://${IP}:80${CL}" From 476fdbdd4237122e7d101ea4b56d5ad780540c19 Mon Sep 17 00:00:00 2001 From: elvito Date: Sat, 26 Apr 2025 11:01:13 +0200 Subject: [PATCH 05/11] Update librespeed-install.sh --- install/librespeed-install.sh | 55 +++++++++++++++++++++++++++++++++++ 1 file changed, 55 insertions(+) diff --git a/install/librespeed-install.sh b/install/librespeed-install.sh index 8b13789..ab1ec6c 100644 --- a/install/librespeed-install.sh +++ b/install/librespeed-install.sh @@ -1 +1,56 @@ +#!/usr/bin/env bash + +# Copyright (c) 2021-2025 community-scripts ORG +# Author: elvito +# License: MIT | https://github.com/community-scripts/ProxmoxVE/raw/main/LICENSE +# Source: https://github.com/librespeed/speedtest + +source /dev/stdin <<< "$FUNCTIONS_FILE_PATH" +color +verb_ip6 +catch_errors +setting_up_container +network_check +update_os + +msg_info "Installing Dependencies" +$STD apt-get update +$STD apt-get install -y \ + caddy \ + php-fpm +msg_ok "Installed Dependencies" + +msg_info "Installing librespeed" +temp_file=$(mktemp) +RELEASE=$(curl -fsSL https://api.github.com/repos/librespeed/speedtest/releases/latest | grep "tag_name" | awk '{print substr($2, 2, length($2)-3)}') +curl -fsSL "https://github.com/librespeed/speedtest/archive/refs/tags/${RELEASE}.zip" -o $temp_file +mkdir -p /opt/librespeed +mkdir -p /temp +unzip -q $temp_file -d /temp +cd /temp/speedtest-${RELEASE} +cp -u favicon.ico index.html speedtest.js speedtest_worker.js /opt/librespeed/ +cp -ru backend results /opt/librespeed/ +echo "${RELEASE}" >"/opt/librespeed/librespeed_version.txt" +msg_ok "Installation completed" + +msg_info "Creating Caddyfile" +cat </etc/caddy/Caddyfile +:80 { + root * /opt/librespeed + file_server + php_fastcgi unix//run/php/php-fpm.sock +} +EOF +systemctl restart caddy +msg_ok "Caddyfile created" + +motd_ssh +customize + +msg_info "Cleaning up" +rm -rf /temp +rm -f $temp_file +$STD apt-get -y autoremove +$STD apt-get -y autoclean +msg_ok "Cleaned" From 03199562d5c74d07d6764fbca920694c7abd8d76 Mon Sep 17 00:00:00 2001 From: elvito Date: Sat, 26 Apr 2025 11:02:30 +0200 Subject: [PATCH 06/11] Update librespeed.json --- frontend/public/json/librespeed.json | 41 +++++++++++++++++++++++++++- 1 file changed, 40 insertions(+), 1 deletion(-) diff --git a/frontend/public/json/librespeed.json b/frontend/public/json/librespeed.json index 8b13789..8ee55dc 100644 --- a/frontend/public/json/librespeed.json +++ b/frontend/public/json/librespeed.json @@ -1 +1,40 @@ - +{ + "name": "Librespeed", + "slug": "librespeed", + "categories": [ + 4 + ], + "date_created": "2025-04-25", + "type": "ct", + "updateable": true, + "privileged": false, + "interface_port": 80, + "documentation": null, + "config_path": "", + "website": null, + "logo": "https://github.com/librespeed/speedtest/blob/master/.logo/icon_huge.png", + "description": "No Flash, No Java, No Websocket, No Bullshit. This is a very lightweight speed test implemented in Javascript, using XMLHttpRequest and Web Workers.", + "install_methods": [ + { + "type": "default", + "script": "ct/librespeed.sh", + "resources": { + "cpu": 1, + "ram": 512, + "hdd": 4, + "os": "Debian", + "version": "12" + } + } + ], + "default_credentials": { + "username": "root", + "password": null + }, + "notes": [ + { + "text": "", + "type": "" + } + ] +} From 569d3cfc31e219d044b4142ea41d17fb03486660 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Slavi=C5=A1a=20Are=C5=BEina?= <58952836+tremor021@users.noreply.github.com> Date: Sat, 26 Apr 2025 18:40:09 +0200 Subject: [PATCH 07/11] Update librespeed.sh --- ct/librespeed.sh | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/ct/librespeed.sh b/ct/librespeed.sh index 487df58..1213943 100644 --- a/ct/librespeed.sh +++ b/ct/librespeed.sh @@ -20,16 +20,16 @@ color catch_errors function update_script() { - header_info - check_container_storage - check_container_resources + header_info + check_container_storage + check_container_resources - if [[ ! -f /opt/librespeed/index.html ]]; then - msg_error "No ${APP} Installation Found!" - exit - fi - RELEASE=$(curl -fsSL https://api.github.com/repos/librespeed/speedtest/releases/latest | grep "tag_name" | awk '{print substr($2, 2, length($2)-3)}') - if [[ ! -f /opt/librespeed/${APP}_version.txt ]] || [[ "${RELEASE}" != "$(cat /opt//librespeed/${APP}_version.txt)" ]]; then + if [[ ! -f /opt/librespeed/index.html ]]; then + msg_error "No ${APP} Installation Found!" + exit + fi + RELEASE=$(curl -fsSL https://api.github.com/repos/librespeed/speedtest/releases/latest | grep "tag_name" | awk '{print substr($2, 2, length($2)-3)}') + if [[ ! -f /opt/librespeed/${APP}_version.txt ]] || [[ "${RELEASE}" != "$(cat /opt//librespeed/${APP}_version.txt)" ]]; then msg_info "Updating $APP..." temp_file=$(mktemp) curl -fsSL "https://github.com/librespeed/speedtest/archive/refs/tags/${RELEASE}.zip" -o $temp_file @@ -41,7 +41,7 @@ function update_script() { echo "${RELEASE}" >"/opt/librespeed/librespeed_version.txt" systemctl restart caddy msg_ok "$APP has been updated." - else + else msg_ok "No update required. ${APP} is already at ${RELEASE}" fi exit @@ -53,5 +53,5 @@ description msg_ok "Completed Successfully!\n" echo -e "${CREATING}${GN}${APP} setup has been successfully initialized!${CL}" echo -e "${INFO}${YW} Access it using the following URL:${CL}" -echo -e "${TAB}${GATEWAY}${BGN}http://${IP}:80${CL}" +echo -e "${TAB}${GATEWAY}${BGN}http://${IP}${CL}" From a351d12156c8cdc60a173bd3e147c8f82f62ab8c Mon Sep 17 00:00:00 2001 From: CanbiZ <47820557+MickLesk@users.noreply.github.com> Date: Sat, 26 Apr 2025 21:15:44 +0200 Subject: [PATCH 08/11] Update frontend/public/json/librespeed.json MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: Slaviša Arežina <58952836+tremor021@users.noreply.github.com> --- frontend/public/json/librespeed.json | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/frontend/public/json/librespeed.json b/frontend/public/json/librespeed.json index 8ee55dc..2ae9ced 100644 --- a/frontend/public/json/librespeed.json +++ b/frontend/public/json/librespeed.json @@ -31,10 +31,5 @@ "username": "root", "password": null }, - "notes": [ - { - "text": "", - "type": "" - } - ] + "notes": [] } From 27e85df4677966f55e3a2cce2a60e7eca0da1d0e Mon Sep 17 00:00:00 2001 From: CanbiZ <47820557+MickLesk@users.noreply.github.com> Date: Sat, 26 Apr 2025 21:15:48 +0200 Subject: [PATCH 09/11] Update frontend/public/json/librespeed.json MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: Slaviša Arežina <58952836+tremor021@users.noreply.github.com> --- frontend/public/json/librespeed.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/frontend/public/json/librespeed.json b/frontend/public/json/librespeed.json index 2ae9ced..3f717ed 100644 --- a/frontend/public/json/librespeed.json +++ b/frontend/public/json/librespeed.json @@ -9,7 +9,7 @@ "updateable": true, "privileged": false, "interface_port": 80, - "documentation": null, + "documentation": "https://github.com/librespeed/speedtest/blob/master/doc.md", "config_path": "", "website": null, "logo": "https://github.com/librespeed/speedtest/blob/master/.logo/icon_huge.png", From f90237b55df3c362db13dfc9c518c2f05ce1fb37 Mon Sep 17 00:00:00 2001 From: CanbiZ <47820557+MickLesk@users.noreply.github.com> Date: Sat, 26 Apr 2025 21:15:55 +0200 Subject: [PATCH 10/11] Update frontend/public/json/librespeed.json MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: Slaviša Arežina <58952836+tremor021@users.noreply.github.com> --- frontend/public/json/librespeed.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/frontend/public/json/librespeed.json b/frontend/public/json/librespeed.json index 3f717ed..8be8b80 100644 --- a/frontend/public/json/librespeed.json +++ b/frontend/public/json/librespeed.json @@ -11,7 +11,7 @@ "interface_port": 80, "documentation": "https://github.com/librespeed/speedtest/blob/master/doc.md", "config_path": "", - "website": null, + "website": "https://librespeed.org", "logo": "https://github.com/librespeed/speedtest/blob/master/.logo/icon_huge.png", "description": "No Flash, No Java, No Websocket, No Bullshit. This is a very lightweight speed test implemented in Javascript, using XMLHttpRequest and Web Workers.", "install_methods": [ From 2520e5d40df55e9b5b98c38c82d0569f90a0b817 Mon Sep 17 00:00:00 2001 From: CanbiZ <47820557+MickLesk@users.noreply.github.com> Date: Sat, 26 Apr 2025 21:16:05 +0200 Subject: [PATCH 11/11] Update frontend/public/json/librespeed.json MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: Slaviša Arežina <58952836+tremor021@users.noreply.github.com> --- frontend/public/json/librespeed.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/frontend/public/json/librespeed.json b/frontend/public/json/librespeed.json index 8be8b80..c6292c5 100644 --- a/frontend/public/json/librespeed.json +++ b/frontend/public/json/librespeed.json @@ -4,7 +4,7 @@ "categories": [ 4 ], - "date_created": "2025-04-25", + "date_created": "2025-04-26", "type": "ct", "updateable": true, "privileged": false,