From c7d94f8609c3b8aafe4c9b3234ddf029bc4d18a6 Mon Sep 17 00:00:00 2001 From: Gapodo Date: Tue, 21 Nov 2023 16:32:41 +0100 Subject: [PATCH 1/4] remove client things... --- client-api/.gitignore | 2 - client-api/api.php | 314 ------------------------- client/.gitignore | 8 - client/app/AppMain.scss | 31 --- client/app/entry-points/AppMain.ts | 4 - client/app/entry-points/ModalWindow.ts | 2 - client/app/external.d.ts | 7 - client/css/static/main.css | 30 --- client/css/static/main.css.map | 1 - client/generate_packed.sh | 23 -- client/tsconfig/dtsconfig.json | 6 - client/tsconfig/tsconfig.json | 12 - client/tsconfig/tsconfig_packed.json | 14 -- loader/app/targets/app.ts | 12 - loader/app/targets/shared.ts | 21 -- scripts/deploy_ui_files.sh | 73 ------ scripts/install_dependencies.sh | 38 --- scripts/travis/build.sh | 177 -------------- scripts/travis/deploy_docker.sh | 61 ----- scripts/travis/deploy_github.sh | 92 -------- scripts/travis/deploy_server.sh | 51 ---- scripts/travis/properties.sh | 4 - tsbaseconfig.json | 1 - webpack-client.config.ts | 27 --- 24 files changed, 1011 deletions(-) delete mode 100644 client-api/.gitignore delete mode 100644 client-api/api.php delete mode 100644 client/.gitignore delete mode 100644 client/app/AppMain.scss delete mode 100644 client/app/entry-points/AppMain.ts delete mode 100644 client/app/entry-points/ModalWindow.ts delete mode 100644 client/app/external.d.ts delete mode 100644 client/css/static/main.css delete mode 100644 client/css/static/main.css.map delete mode 100755 client/generate_packed.sh delete mode 100644 client/tsconfig/dtsconfig.json delete mode 100644 client/tsconfig/tsconfig.json delete mode 100644 client/tsconfig/tsconfig_packed.json delete mode 100755 scripts/deploy_ui_files.sh delete mode 100755 scripts/install_dependencies.sh delete mode 100755 scripts/travis/build.sh delete mode 100755 scripts/travis/deploy_docker.sh delete mode 100755 scripts/travis/deploy_github.sh delete mode 100755 scripts/travis/deploy_server.sh delete mode 100755 scripts/travis/properties.sh delete mode 100644 webpack-client.config.ts diff --git a/client-api/.gitignore b/client-api/.gitignore deleted file mode 100644 index 111d4700..00000000 --- a/client-api/.gitignore +++ /dev/null @@ -1,2 +0,0 @@ -#My local environment to deploy the files directly -environment/ \ No newline at end of file diff --git a/client-api/api.php b/client-api/api.php deleted file mode 100644 index fc05893c..00000000 --- a/client-api/api.php +++ /dev/null @@ -1,314 +0,0 @@ - false, - "msg" => $message - ])); - } - - function verifyPostSecret() { - if(!isset($_POST["secret"])) { - errorExit("Missing required information!"); - } - - $require_secret = file_get_contents(".deploy_secret"); - if($require_secret === false || strlen($require_secret) == 0) { - errorExit("Server missing secret!"); - } - - if(!is_string($_POST["secret"])) { - errorExit("Invalid secret!"); - } - - if(strcmp(trim($require_secret), trim($_POST["secret"])) !== 0) { - errorExit("Secret does not match!"); - } - } - - function handleRequest() { - if(isset($_GET) && isset($_GET["type"])) { - if ($_GET["type"] == "update-info") { - global $CLIENT_BASE_PATH; - $raw_versions = file_get_contents($CLIENT_BASE_PATH . "/version.json"); - if($raw_versions === false) { - errorExit("Missing file!"); - } - - $versions = json_decode($raw_versions, true); - $versions["success"] = true; - - die(json_encode($versions)); - } - else if ($_GET["type"] == "update-download") { - global $CLIENT_BASE_PATH; - - $path = $CLIENT_BASE_PATH . $_GET["channel"] . DIRECTORY_SEPARATOR . $_GET["version"] . DIRECTORY_SEPARATOR; - $raw_release_info = file_get_contents($path . "info.json"); - if($raw_release_info === false) { - errorExit("missing info file (version and/or channel missing. Path was " . $path . ")"); - } - $release_info = json_decode($raw_release_info); - - foreach($release_info as $platform) { - if($platform->platform != $_GET["platform"]) continue; - if($platform->arch != $_GET["arch"]) continue; - - http_response_code(200); - header("Cache-Control: public"); // needed for internet explorer - header("Content-Type: application/binary"); - header("Content-Transfer-Encoding: Binary"); - header("Content-Length:".filesize($path . $platform->update)); - header("Content-Disposition: attachment; filename=update.tar.gz"); - header("info-version: 1"); - readfile($path . $platform->update); - die(); - } - errorExit("Missing platform, arch or file"); - } - else if ($_GET["type"] == "ui-info") { - global $UI_BASE_PATH; - - $version_info = file_get_contents($UI_BASE_PATH . "info.json"); - if($version_info === false) $version_info = array(); - else $version_info = json_decode($version_info, true); - - $info = array(); - $info["success"] = true; - $info["versions"] = array(); - - foreach($version_info as $channel => $data) { - if(!isset($data["latest"])) continue; - - $channel_info = [ - "timestamp" => $data["latest"]["timestamp"], - "version" => $data["latest"]["version"], - "git-ref" => $data["latest"]["git-ref"], - "channel" => $channel, - "required_client" => $data["latest"]["required_client"] - ]; - array_push($info["versions"], $channel_info); - } - - die(json_encode($info)); - } else if ($_GET["type"] == "ui-download") { - global $UI_BASE_PATH; - - if(!isset($_GET["channel"]) || !isset($_GET["version"])) - errorExit("missing required parameters"); - - if($_GET["version"] !== "latest" && !isset($_GET["git-ref"])) - errorExit("missing required parameters"); - - $version_info = file_get_contents($UI_BASE_PATH . "info.json"); - if($version_info === false) $version_info = array(); - else $version_info = json_decode($version_info, true); - - $channel_data = $version_info[$_GET["channel"]]; - if(!isset($channel_data)) - errorExit("channel unknown"); - - $ui_pack = false; - if($_GET["version"] === "latest") { - $ui_pack = $channel_data["latest"]; - } else { - foreach ($channel_data["history"] as $entry) { - if($entry["version"] == $_GET["version"] && $entry["git-ref"] == $_GET["git-ref"]) { - $ui_pack = $entry; - break; - } - } - } - if($ui_pack === false) - errorExit("missing version"); - - - header("Cache-Control: public"); // needed for internet explorer - header("Content-Type: application/binary"); - header("Content-Transfer-Encoding: Binary"); - header("Content-Disposition: attachment; filename=ui.tar.gz"); - header("info-version: 1"); - - header("x-ui-timestamp: " . $ui_pack["timestamp"]); - header("x-ui-version: " . $ui_pack["version"]); - header("x-ui-git-ref: " . $ui_pack["git-ref"]); - header("x-ui-required_client: " . $ui_pack["required_client"]); - - $read = readfile($ui_pack["file"]); - header("Content-Length:" . $read); - - if($read === false) errorExit("internal error: Failed to read file!"); - die(); - } - } - else if($_POST["type"] == "deploy-build") { - global $CLIENT_BASE_PATH; - - if(!isset($_POST["version"]) || !isset($_POST["platform"]) || !isset($_POST["arch"]) || !isset($_POST["update_suffix"]) || !isset($_POST["installer_suffix"])) { - errorExit("Missing required information!"); - } - - verifyPostSecret(); - - if(!isset($_FILES["update"])) { - errorExit("Missing update file"); - } - - if($_FILES["update"]["error"] !== UPLOAD_ERR_OK) { - errorExit("Upload for update failed!"); - } - - if(!isset($_FILES["installer"])) { - errorExit("Missing installer file"); - } - - if($_FILES["installer"]["error"] !== UPLOAD_ERR_OK) { - errorExit("Upload for installer failed!"); - } - - $json_version = json_decode($_POST["version"], true); - $version = $json_version["major"] . "." . $json_version["minor"] . "." . $json_version["patch"] . ($json_version["build"] > 0 ? "-" . $json_version["build"] : ""); - $path = $CLIENT_BASE_PATH . DIRECTORY_SEPARATOR . $_POST["channel"] . DIRECTORY_SEPARATOR . $version . DIRECTORY_SEPARATOR; - exec("mkdir -p " . $path); - //mkdir($path, 777, true); - - - $filename_update = "TeaClient-" . $_POST["platform"] . "_" . $_POST["arch"] . "." . $_POST["update_suffix"]; - $filename_install = "TeaClient-" . $_POST["platform"] . "_" . $_POST["arch"] . "." . $_POST["installer_suffix"]; - - { - $version_info = file_get_contents($path . "info.json"); - if($version_info === false) { - $version_info = array(); - } else { - $version_info = json_decode($version_info, true); - if($version_info === false) { - errorExit("Failed to decode old versions info file"); - } - } - - for($index = 0; $index < count($version_info); $index++) { - if($version_info[$index]["platform"] == $_POST["platform"] && $version_info[$index]["arch"] == $_POST["arch"]) { - array_splice($version_info, $index, 1); - break; - } - } - - $info = array(); - $info["platform"] = $_POST["platform"]; - $info["arch"] = $_POST["arch"]; - $info["update"] = $filename_update; - $info["install"] = $filename_install; - array_push($version_info, $info); - file_put_contents($path . "info.json", json_encode($version_info)); - } - - { - $filename = $CLIENT_BASE_PATH . DIRECTORY_SEPARATOR . "version.json"; - $indexes = file_get_contents($filename); - if($indexes === false) { - $indexes = array(); - } else { - $indexes = json_decode($indexes, true); - if($indexes === false) { - errorExit("Failed to decode old latest versions info file"); - } - } - - $index = &$indexes[$_POST["channel"]]; - if(!isset($index)) { - $index = array(); - } - - for($idx = 0; $idx < count($index); $idx++) { - if($index[$idx]["platform"] == $_POST["platform"] && $index[$idx]["arch"] == $_POST["arch"]) { - array_splice($index, $idx, 1); - break; - } - } - - $info = array(); - $info["platform"] = $_POST["platform"]; - $info["arch"] = $_POST["arch"]; - $info["version"] = $json_version; - array_push($index, $info); - - file_put_contents($filename, json_encode($indexes)); - } - - move_uploaded_file($_FILES["installer"]["tmp_name"],$path . $filename_install); - move_uploaded_file($_FILES["update"]["tmp_name"],$path . $filename_update); - - die(json_encode([ - "success" => true - ])); - } - else if($_POST["type"] == "deploy-ui-build") { - global $UI_BASE_PATH; - - if(!isset($_POST["channel"]) || !isset($_POST["version"]) || !isset($_POST["git_ref"]) || !isset($_POST["required_client"])) { - errorExit("Missing required information!"); - } - - verifyPostSecret(); - - $path = $UI_BASE_PATH . DIRECTORY_SEPARATOR; - $channeled_path = $UI_BASE_PATH . DIRECTORY_SEPARATOR . $_POST["channel"]; - $filename = "TeaClientUI-" . $_POST["version"] . "_" . $_POST["git_ref"] . ".tar.gz"; - exec("mkdir -p " . $path); - exec("mkdir -p " . $channeled_path); - - { - $info = file_get_contents($path . "info.json"); - if($info === false) { - $info = array(); - } else { - $info = json_decode($info, true); - if($info === false) { - errorExit("failed to decode old info file"); - } - } - - $channel_info = &$info[$_POST["channel"]]; - if(!$channel_info) { - $channel_info = array(); - } - - $entry = [ - "timestamp" => time(), - "file" => $channeled_path . DIRECTORY_SEPARATOR . $filename, - "version" => $_POST["version"], - "git-ref" => $_POST["git_ref"], - "required_client" => $_POST["required_client"] - ]; - - $channel_info["latest"] = $entry; - if(!$channel_info["history"]) $channel_info["history"] = array(); - array_push($channel_info["history"], $entry); - - file_put_contents($path . "info.json", json_encode($info)); - } - - - move_uploaded_file($_FILES["file"]["tmp_name"],$channeled_path . DIRECTORY_SEPARATOR . $filename); - die(json_encode([ - "success" => true - ])); - } - else die(json_encode([ - "success" => false, - "error" => "invalid action!" - ])); - } - - handleRequest(); diff --git a/client/.gitignore b/client/.gitignore deleted file mode 100644 index f68a2273..00000000 --- a/client/.gitignore +++ /dev/null @@ -1,8 +0,0 @@ -app/**/*.css -app/**/*.css.map - -app/**/*.js -app/**/*.js.map - -declarations/ -generated/ \ No newline at end of file diff --git a/client/app/AppMain.scss b/client/app/AppMain.scss deleted file mode 100644 index 83105f86..00000000 --- a/client/app/AppMain.scss +++ /dev/null @@ -1,31 +0,0 @@ -:global { - html, body { - border: 0; - margin: 0; - } - - .app-container { - right: 0; - left: 0; - top: 0; - bottom: 0; - - width: 100%; - height: 100%; - position: absolute; - display: flex; - justify-content: stretch; - - .app { - width: 100%; - height: 100%; - margin: 0; - - display: flex; flex-direction: column; resize: both; - } - } - - footer { - display: none!important; - } -} \ No newline at end of file diff --git a/client/app/entry-points/AppMain.ts b/client/app/entry-points/AppMain.ts deleted file mode 100644 index b248c848..00000000 --- a/client/app/entry-points/AppMain.ts +++ /dev/null @@ -1,4 +0,0 @@ -window.__native_client_init_shared(__webpack_require__); - -import "../AppMain.scss"; -import "tc-shared/entry-points/MainApp"; \ No newline at end of file diff --git a/client/app/entry-points/ModalWindow.ts b/client/app/entry-points/ModalWindow.ts deleted file mode 100644 index 0c08ce71..00000000 --- a/client/app/entry-points/ModalWindow.ts +++ /dev/null @@ -1,2 +0,0 @@ -window.__native_client_init_shared(__webpack_require__); -import "tc-shared/entry-points/ModalWindow"; \ No newline at end of file diff --git a/client/app/external.d.ts b/client/app/external.d.ts deleted file mode 100644 index 7a3e45af..00000000 --- a/client/app/external.d.ts +++ /dev/null @@ -1,7 +0,0 @@ -interface Window { - __native_client_init_hook: () => void; - __native_client_init_shared: (webpackRequire: any) => void; -} - -declare const __teaclient_preview_notice: any; -declare const __teaclient_preview_error: any; \ No newline at end of file diff --git a/client/css/static/main.css b/client/css/static/main.css deleted file mode 100644 index 356a89e4..00000000 --- a/client/css/static/main.css +++ /dev/null @@ -1,30 +0,0 @@ -html, body { - border: 0; - margin: 0; -} - -.app-container { - right: 0; - left: 0; - top: 0; - bottom: 0; - width: 100%; - height: 100%; - position: absolute; - display: flex; - justify-content: stretch; -} -.app-container .app { - width: 100%; - height: 100%; - margin: 0; - display: flex; - flex-direction: column; - resize: both; -} - -footer { - display: none !important; -} - -/*# sourceMappingURL=main.css.map */ diff --git a/client/css/static/main.css.map b/client/css/static/main.css.map deleted file mode 100644 index eb78f7c0..00000000 --- a/client/css/static/main.css.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"sourceRoot":"","sources":["main.scss"],"names":[],"mappings":"AAAA;EACC;EACA;;;AAGD;EACC;EACA;EACA;EACA;EAEA;EACA;EACA;EACA;EACA;;AAEA;EACC;EACA;EACA;EAEA;EAAe;EAAwB;;;AAIzC;EACC","file":"main.css"} \ No newline at end of file diff --git a/client/generate_packed.sh b/client/generate_packed.sh deleted file mode 100755 index 27dd7155..00000000 --- a/client/generate_packed.sh +++ /dev/null @@ -1,23 +0,0 @@ -#!/usr/bin/env bash - -BASEDIR=$(dirname "$0") -cd "$BASEDIR" -source ../scripts/resolve_commands.sh - -if [[ ! -e declarations/imports_shared.d.ts ]]; then - echo "generate the declarations first!" - echo "Execute: /scripts/build_declarations.sh" - exit 1 -fi - -if [[ ! -e ../shared/generated/shared.js ]]; then - echo "generate the shared packed file first!" - echo "Execute: /shared/generate_packed.sh" - exit 1 -fi - -execute_tsc -p tsconfig/tsconfig_packed.json -if [[ $? -ne 0 ]]; then - echo "Failed to build file" - exit 1 -fi \ No newline at end of file diff --git a/client/tsconfig/dtsconfig.json b/client/tsconfig/dtsconfig.json deleted file mode 100644 index 638d0b08..00000000 --- a/client/tsconfig/dtsconfig.json +++ /dev/null @@ -1,6 +0,0 @@ -{ - "source_files": [ - "../js/**/*.ts" - ], - "target_file": "../declarations/exports.d.ts" -} \ No newline at end of file diff --git a/client/tsconfig/tsconfig.json b/client/tsconfig/tsconfig.json deleted file mode 100644 index 6a450df4..00000000 --- a/client/tsconfig/tsconfig.json +++ /dev/null @@ -1,12 +0,0 @@ -/* general web project config */ -{ - "compilerOptions": { - "target": "es6", - "module": "commonjs", - "sourceMap": true - }, - "include": [ - "../declarations/imports_*.d.ts", - "../js/**/*.ts" - ] -} \ No newline at end of file diff --git a/client/tsconfig/tsconfig_packed.json b/client/tsconfig/tsconfig_packed.json deleted file mode 100644 index 9f42a081..00000000 --- a/client/tsconfig/tsconfig_packed.json +++ /dev/null @@ -1,14 +0,0 @@ -/* packed web project config */ -{ - "extends": "./tsconfig.json", - "compilerOptions": { - "module": "none", - "outFile": "../generated/client.js", - "allowJs": true - }, - "include": [ - "../declarations/imports_*.d.ts", - "../js/**/*.ts", - "../../shared/generated/shared.js" - ] -} \ No newline at end of file diff --git a/loader/app/targets/app.ts b/loader/app/targets/app.ts index 40bb5056..2b908952 100644 --- a/loader/app/targets/app.ts +++ b/loader/app/targets/app.ts @@ -51,18 +51,6 @@ loader.register_task(loader.Stage.SETUP, { priority: 10 }); -/* test if we're getting loaded within a TeaClient preview window */ -loader.register_task(loader.Stage.SETUP, { - name: "TeaClient tester", - function: async () => { - if(typeof __teaclient_preview_notice !== "undefined" && typeof __teaclient_preview_error !== "undefined") { - loader.critical_error("Why you're opening TeaWeb within the TeaSpeak client?!"); - throw "we're already a TeaClient!"; - } - }, - priority: 100 -}); - export default class implements ApplicationLoader { execute() { loader.execute_managed(true); diff --git a/loader/app/targets/shared.ts b/loader/app/targets/shared.ts index dbab4e21..16a8fa43 100644 --- a/loader/app/targets/shared.ts +++ b/loader/app/targets/shared.ts @@ -2,27 +2,6 @@ import * as loader from "../loader/loader"; import {Stage} from "../loader/loader"; import {detect as detectBrowser} from "detect-browser"; -loader.register_task(Stage.SETUP, { - name: "app init", - function: async () => { - /* TeaClient */ - if(window.require || window.__native_client_init_hook) { - if(__build.target !== "client") { - loader.critical_error("App seems not to be compiled for the client.", "This app has been compiled for " + __build.target); - return; - } - - window.__native_client_init_hook(); - } else { - if(__build.target !== "web") { - loader.critical_error("App seems not to be compiled for the web.", "This app has been compiled for " + __build.target); - return; - } - } - }, - priority: 1000 -}); - loader.register_task(Stage.SETUP, { name: __build.target === "web" ? "outdated browser checker" : "outdated renderer tester", function: async () => { diff --git a/scripts/deploy_ui_files.sh b/scripts/deploy_ui_files.sh deleted file mode 100755 index f2db2a70..00000000 --- a/scripts/deploy_ui_files.sh +++ /dev/null @@ -1,73 +0,0 @@ -#!/usr/bin/env bash - -# Example usage: ./scripts/deploy_ui_files.sh http://dev.clientapi.teaspeak.de/api.php test 1.1.0 - -cd "$(dirname "$0")" || { echo "failed to enter base directory"; exit 1; } -source "./helper.sh" - -if [[ "$#" -ne 3 ]]; then - echo "Illegal number of parameters (url | channel | required version)" - exit 1 -fi - -# shellcheck disable=SC2154 -if [[ "${teaclient_deploy_secret}" == "" ]]; then - echo "Missing deploy secret!" - exit 1 -fi - -package_file=$(find_release_package "client" "release") -if [[ $? -ne 0 ]]; then - echo "$package_file" - exit 1 -fi - -# We require a .tar.gz file and not a zip file. -# So we're extracting the contents and tar.gz ing them -temp_dir=$(mktemp -d) -unzip "$package_file" -d "$temp_dir/raw/" -if [[ $? -ne 0 ]]; then - rm -r "$temp_dir" &>/dev/null - echo "Failed to unpack package." - exit 1 -fi - -echo "Generating .tar.gz file from $package_file" -package_file="$temp_dir/$(basename -s ".zip" "$package_file").tar.gz" -tar --use-compress-program="gzip -9" -C "$temp_dir/raw/" -c . -cf "$package_file"; -if [[ $? -ne 0 ]]; then - rm -r "$temp_dir" - echo "Failed to package package." - exit 1 -fi - -git_hash=$(git_version "short-tag") -application_version=$(project_version) -echo "Deploying $package_file." -echo "Hash: ${git_hash}, Version: ${application_version}, Target channel: $2." - -upload_result=$(curl \ - -k \ - -X POST \ - -F "required_client=$3" \ - -F "type=deploy-ui-build" \ - -F "channel=$2" \ - -F "version=$application_version" \ - -F "git_ref=$git_hash" \ - -F "secret=${teaclient_deploy_secret}" \ - -F "file=@$package_file" \ - "$1" -) - -rm -r "$temp_dir" -echo "Server upload result: $upload_result" -success=$(echo "${upload_result}" | python -c "import sys, json; print(json.load(sys.stdin)['success'])") - -if [[ ! "${success}" == "True" ]]; then - error_message=$(echo "${upload_result}" | python -c "import sys, json; print(json.load(sys.stdin)['msg'])" 2>/dev/null); - echo "Failed to deploy build: ${error_message}" - exit 1 -else - echo "Build successfully deployed!" - exit 0 -fi \ No newline at end of file diff --git a/scripts/install_dependencies.sh b/scripts/install_dependencies.sh deleted file mode 100755 index 0095640a..00000000 --- a/scripts/install_dependencies.sh +++ /dev/null @@ -1,38 +0,0 @@ -#!/usr/bin/env bash - -install_sys_deps() { - # shellcheck disable=SC2207 - curl_version=($(curl --version 2>/dev/null)) - - # shellcheck disable=SC2181 - if [[ $? -ne 0 ]]; then - echo "> Missing curl. Please install it." - exit 1 - fi - echo "> Found curl ${curl_version[1]}" -} - -install_node() { - node_version=$(node --version 2>/dev/null) - # shellcheck disable=SC2181 - if [[ $? -ne 0 ]]; then - echo "> Missing node. We can't currently install it automatically." - echo "> Please download the latest version here: https://nodejs.org/en/download/" - exit 1 - else - echo "> Found node $node_version" - fi - - npm_version=$(npm --version 2>/dev/null) - # shellcheck disable=SC2181 - if [[ $? -ne 0 ]]; then - echo "> Missing npm. Please ensure you've correctly installed node." - echo "> You may need to add npm manually to your PATH variable." - exit 1 - else - echo "> Found npm $npm_version" - fi -} - -install_sys_deps -install_node \ No newline at end of file diff --git a/scripts/travis/build.sh b/scripts/travis/build.sh deleted file mode 100755 index 5be4935f..00000000 --- a/scripts/travis/build.sh +++ /dev/null @@ -1,177 +0,0 @@ -#!/bin/bash - -cd "$(dirname "$0")/../../" || { echo "Failed to enter base dir"; exit 1; } -source ./scripts/travis/properties.sh - -build_verbose=0 -build_release=1 -build_debug=0 - -function print_help() { - echo "Possible arguments:" - echo " --verbose=[yes|no] | Enable verbose build output (Default: $build_verbose)" - echo " --enable-release=[yes|no] | Enable release build (Default: $build_release)" - echo " --enable-debug=[yes|no] | Enable debug build (Default: $build_debug)" -} - -function parse_arguments() { - # Preprocess the help parameter - for argument in "$@"; do - if [[ "$argument" = "--help" ]] || [[ "$argument" = "-h" ]]; then - print_help - exit 1 - fi - done - - shopt -s nocasematch - for argument in "$@"; do - echo "Argument: $argument" - if [[ "$argument" =~ ^--verbose(=(y|1)?[[:alnum:]]*$)?$ ]]; then - build_verbose=0 - if [[ -z "${BASH_REMATCH[1]}" ]] || [[ -n "${BASH_REMATCH[2]}" ]]; then - build_verbose=1 - fi - - if [[ ${build_verbose} ]]; then - echo "Enabled verbose output" - fi - elif [[ "$argument" =~ ^--enable-release(=(y|1)?[[:alnum:]]*$)?$ ]]; then - build_release=0 - if [[ -z "${BASH_REMATCH[1]}" ]] || [[ -n "${BASH_REMATCH[2]}" ]]; then - build_release=1 - fi - - if [[ ${build_release} ]]; then - echo "Enabled release build!" - fi - elif [[ "$argument" =~ ^--enable-debug(=(y|1)?[[:alnum:]]*$)?$ ]]; then - build_debug=0 - if [[ -z "${BASH_REMATCH[1]}" ]] || [[ -n "${BASH_REMATCH[2]}" ]]; then - build_debug=1 - fi - - if [[ ${build_debug} ]]; then - echo "Enabled debug build!" - fi - fi - done -} - -function execute() { - time_begin=$(date +%s%N) - - echo "> Executing step: $1" >> "${LOG_FILE}" - echo -e "\e[32m> Executing step: $1\e[0m" - #Execute the command - for command in "${@:3}"; do - echo "$> $command" >> "${LOG_FILE}" - if [[ ${build_verbose} -gt 0 ]]; then - echo "$> $command" - fi - - error="" - if [[ ${build_verbose} -gt 0 ]]; then - if [[ -f ${LOG_FILE}.tmp ]]; then - rm "${LOG_FILE}.tmp" - fi - ${command} |& tee "${LOG_FILE}.tmp" | grep -E '^[^(/\S*/libstdc++.so\S*: no version information available)].*' - - error_code=${PIPESTATUS[0]} - error=$(cat "${LOG_FILE}.tmp") - cat "${LOG_FILE}.tmp" >> "${LOG_FILE}" - rm "${LOG_FILE}.tmp" - else - error=$(${command} 2>&1) - error_code=$? - echo "$error" >> "${LOG_FILE}" - fi - - - if [[ ${error_code} -ne 0 ]]; then - break - fi - done - - #Log the result - time_end=$(date +%s%N) - time_needed=$((time_end - time_begin)) - time_needed_ms=$((time_needed / 1000000)) - step_color="\e[32m" - [[ ${error_code} -ne 0 ]] && step_color="\e[31m" - echo "$step_color> Step took ${time_needed_ms}ms" >> ${LOG_FILE} - echo -e "$step_color> Step took ${time_needed_ms}ms\e[0m" - - if [[ ${error_code} -ne 0 ]]; then - handle_failure ${error_code} "$2" - fi - - error="" -} - -function handle_failure() { - # We cut of the nasty "node: /usr/lib/libstdc++.so.6: no version information available (required by node)" message - echo "--------------------------- [ERROR] ---------------------------" - echo "We've encountered an fatal error, which isn't recoverable!" - echo " Aborting build process!" - echo "" - echo "Exit code : $1" - echo "Error message: ${*:2}" - if [[ ${build_verbose} -eq 0 ]] && [[ "$error" != "" ]]; then - echo "Command log : (lookup \"${LOG_FILE}\" for detailed output!)" - echo "$error" - fi - echo "--------------------------- [ERROR] ---------------------------" - exit 1 -} - -cd "$(dirname "$0")/../../" || { echo "Failed to enter base dir"; exit 1; } -error="" - -LOG_FILE="$(pwd)/$LOG_FILE" -if [[ ! -d $(dirname "${LOG_FILE}") ]]; then - mkdir -p "$(dirname "${LOG_FILE}")" -fi - -if [[ $# -eq 0 ]]; then - echo "Executing build scripts with no arguments" -else - echo "Executing build scripts with arguments: $* ($#)" -fi -if [[ "$1" == "bash" ]]; then - bash - exit 0 -fi - -parse_arguments "${@:1}" - -if [[ -e "$LOG_FILE" ]]; then - rm "$LOG_FILE" -fi - -echo "---------- Setup ----------" -chmod +x ./scripts/install_dependencies.sh -source ./scripts/install_dependencies.sh - -echo "---------- Web client ----------" - -function execute_build_release() { - execute \ - "Building release package" \ - "Failed to build release" \ - "./scripts/build.sh web release" -} -function execute_build_debug() { - execute \ - "Building debug package" \ - "Failed to build debug" \ - "./scripts/build.sh web dev" -} - -chmod +x ./scripts/build.sh -if [[ ${build_release} ]]; then - execute_build_release -fi -if [[ ${build_debug} ]]; then - execute_build_debug -fi -exit 0 \ No newline at end of file diff --git a/scripts/travis/deploy_docker.sh b/scripts/travis/deploy_docker.sh deleted file mode 100755 index 71b338c8..00000000 --- a/scripts/travis/deploy_docker.sh +++ /dev/null @@ -1,61 +0,0 @@ -#!/usr/bin/env bash - -cd "$(dirname "$0")/../../" || { echo "Failed to enter base dir"; exit 1; } -source ./scripts/travis/properties.sh -source ./scripts/helper.sh - -git_rev=$(git_version "short-tag") -if [[ "$1" == "release" ]]; then - echo "Releasing $git_rev as release" - rolling_tag="latest" -elif [[ "$1" == "development" ]]; then - echo "Releasing $git_rev as beta release" - rolling_tag="beta" -else - echo "Invalid release mode" - exit 1 -fi - -# FIXME: This dosn't work anymore -zip_file=$(find "$PACKAGES_DIRECTORY" -maxdepth 1 -name "TeaWeb-release*.zip" -print) -[[ $(echo "$zip_file" | wc -l) -ne 1 ]] && { - echo "Invalid .zip file count (Expected 1 but got $(echo "$zip_file" | wc -l)): ${zip_file[*]}" - exit 1 -} -[[ ! -e "$zip_file" ]] && { - echo "File ($zip_file) does not exists" - exit 1 -} - -git clone https://github.com/TeaSpeak/TeaDocker.git auto-build/teadocker || { - echo "Failed to clone the TeaDocker project" - exit 1 -} - -cp "$zip_file" auto-build/teadocker/web/TeaWeb-release.zip || { - echo "Failed to copy Docker webclient files to the docker files build context" - exit 1 -} - -docker build -f auto-build/teadocker/web/travis.Dockerfile --build-arg WEB_VERSION="$git_rev" --build-arg WEB_ZIP=TeaWeb-release.zip -t teaspeak/web:"$rolling_tag" auto-build/teadocker/web || { - echo "Failed to build dockerfile" - exit 1 -} - -docker tag teaspeak/web:"$rolling_tag" teaspeak/web:"$git_rev" || { - echo "Failed to tag docker release" - exit 1 -} - -docker login -u "$DOCKERHUB_USER" -p "$DOCKERHUB_TOKEN" || { - echo "Failed to login to docker hub" - exit 1 -} - -docker push teaspeak/web || { - echo "Failed to push new teaspeak/web tags" - exit 1 -} -docker logout # &> /dev/null - -exit 0 \ No newline at end of file diff --git a/scripts/travis/deploy_github.sh b/scripts/travis/deploy_github.sh deleted file mode 100755 index 4c93a1c4..00000000 --- a/scripts/travis/deploy_github.sh +++ /dev/null @@ -1,92 +0,0 @@ -#!/usr/bin/env bash - -cd "$(dirname "$0")/../../" || { - echo "Failed to enter base dir" - exit 1 -} -source ./scripts/travis/properties.sh -source ./scripts/helper.sh - -if [[ -z "${GIT_AUTHTOKEN}" ]]; then - echo "GIT_AUTHTOKEN isn't set. Don't deploying build!" - exit 0 -fi - -git_release_executable="/tmp/git-release" -install_git_release() { - if [[ -x "${git_release_executable}" ]]; then - # File already available. No need to install it. - return 0 - fi - - if [[ ! -f ${git_release_executable} ]]; then - echo "Downloading github-release-linux (1.2.4)" - - if [[ -f /tmp/git-release.gz ]]; then - rm /tmp/git-release.gz - fi - wget https://github.com/tfausak/github-release/releases/download/1.2.4/github-release-linux.gz -O /tmp/git-release.gz -q - [[ $? -eq 0 ]] || { - echo "Failed to download github-release-linux" - exit 1 - } - - gunzip /tmp/git-release.gz - _exit_code=$? - [[ $_exit_code -eq 0 ]] || { - echo "Failed to unzip github-release-linux" - exit 1 - } - chmod +x /tmp/git-release - - echo "Download of github-release-linux (1.2.4) finished" - else - chmod +x ${git_release_executable} - fi - - if [[ ! -x ${git_release_executable} ]]; then - echo "git-release isn't executable" - exit 1 - fi -} -install_git_release - -git_versions_tag=$(git_version "short-tag") -echo "Deploying $git_versions_tag ($(git_version "long-tag")) to GitHub." - -echo "Generating release tag" -${git_release_executable} release \ - --repo "TeaWeb" \ - --owner "TeaSpeak" \ - --token "${GIT_AUTHTOKEN}" \ - --title "Travis auto build $git_versions_tag" \ - --tag "$git_versions_tag" \ - --description "This is a auto build release from travis" - -[[ $? -eq 0 ]] || { - echo "Failed to generate git release" - exit 1 -} - -upload_package() { - local package_file - package_file=$(find_release_package "web" "$1") - if [[ $? -eq 0 ]]; then - echo "Uploading $1 package ($package_file)" - ${git_release_executable} upload \ - --repo "TeaWeb" \ - --owner "TeaSpeak" \ - --token "${GIT_AUTHTOKEN}" \ - --tag "$git_versions_tag" \ - --file "$package_file" \ - --name "$(basename "$package_file")" - - echo "Successfully uploaded $1 package" - else - echo "Skipping $1 package upload: $package_file" - fi -} - -upload_package "development" -upload_package "release" -exit 0 diff --git a/scripts/travis/deploy_server.sh b/scripts/travis/deploy_server.sh deleted file mode 100755 index 92ebddaf..00000000 --- a/scripts/travis/deploy_server.sh +++ /dev/null @@ -1,51 +0,0 @@ -#!/usr/bin/env bash - -if [[ -z "$1" ]]; then - echo "Missing deploy channel" - exit 1 -fi - -cd "$(dirname "$0")/../../" || { - echo "Failed to enter base dir" - exit 1 -} -source ./scripts/travis/properties.sh -source ./scripts/helper.sh - -if [[ -z "${SSH_KEY}" ]]; then - echo "Missing environment variable SSH_KEY. Please set it before using this script!" - exit 1 -fi -echo "${SSH_KEY}" | base64 --decode > /tmp/sftp_key -chmod 600 /tmp/sftp_key - -[[ $? -ne 0 ]] && { - echo "Failed to write SSH key" - exit 1 -} - - -package_file=$(find_release_package "web" "release") -if [[ $? -ne 0 ]]; then - echo "$package_file" - exit 1 -fi - -upload_name=$(basename "$package_file") -ssh -oStrictHostKeyChecking=no -oIdentitiesOnly=yes -i /tmp/sftp_key TeaSpeak-Travis-Web@web.teaspeak.dev rm "tmp-upload/*.zip" # Cleanup the old files -_exit_code=$? -[[ $_exit_code -ne 0 ]] && { - echo "Failed to delete the old .zip files ($_exit_code)" -} - -sftp -oStrictHostKeyChecking=no -oIdentitiesOnly=yes -i /tmp/sftp_key TeaSpeak-Travis-Web@web.teaspeak.dev << EOF - put $package_file tmp-upload/$upload_name -EOF -_exit_code=$? -[[ $_exit_code -ne 0 ]] && { - echo "Failed to upload the .zip file ($_exit_code)" - exit 1 -} - -ssh -oStrictHostKeyChecking=no -oIdentitiesOnly=yes -i /tmp/sftp_key TeaSpeak-Travis-Web@web.teaspeak.dev "./unpack.sh $1 tmp-upload/$upload_name" -exit $? \ No newline at end of file diff --git a/scripts/travis/properties.sh b/scripts/travis/properties.sh deleted file mode 100755 index ed059bf2..00000000 --- a/scripts/travis/properties.sh +++ /dev/null @@ -1,4 +0,0 @@ -#!/usr/bin/env sh - -LOG_FILE="auto-build/logs/build.log" -PACKAGES_DIRECTORY="auto-build/packages/" \ No newline at end of file diff --git a/tsbaseconfig.json b/tsbaseconfig.json index a76d8dee..225a5b51 100644 --- a/tsbaseconfig.json +++ b/tsbaseconfig.json @@ -14,7 +14,6 @@ }, "include": [ "webpack.config.ts", - "webpack-client.config.ts", "webpack-web.config.ts", "webpack/build-definitions.d.ts", "webpack/HtmlWebpackInlineSource.ts", diff --git a/webpack-client.config.ts b/webpack-client.config.ts deleted file mode 100644 index 1c3ee1b3..00000000 --- a/webpack-client.config.ts +++ /dev/null @@ -1,27 +0,0 @@ -import * as path from "path"; -import * as config_base from "./webpack.config"; - -export = env => config_base.config(env, "client").then(config => { - Object.assign(config.entry, { - "main-app": ["./client/app/entry-points/AppMain.ts"], - "modal-external": ["./client/app/entry-points/ModalWindow.ts"] - }); - - Object.assign(config.resolve.alias, { - "tc-shared": path.resolve(__dirname, "shared/js"), - }); - - if(!Array.isArray(config.externals)) { - throw "invalid config"; - } - - config.externals.push(({ context, request }, callback) => { - if (request.startsWith("tc-backend/")) { - return callback(null, `window["backend-loader"].require("${request}")`); - } - - callback(undefined, undefined); - }); - - return Promise.resolve(config); -}); \ No newline at end of file From 7ea42718102a070c78503e6d3f00975d53a9cff0 Mon Sep 17 00:00:00 2001 From: Gapodo Date: Tue, 21 Nov 2023 16:41:47 +0100 Subject: [PATCH 2/4] use prebuilt base image --- docker/Dockerfile.ci | 19 +------------------ 1 file changed, 1 insertion(+), 18 deletions(-) diff --git a/docker/Dockerfile.ci b/docker/Dockerfile.ci index a88f0e6a..dd522e43 100644 --- a/docker/Dockerfile.ci +++ b/docker/Dockerfile.ci @@ -1,19 +1,2 @@ -FROM nginx:mainline-alpine - -COPY ./docker/default.conf /etc/nginx/conf.d/default.conf -COPY ./docker/nginx.conf /etc/nginx/nginx.conf -COPY ./docker/entrypoint.sh / - -RUN apk update --no-cache && apk upgrade --no-cache \ - && apk add --no-cache openssl tzdata \ - && mkdir -p /var/www/TeaWeb /etc/ssl/certs \ - && chmod +x /entrypoint.sh - -ENV TZ="Europe/Berlin" - -EXPOSE 80 443 - -ENTRYPOINT ["/entrypoint.sh"] -CMD ["nginx", "-g", "daemon off;"] - +FROM reg.c1.datenclown.at/teaspeak/web-base:latest COPY ./dist/ /var/www/TeaWeb/ From c9fb5f7471066138e2e57cd1dcc060fc535d777c Mon Sep 17 00:00:00 2001 From: Gapodo Date: Tue, 21 Nov 2023 16:47:16 +0100 Subject: [PATCH 3/4] build dev, quicker... --- .woodpecker/base.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.woodpecker/base.yaml b/.woodpecker/base.yaml index a37b88eb..37ebd34f 100644 --- a/.woodpecker/base.yaml +++ b/.woodpecker/base.yaml @@ -25,7 +25,7 @@ steps: build-npm: image: *node_image commands: - - bash ./scripts/build.sh web rel + - bash ./scripts/build.sh web dev build-docker-next: image: *buildx_image From 091ac83fd7d9175821b0fcc59040d05e2423f3cc Mon Sep 17 00:00:00 2001 From: Gapodo Date: Tue, 21 Nov 2023 16:47:36 +0100 Subject: [PATCH 4/4] remove stuns --- shared/js/connection/rtc/Connection.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/shared/js/connection/rtc/Connection.ts b/shared/js/connection/rtc/Connection.ts index c159d1c5..d45b1885 100644 --- a/shared/js/connection/rtc/Connection.ts +++ b/shared/js/connection/rtc/Connection.ts @@ -895,7 +895,7 @@ export class RTCConnection { this.peer = new RTCPeerConnection({ bundlePolicy: "max-bundle", rtcpMuxPolicy: "require", - iceServers: [{ urls: ["stun:turn.lp.kle.li:3478", "stuns:turn.kle.li:5349"] }] + iceServers: [{ urls: ["stun:turn.lp.kle.li:3478"] }] }); if (this.audioSupport) {