Fix merge issue

This commit is contained in:
Herbert Wolverson 2024-07-09 10:12:41 -05:00
commit 35d0903224
7 changed files with 33 additions and 18 deletions

View File

@ -1 +1 @@
1.4 1.5-BETA1

View File

@ -10,7 +10,7 @@ then
BUILD_DATE="" BUILD_DATE=""
fi fi
PACKAGE=libreqos PACKAGE=libreqos
VERSION=1.5.$BUILD_DATE VERSION=`cat ./VERSION_STRING`.$BUILD_DATE
PKGVERSION=$PACKAGE PKGVERSION=$PACKAGE
PKGVERSION+="_" PKGVERSION+="_"
PKGVERSION+=$VERSION PKGVERSION+=$VERSION
@ -20,7 +20,7 @@ DEBIAN_DIR=$DPKG_DIR/DEBIAN
LQOS_DIR=$DPKG_DIR/opt/libreqos/src LQOS_DIR=$DPKG_DIR/opt/libreqos/src
ETC_DIR=$DPKG_DIR/etc ETC_DIR=$DPKG_DIR/etc
MOTD_DIR=$DPKG_DIR/etc/update-motd.d MOTD_DIR=$DPKG_DIR/etc/update-motd.d
LQOS_FILES="graphInfluxDB.py influxDBdashboardTemplate.json integrationCommon.py integrationPowercode.py integrationRestHttp.py integrationSonar.py integrationSplynx.py integrationUISP.py integrationSonar.py LibreQoS.py lqos.example lqTools.py mikrotikFindIPv6.py network.example.json pythonCheck.py README.md scheduler.py ShapedDevices.example.csv lqos.example" LQOS_FILES="graphInfluxDB.py influxDBdashboardTemplate.json integrationCommon.py integrationPowercode.py integrationRestHttp.py integrationSonar.py integrationSplynx.py integrationUISP.py integrationSonar.py LibreQoS.py lqos.example lqTools.py mikrotikFindIPv6.py network.example.json pythonCheck.py README.md scheduler.py ShapedDevices.example.csv lqos.example ../requirements.txt"
LQOS_BIN_FILES="lqos_scheduler.service.example lqosd.service.example lqos_node_manager.service.example" LQOS_BIN_FILES="lqos_scheduler.service.example lqosd.service.example lqos_node_manager.service.example"
RUSTPROGS="lqosd lqtop xdp_iphash_to_cpu_cmdline xdp_pping lqos_node_manager lqusers lqos_setup lqos_map_perf uisp_integration lqos_support_tool" RUSTPROGS="lqosd lqtop xdp_iphash_to_cpu_cmdline xdp_pping lqos_node_manager lqusers lqos_setup lqos_map_perf uisp_integration lqos_support_tool"
@ -61,11 +61,8 @@ echo "#!/bin/bash" >> postinst
echo "# Install Python Dependencies" >> postinst echo "# Install Python Dependencies" >> postinst
echo "pushd /opt/libreqos" >> postinst echo "pushd /opt/libreqos" >> postinst
# - Setup Python dependencies as a post-install task # - Setup Python dependencies as a post-install task
while requirement= read -r line echo "python3 -m pip install --break-system-packages -r src/requirements.txt" >> postinst
do echo "sudo python3 -m pip install --break-system-packages -r src/requirements.txt" >> postinst
echo "python3 -m pip install $line" >> postinst
echo "sudo python3 -m pip install $line" >> postinst
done < ../../../../requirements.txt
# - Run lqsetup # - Run lqsetup
echo "/opt/libreqos/src/bin/lqos_setup" >> postinst echo "/opt/libreqos/src/bin/lqos_setup" >> postinst
# - Setup the services # - Setup the services
@ -78,6 +75,18 @@ echo "/bin/systemctl start lqosd" >> postinst
echo "/bin/systemctl start lqos_node_manager" >> postinst echo "/bin/systemctl start lqos_node_manager" >> postinst
echo "/bin/systemctl start lqos_scheduler" >> postinst echo "/bin/systemctl start lqos_scheduler" >> postinst
echo "popd" >> postinst echo "popd" >> postinst
# Attempting to fixup versioning issues with libpython.
# This requires that you already have LibreQoS installed.
LINKED_PYTHON=$(ldd /opt/libreqos/src/bin/lqosd | grep libpython | sed -e '/^[^\t]/ d' | sed -e 's/\t//' | sed -e 's/.*=..//' | sed -e 's/ (0.*)//')
echo "if ! test -f $LINKED_PYTHON; then" >> postinst
echo " if test -f /lib/x86_64-linux-gnu/libpython3.12.so.1.0; then" >> postinst
echo " ln -s /lib/x86_64-linux-gnu/libpython3.12.so.1.0 $LINKED_PYTHON" >> postinst
echo " fi" >> postinst
echo " if test -f /lib/x86_64-linux-gnu/libpython3.11.so.1.0; then" >> postinst
echo " ln -s /lib/x86_64-linux-gnu/libpython3.11.so.1.0 $LINKED_PYTHON" >> postinst
echo " fi" >> postinst
echo "fi" >> postinst
# End of symlink insanity
chmod a+x postinst chmod a+x postinst
# Uninstall Script # Uninstall Script

View File

@ -9,7 +9,7 @@
# Don't forget to setup `/etc/lqos.conf` # Don't forget to setup `/etc/lqos.conf`
# Check Pre-Requisites # Check Pre-Requisites
sudo apt install python3-pip clang gcc gcc-multilib llvm libelf-dev git nano graphviz curl screen llvm pkg-config linux-tools-common linux-tools-`uname -r` libbpf-dev libssl-dev esbuild udo apt install python3-pip clang gcc gcc-multilib llvm libelf-dev git nano graphviz curl screen llvm pkg-config linux-tools-common linux-tools-`uname -r` libbpf-dev libssl-dev esbuild
if ! rustup -V &> /dev/null if ! rustup -V &> /dev/null
then then

View File

@ -20,7 +20,7 @@ def spylnxRequest(target, headers):
# Sends a REST GET request to Spylnx and returns the # Sends a REST GET request to Spylnx and returns the
# result in JSON # result in JSON
url = splynx_api_url() + "/api/2.0/" + target url = splynx_api_url() + "/api/2.0/" + target
r = requests.get(url, headers=headers, timeout=10) r = requests.get(url, headers=headers, timeout=120)
return r.json() return r.json()
def getTariffs(headers): def getTariffs(headers):

View File

@ -166,8 +166,11 @@ fn write_combined_config(
std::fs::write("/etc/lqos.conf", raw).unwrap(); std::fs::write("/etc/lqos.conf", raw).unwrap();
} }
const VERSION: &str = include_str!("../../../VERSION_STRING");
fn main() { fn main() {
println!("{:^80}", "LibreQoS 1.4 Setup Assistant".yellow().on_blue()); let greeting = format!("LibreQoS {VERSION} Setup Assistant");
println!("{:^80}", greeting.yellow().on_blue());
println!(); println!();
let interfaces = get_available_interfaces(); let interfaces = get_available_interfaces();
let mut if_internet: Option<String> = None; let mut if_internet: Option<String> = None;

View File

@ -74,6 +74,8 @@ async fn throughput_task(
false false
}; };
let mut ticker = tokio::time::interval(Duration::from_millis(interval_ms));
ticker.set_missed_tick_behavior(tokio::time::MissedTickBehavior::Skip);
loop { loop {
let start = Instant::now(); let start = Instant::now();
@ -104,13 +106,7 @@ async fn throughput_task(
} }
tokio::spawn(submit_throughput_stats(long_term_stats_tx.clone())); tokio::spawn(submit_throughput_stats(long_term_stats_tx.clone()));
let elapsed = start.elapsed(); ticker.tick().await;
if elapsed.as_secs_f32() < 1.0 {
let sleep_duration = Duration::from_millis(interval_ms) - start.elapsed();
tokio::time::sleep(sleep_duration).await;
} else {
log::error!("Throughput monitor thread is running behind. It took {elapsed} to poll the network.", elapsed=elapsed.as_secs_f32());
}
} }
} }

View File

@ -13,6 +13,7 @@ if automatic_import_sonar():
from integrationSonar import importFromSonar from integrationSonar import importFromSonar
from apscheduler.schedulers.background import BlockingScheduler from apscheduler.schedulers.background import BlockingScheduler
from apscheduler.executors.pool import ThreadPoolExecutor from apscheduler.executors.pool import ThreadPoolExecutor
import os.path
ads = BlockingScheduler(executors={'default': ThreadPoolExecutor(1)}) ads = BlockingScheduler(executors={'default': ThreadPoolExecutor(1)})
@ -40,6 +41,12 @@ def importFromCRM():
except: except:
print("Failed to import from Sonar") print("Failed to import from Sonar")
# Post-CRM Hooks
path = get_libreqos_directory() + "/bin/post_integration_hook.sh"
binPath = get_libreqos_directory() + "/bin"
if os.path.isfile(path):
subprocess.Popen(path, cwd=binPath)
def graphHandler(): def graphHandler():
try: try:
refreshBandwidthGraphs() refreshBandwidthGraphs()