librespeed / speedtest

Self-hosted Speed Test for HTML5 and more. Easy setup, examples, configurable, mobile friendly. Supports PHP, Node, Multiple servers, and more
https://librespeed.org
GNU Lesser General Public License v3.0
12.05k stars 2.18k forks source link

Expand docker support for MSSQL telemetry #634

Open clndwhr opened 3 months ago

clndwhr commented 3 months ago

Description

Expand the docker entrypoint file to support MSSQL telemetry

Why it should be implemented

Expand the container features to match the base programs current feature set

Optional: implementation suggestions

Add the MSSQL settings to the docker entrypoint.sh file after the mysql elif block before the final else such as:

  elif  [ "$DB_TYPE" == "mssql" ]; then
    if [ "$DB_WIN_AUTH" == "" || "$DB_WIN_AUTH" == "false" ]; then
      DB_WIN_AUTH = false;
    fi
    if [ "$DB_TRUST_CERT" == "" ]; then
      DB_TRUST_CERT = true;
    fi
    if [ "$DB_USERNAME" == "" ]; then
      DB_USERNAME = "sa";
    fi
    sed -i 's/$db_type = '\''.*'\''/$db_type = '\'$DB_TYPE\''/g' /var/www/html/results/telemetry_settings.php
    sed -i 's/$MsSql_username = '\''.*'\''/$MsSql_username = '\'$DB_USERNAME\''/g' /var/www/html/results/telemetry_settings.php
    sed -i 's/$MsSql_password = '\''.*'\''/$MsSql_password = '\'$DB_PASSWORD\''/g' /var/www/html/results/telemetry_settings.php
    sed -i 's/$MsSql_server = '\''.*'\''/$MsSql_server = '\'$DB_HOSTNAME\''/g' /var/www/html/results/telemetry_settings.php
    sed -i 's/$MsSql_databasename = '\''.*'\''/$MsSql_databasename = '\'$DB_NAME\''/g' /var/www/html/results/telemetry_settings.php
    sed -i 's/$MsSql_WindowsAuthentication = '\''.*'\''/$MsSql_WindowsAuthentication = '\'$DB_WIN_AUTH\''/g' /var/www/html/results/telemetry_settings.php
    sed -i 's/$MsSql_TrustServerCertificate = '\''.*'\''/$MsSql_TrustServerCertificate = '\'$DB_TRUST_CERT\''/g' /var/www/html/results/telemetry_settings.php