Compare commits
6 commits
Author | SHA1 | Date | |
---|---|---|---|
174fa9c553 | |||
091ac83fd7 | |||
c9fb5f7471 | |||
7ea4271810 | |||
c7d94f8609 | |||
842cd08574 |
55 changed files with 1902 additions and 1081 deletions
|
@ -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
|
||||
|
|
2
client-api/.gitignore
vendored
2
client-api/.gitignore
vendored
|
@ -1,2 +0,0 @@
|
|||
#My local environment to deploy the files directly
|
||||
environment/
|
|
@ -1,314 +0,0 @@
|
|||
<?php
|
||||
/**
|
||||
* Created by PhpStorm.
|
||||
* User: WolverinDEV
|
||||
* Date: 04.10.18
|
||||
* Time: 16:42
|
||||
*/
|
||||
|
||||
$UI_BASE_PATH = "ui-files/";
|
||||
$CLIENT_BASE_PATH = "files/";
|
||||
|
||||
function errorExit($message) {
|
||||
http_response_code(400);
|
||||
die(json_encode([
|
||||
"success" => 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();
|
8
client/.gitignore
vendored
8
client/.gitignore
vendored
|
@ -1,8 +0,0 @@
|
|||
app/**/*.css
|
||||
app/**/*.css.map
|
||||
|
||||
app/**/*.js
|
||||
app/**/*.js.map
|
||||
|
||||
declarations/
|
||||
generated/
|
|
@ -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;
|
||||
}
|
||||
}
|
|
@ -1,4 +0,0 @@
|
|||
window.__native_client_init_shared(__webpack_require__);
|
||||
|
||||
import "../AppMain.scss";
|
||||
import "tc-shared/entry-points/MainApp";
|
|
@ -1,2 +0,0 @@
|
|||
window.__native_client_init_shared(__webpack_require__);
|
||||
import "tc-shared/entry-points/ModalWindow";
|
7
client/app/external.d.ts
vendored
7
client/app/external.d.ts
vendored
|
@ -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;
|
|
@ -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 */
|
|
@ -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"}
|
|
@ -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
|
|
@ -1,6 +0,0 @@
|
|||
{
|
||||
"source_files": [
|
||||
"../js/**/*.ts"
|
||||
],
|
||||
"target_file": "../declarations/exports.d.ts"
|
||||
}
|
|
@ -1,12 +0,0 @@
|
|||
/* general web project config */
|
||||
{
|
||||
"compilerOptions": {
|
||||
"target": "es6",
|
||||
"module": "commonjs",
|
||||
"sourceMap": true
|
||||
},
|
||||
"include": [
|
||||
"../declarations/imports_*.d.ts",
|
||||
"../js/**/*.ts"
|
||||
]
|
||||
}
|
|
@ -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"
|
||||
]
|
||||
}
|
|
@ -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/
|
||||
|
|
|
@ -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);
|
||||
|
|
|
@ -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 () => {
|
||||
|
|
2
package-lock.json
generated
2
package-lock.json
generated
|
@ -23898,4 +23898,4 @@
|
|||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -11,20 +11,17 @@ if [[ ! -d "${NPM_DIR}" ]]; then
|
|||
fi
|
||||
|
||||
if [[ "${BUILDINDOCKER:-}" != "yes" ]]; then
|
||||
docker run --rm --workdir "/work" -v "${NPM_DIR}:/home/" -v "${BASEPATH}:/work" -e BUILDINDOCKER=yes node:14-bullseye /bin/bash -c 'chmod +x /work/scripts/build_in_docker.sh && /work/scripts/build_in_docker.sh'
|
||||
if docker -v | grep -qi "podman"; then
|
||||
is_podman='yes'
|
||||
fi
|
||||
docker run --rm --workdir "/work" -v "${BASEPATH}:/work" -e is_podman="${is_podman:-no}" -e BUILDINDOCKER=yes -e npm_config_cache=/work/.npm node:14-bullseye /bin/bash -c 'chmod +x /work/scripts/build_in_docker.sh && /work/scripts/build_in_docker.sh'
|
||||
exit
|
||||
fi
|
||||
|
||||
## in docker
|
||||
|
||||
echo "adding npmrc"
|
||||
cat >>"${HOME}/.npmrc" <<'EOF'
|
||||
cache=/work/.npm
|
||||
fund=false
|
||||
EOF
|
||||
|
||||
echo "adding secure git dir"
|
||||
git config --global --add safe.directory /work
|
||||
git config --global --add safe.directory '*'
|
||||
|
||||
echo "running chmods"
|
||||
find "${BASEPATH}" -iname "*.sh" -exec chmod +x {} +
|
||||
|
@ -41,5 +38,9 @@ npx browserslist@latest --update-db || exit 1
|
|||
echo "running build"
|
||||
"${BASEPATH}/scripts/build.sh" web rel
|
||||
|
||||
echo "fixing perms"
|
||||
chown -R 1000:1000 /work
|
||||
if [[ "${is_podman}" != 'yes' ]]; then
|
||||
echo "fixing perms"
|
||||
chown -R 1000:1000 /work
|
||||
else
|
||||
echo "in podman, not fixing perms"
|
||||
fi
|
||||
|
|
|
@ -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
|
11
scripts/in_docker_prep.sh
Executable file
11
scripts/in_docker_prep.sh
Executable file
|
@ -0,0 +1,11 @@
|
|||
#!/bin/bash
|
||||
|
||||
SCRIPT=$(realpath "$0")
|
||||
SCRIPTPATH=$(dirname "$SCRIPT")
|
||||
BASEPATH="$(realpath "${SCRIPTPATH}/../")"
|
||||
|
||||
echo "adding secure git dir"
|
||||
git config --global --add safe.directory '*'
|
||||
|
||||
echo "running chmods"
|
||||
find "${BASEPATH}" -iname "*.sh" -exec chmod +x {} +
|
|
@ -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
|
28
scripts/run_node_docker.sh
Executable file
28
scripts/run_node_docker.sh
Executable file
|
@ -0,0 +1,28 @@
|
|||
#!/bin/bash
|
||||
|
||||
SCRIPT=$(realpath "$0")
|
||||
SCRIPTPATH=$(dirname "$SCRIPT")
|
||||
BASEPATH="$(realpath "${SCRIPTPATH}/../")"
|
||||
|
||||
NPM_DIR="${BASEPATH}/.npm"
|
||||
|
||||
if [[ ! -d "${NPM_DIR}" ]]; then
|
||||
mkdir "${NPM_DIR}" || exit 1
|
||||
fi
|
||||
|
||||
if docker -v | grep -qi "podman"; then
|
||||
is_podman='yes'
|
||||
fi
|
||||
|
||||
function run() {
|
||||
docker run --rm --workdir "/work" -v "${BASEPATH}:/work" -e is_podman="${is_podman:-no}" -e BUILDINDOCKER=yes -e npm_config_cache=/work/.npm ${opts:-} node:14-bullseye ${@}
|
||||
}
|
||||
|
||||
opts="-it" run /bin/bash -c 'bash /work/scripts/in_docker_prep.sh && bash'
|
||||
|
||||
if [[ "${is_podman}" != 'yes' ]]; then
|
||||
echo "fixing perms"
|
||||
run /bin/bash -c 'chown -R 1000:1000 /work'
|
||||
else
|
||||
echo "in podman, not fixing perms"
|
||||
fi
|
|
@ -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
|
|
@ -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
|
|
@ -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
|
|
@ -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 $?
|
|
@ -1,4 +0,0 @@
|
|||
#!/usr/bin/env sh
|
||||
|
||||
LOG_FILE="auto-build/logs/build.log"
|
||||
PACKAGES_DIRECTORY="auto-build/packages/"
|
|
@ -2042,6 +2042,16 @@
|
|||
}
|
||||
}
|
||||
|
||||
.container-teaforo {
|
||||
.container-valid, .container-invalid {
|
||||
padding: 1em;
|
||||
text-align: center;
|
||||
|
||||
button {
|
||||
margin-top: .5em;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.container-highlight-dummy {
|
||||
margin-top: 1em;
|
||||
|
@ -2154,7 +2164,7 @@
|
|||
}
|
||||
}
|
||||
|
||||
.container-teamspeak, .container-nickname {
|
||||
.container-teamspeak, .container-teaforo, .container-nickname {
|
||||
display: none;
|
||||
}
|
||||
|
||||
|
|
|
@ -103,6 +103,7 @@
|
|||
|
||||
<div class="entry group">{{tr "Identity" /}}</div>
|
||||
<div class="entry" container="identity-profiles">{{tr "Profiles" /}}</div>
|
||||
<div class="entry" container="identity-forum">{{tr "TeaForo connection" /}}</div>
|
||||
</div>
|
||||
<div class="container-seperator vertical" seperator-id="seperator-settings"></div>
|
||||
<div class="right">
|
||||
|
@ -416,6 +417,7 @@
|
|||
<select class="form-control profile-identity-type">
|
||||
<option value="error" style="display: none">error: error</option>
|
||||
<option value="unset" style="display: none">{{tr "Unset" /}}</option>
|
||||
<option value="teaforo">{{tr "Forum Account" /}}</option>
|
||||
<option value="teamspeak">{{tr "TeamSpeak Identity" /}}</option>
|
||||
<option value="nickname">{{tr "Nickname (Debug only!)" /}}</option>
|
||||
</select>
|
||||
|
@ -451,6 +453,16 @@
|
|||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="container-teaforo">
|
||||
<div class="container-valid">
|
||||
{{tr "You're using your forum account as identification" /}}
|
||||
</div>
|
||||
<div class="container-invalid">
|
||||
<a>{{tr "You cant use your TeaSpeak forum account. You're not connected with your forum Account!" /}}</a>
|
||||
<button class="btn btn-success button-setup">{{tr "Setup your connection" /}}
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
<div class="container-nickname">
|
||||
<div class="form-group">
|
||||
<label>{{tr "Nickname" /}}</label>
|
||||
|
@ -1958,6 +1970,14 @@
|
|||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="property property-teaforo">
|
||||
<div class="title">
|
||||
<a>{{tr "TeaForo Connection" /}}</a>
|
||||
</div>
|
||||
<div class="value">
|
||||
<a>This will be a really long string...</a>
|
||||
</div>
|
||||
</div>
|
||||
<div class="property property-version">
|
||||
<div class="title">
|
||||
<a>{{tr "Version" /}}</a>
|
||||
|
|
|
@ -14957,6 +14957,76 @@
|
|||
"message": "failed to send logout request"
|
||||
}
|
||||
},
|
||||
{
|
||||
"translated": "Keine TeaForo-Authentifizierung gefunden. TeaForo-Verbindungsstatus: Nicht verbunden",
|
||||
"flags": [
|
||||
"google-translate",
|
||||
"in-use-system"
|
||||
],
|
||||
"key": {
|
||||
"message": "No TeaForo authentification found. TeaForo connection status: unconnected"
|
||||
}
|
||||
},
|
||||
{
|
||||
"translated": "Fehler beim Initialisieren der TeaForo-Verbindung von lokalen Daten. Fehler: %o",
|
||||
"flags": [
|
||||
"google-translate",
|
||||
"in-use-system"
|
||||
],
|
||||
"key": {
|
||||
"message": "Failed to initialize TeaForo connection from local data. Error: %o"
|
||||
}
|
||||
},
|
||||
{
|
||||
"translated": "TeaForo-Daten sollten erneuert werden. Erneuerung wird ausgeführt.",
|
||||
"flags": [
|
||||
"google-translate",
|
||||
"in-use-system"
|
||||
],
|
||||
"key": {
|
||||
"message": "TeaForo data should be renewed. Executing renew."
|
||||
}
|
||||
},
|
||||
{
|
||||
"translated": "TeaForo-Daten wurden erfolgreich erneuert.",
|
||||
"flags": [
|
||||
"google-translate",
|
||||
"in-use-system"
|
||||
],
|
||||
"key": {
|
||||
"message": "TeaForo data has been successfully renewed."
|
||||
}
|
||||
},
|
||||
{
|
||||
"translated": "TeaForo-Daten konnten nicht erneuert werden. Neuer Login erforderlich.",
|
||||
"flags": [
|
||||
"google-translate",
|
||||
"in-use-system"
|
||||
],
|
||||
"key": {
|
||||
"message": "Failed to renew TeaForo data. New login required."
|
||||
}
|
||||
},
|
||||
{
|
||||
"translated": "TeaForo-Daten konnten nicht erneuert werden. Ein Fehler ist aufgetreten: %o",
|
||||
"flags": [
|
||||
"google-translate",
|
||||
"in-use-system"
|
||||
],
|
||||
"key": {
|
||||
"message": "Failed to renew TeaForo data. An error occurred: %o"
|
||||
}
|
||||
},
|
||||
{
|
||||
"translated": "TeaForo-Daten sind abgelaufen. TeaForo-Verbindung ist nicht verfügbar!",
|
||||
"flags": [
|
||||
"google-translate",
|
||||
"in-use-system"
|
||||
],
|
||||
"key": {
|
||||
"message": "TeaForo data is expired. TeaForo connection isn't available!"
|
||||
}
|
||||
},
|
||||
{
|
||||
"translated": "Fehler beim Dekodieren der Audiodaten für %o: %o",
|
||||
"flags": [
|
||||
|
@ -18847,6 +18917,17 @@
|
|||
"message": "Identity"
|
||||
}
|
||||
},
|
||||
{
|
||||
"translated": "TeaForo-Verbindung",
|
||||
"flags": [
|
||||
"google-translate",
|
||||
"ui-visible",
|
||||
"in-use-system"
|
||||
],
|
||||
"key": {
|
||||
"message": "TeaForo connection"
|
||||
}
|
||||
},
|
||||
{
|
||||
"translated": "Deaktiviere Hintergründe innerhalb des Hostbanner",
|
||||
"flags": [
|
||||
|
@ -20456,6 +20537,17 @@
|
|||
"message": "Database ID:"
|
||||
}
|
||||
},
|
||||
{
|
||||
"translated": "TeaForo-Verbindung",
|
||||
"flags": [
|
||||
"google-translate",
|
||||
"ui-visible",
|
||||
"in-use-system"
|
||||
],
|
||||
"key": {
|
||||
"message": "TeaForo Connection"
|
||||
}
|
||||
},
|
||||
{
|
||||
"translated": "Zeitstempel erstellen:",
|
||||
"flags": [
|
||||
|
@ -26900,6 +26992,16 @@
|
|||
"in-use-system"
|
||||
]
|
||||
},
|
||||
{
|
||||
"key": {
|
||||
"message": "Renewing TeaForo data."
|
||||
},
|
||||
"translated": "TeaForo-Daten erneuern.",
|
||||
"flags": [
|
||||
"google-translated",
|
||||
"in-use-system"
|
||||
]
|
||||
},
|
||||
{
|
||||
"key": {
|
||||
"message": "Set away on all servers"
|
||||
|
|
|
@ -13045,6 +13045,76 @@
|
|||
"message": "failed to send logout request"
|
||||
}
|
||||
},
|
||||
{
|
||||
"translated": "No se encontró la autenticación de TeaForo. Estado de conexión de TeaForo: desconectado",
|
||||
"flags": [
|
||||
"google-translate",
|
||||
"in-use-system"
|
||||
],
|
||||
"key": {
|
||||
"message": "No TeaForo authentification found. TeaForo connection status: unconnected"
|
||||
}
|
||||
},
|
||||
{
|
||||
"translated": "Error al inicializar la conexión TeaForo a partir de datos locales. Error: %o",
|
||||
"flags": [
|
||||
"google-translate",
|
||||
"in-use-system"
|
||||
],
|
||||
"key": {
|
||||
"message": "Failed to initialize TeaForo connection from local data. Error: %o"
|
||||
}
|
||||
},
|
||||
{
|
||||
"translated": "Los datos de TeaForo deben renovarse. Ejecutando renovar.",
|
||||
"flags": [
|
||||
"google-translate",
|
||||
"in-use-system"
|
||||
],
|
||||
"key": {
|
||||
"message": "TeaForo data should be renewed. Executing renew."
|
||||
}
|
||||
},
|
||||
{
|
||||
"translated": "Los datos de TeaForo se han renovado con éxito.",
|
||||
"flags": [
|
||||
"google-translate",
|
||||
"in-use-system"
|
||||
],
|
||||
"key": {
|
||||
"message": "TeaForo data has been successfully renewed."
|
||||
}
|
||||
},
|
||||
{
|
||||
"translated": "Error al renovar los datos de TeaForo. Nuevo inicio de sesión requerido.",
|
||||
"flags": [
|
||||
"google-translate",
|
||||
"in-use-system"
|
||||
],
|
||||
"key": {
|
||||
"message": "Failed to renew TeaForo data. New login required."
|
||||
}
|
||||
},
|
||||
{
|
||||
"translated": "Error al renovar los datos de TeaForo. Se produjo un error: %o",
|
||||
"flags": [
|
||||
"google-translate",
|
||||
"in-use-system"
|
||||
],
|
||||
"key": {
|
||||
"message": "Failed to renew TeaForo data. An error occurred: %o"
|
||||
}
|
||||
},
|
||||
{
|
||||
"translated": "Los datos de TeaForo han caducado. ¡La conexión TeaForo no está disponible!",
|
||||
"flags": [
|
||||
"google-translate",
|
||||
"in-use-system"
|
||||
],
|
||||
"key": {
|
||||
"message": "TeaForo data is expired. TeaForo connection isn't available!"
|
||||
}
|
||||
},
|
||||
{
|
||||
"translated": "Error al decodificar datos de audio para %o: %o",
|
||||
"flags": [
|
||||
|
@ -16946,6 +17016,17 @@
|
|||
"message": "Identity"
|
||||
}
|
||||
},
|
||||
{
|
||||
"translated": "Conexión TeaForo",
|
||||
"flags": [
|
||||
"google-translate",
|
||||
"ui-visible",
|
||||
"in-use-system"
|
||||
],
|
||||
"key": {
|
||||
"message": "TeaForo connection"
|
||||
}
|
||||
},
|
||||
{
|
||||
"translated": "Backrounds deshabilitados dentro del hostbanner",
|
||||
"flags": [
|
||||
|
@ -18566,6 +18647,17 @@
|
|||
"message": "Database ID:"
|
||||
}
|
||||
},
|
||||
{
|
||||
"translated": "Conexión TeaForo",
|
||||
"flags": [
|
||||
"google-translate",
|
||||
"ui-visible",
|
||||
"in-use-system"
|
||||
],
|
||||
"key": {
|
||||
"message": "TeaForo Connection"
|
||||
}
|
||||
},
|
||||
{
|
||||
"translated": "Marca de tiempo de construcción:",
|
||||
"flags": [
|
||||
|
@ -25010,6 +25102,16 @@
|
|||
"in-use-system"
|
||||
]
|
||||
},
|
||||
{
|
||||
"key": {
|
||||
"message": "Renewing TeaForo data."
|
||||
},
|
||||
"translated": "Renovando los datos de TeaForo.",
|
||||
"flags": [
|
||||
"google-translated",
|
||||
"in-use-system"
|
||||
]
|
||||
},
|
||||
{
|
||||
"key": {
|
||||
"message": "Set away on all servers"
|
||||
|
|
|
@ -13877,6 +13877,76 @@
|
|||
"message": "failed to send logout request"
|
||||
}
|
||||
},
|
||||
{
|
||||
"translated": "Aucune authentification TeaForo trouvée. Statut de connexion TeaForo: non connecté",
|
||||
"flags": [
|
||||
"google-translate",
|
||||
"in-use-system"
|
||||
],
|
||||
"key": {
|
||||
"message": "No TeaForo authentification found. TeaForo connection status: unconnected"
|
||||
}
|
||||
},
|
||||
{
|
||||
"translated": "Échec d'initialisation de la connexion TeaForo à partir de données locales. Erreur: %o",
|
||||
"flags": [
|
||||
"google-translate",
|
||||
"in-use-system"
|
||||
],
|
||||
"key": {
|
||||
"message": "Failed to initialize TeaForo connection from local data. Error: %o"
|
||||
}
|
||||
},
|
||||
{
|
||||
"translated": "Les données TeaForo doivent être renouvelées. Exécuter renouveler.",
|
||||
"flags": [
|
||||
"google-translate",
|
||||
"in-use-system"
|
||||
],
|
||||
"key": {
|
||||
"message": "TeaForo data should be renewed. Executing renew."
|
||||
}
|
||||
},
|
||||
{
|
||||
"translated": "Les données TeaForo ont été renouvelées avec succès.",
|
||||
"flags": [
|
||||
"google-translate",
|
||||
"in-use-system"
|
||||
],
|
||||
"key": {
|
||||
"message": "TeaForo data has been successfully renewed."
|
||||
}
|
||||
},
|
||||
{
|
||||
"translated": "Échec du renouvellement des données TeaForo. Nouvelle connexion requise.",
|
||||
"flags": [
|
||||
"google-translate",
|
||||
"in-use-system"
|
||||
],
|
||||
"key": {
|
||||
"message": "Failed to renew TeaForo data. New login required."
|
||||
}
|
||||
},
|
||||
{
|
||||
"translated": "Échec du renouvellement des données TeaForo. Une erreur est survenue: %o",
|
||||
"flags": [
|
||||
"google-translate",
|
||||
"in-use-system"
|
||||
],
|
||||
"key": {
|
||||
"message": "Failed to renew TeaForo data. An error occurred: %o"
|
||||
}
|
||||
},
|
||||
{
|
||||
"translated": "Les données TeaForo sont expirées. La connexion TeaForo n'est pas disponible!",
|
||||
"flags": [
|
||||
"google-translate",
|
||||
"in-use-system"
|
||||
],
|
||||
"key": {
|
||||
"message": "TeaForo data is expired. TeaForo connection isn't available!"
|
||||
}
|
||||
},
|
||||
{
|
||||
"translated": "Échec de décodage des données audio pour %o: %o",
|
||||
"flags": [
|
||||
|
@ -17767,6 +17837,17 @@
|
|||
"message": "Identity"
|
||||
}
|
||||
},
|
||||
{
|
||||
"translated": "Connexion TeaForo",
|
||||
"flags": [
|
||||
"google-translate",
|
||||
"ui-visible",
|
||||
"in-use-system"
|
||||
],
|
||||
"key": {
|
||||
"message": "TeaForo connection"
|
||||
}
|
||||
},
|
||||
{
|
||||
"translated": "Backrounds handicapés dans le hostbanner",
|
||||
"flags": [
|
||||
|
@ -19376,6 +19457,17 @@
|
|||
"message": "Database ID:"
|
||||
}
|
||||
},
|
||||
{
|
||||
"translated": "Connexion TeaForo",
|
||||
"flags": [
|
||||
"google-translate",
|
||||
"ui-visible",
|
||||
"in-use-system"
|
||||
],
|
||||
"key": {
|
||||
"message": "TeaForo Connection"
|
||||
}
|
||||
},
|
||||
{
|
||||
"translated": "Construire l'horodatage:",
|
||||
"flags": [
|
||||
|
@ -25820,6 +25912,16 @@
|
|||
"in-use-system"
|
||||
]
|
||||
},
|
||||
{
|
||||
"key": {
|
||||
"message": "Renewing TeaForo data."
|
||||
},
|
||||
"translated": "Renouvellement des données TeaForo.",
|
||||
"flags": [
|
||||
"google-translated",
|
||||
"in-use-system"
|
||||
]
|
||||
},
|
||||
{
|
||||
"key": {
|
||||
"message": "Set away on all servers"
|
||||
|
|
|
@ -6327,6 +6327,83 @@
|
|||
"in-use-system"
|
||||
]
|
||||
},
|
||||
{
|
||||
"key": {
|
||||
"message": "No TeaForo authentification found. TeaForo connection status: unconnected"
|
||||
},
|
||||
"translated": "Nem található a TeaForo hitelesítés. TeaForo kapcsolat állapota: nincs csatlakoztatva",
|
||||
"flags": [
|
||||
"google-translated",
|
||||
"human-verified",
|
||||
"in-use-system"
|
||||
]
|
||||
},
|
||||
{
|
||||
"key": {
|
||||
"message": "Failed to initialize TeaForo connection from local data. Error: %o"
|
||||
},
|
||||
"translated": "Nem sikerült inicializálni a TeaForo kapcsolatot a helyi adatokból. Hiba: %o",
|
||||
"flags": [
|
||||
"google-translated",
|
||||
"human-verified",
|
||||
"in-use-system"
|
||||
]
|
||||
},
|
||||
{
|
||||
"key": {
|
||||
"message": "TeaForo data should be renewed. Executing renew."
|
||||
},
|
||||
"translated": "A TeaForo adatait meg kell újítani. Megújítás végrehajtása.",
|
||||
"flags": [
|
||||
"google-translated",
|
||||
"human-verified",
|
||||
"in-use-system"
|
||||
]
|
||||
},
|
||||
{
|
||||
"key": {
|
||||
"message": "TeaForo data has been successfully renewed."
|
||||
},
|
||||
"translated": "A TeaForo adatait sikeresen megújították.",
|
||||
"flags": [
|
||||
"google-translated",
|
||||
"human-verified",
|
||||
"in-use-system"
|
||||
]
|
||||
},
|
||||
{
|
||||
"key": {
|
||||
"message": "Failed to renew TeaForo data. New login required."
|
||||
},
|
||||
"translated": "Nem sikerült megújítani a TeaForo adatait. Új bejelentkezés szükséges.",
|
||||
"flags": [
|
||||
"google-translated",
|
||||
"human-verified",
|
||||
"in-use-system"
|
||||
]
|
||||
},
|
||||
{
|
||||
"key": {
|
||||
"message": "Failed to renew TeaForo data. An error occurred: %o"
|
||||
},
|
||||
"translated": "Nem sikerült megújítani a TeaForo adatait. Hiba történt: %o",
|
||||
"flags": [
|
||||
"google-translated",
|
||||
"human-verified",
|
||||
"in-use-system"
|
||||
]
|
||||
},
|
||||
{
|
||||
"key": {
|
||||
"message": "TeaForo data is expired. TeaForo connection isn't available!"
|
||||
},
|
||||
"translated": "A TeaForo adatok lejártak. A TeaForo kapcsolat nem érhető el!",
|
||||
"flags": [
|
||||
"google-translated",
|
||||
"human-verified",
|
||||
"in-use-system"
|
||||
]
|
||||
},
|
||||
{
|
||||
"key": {
|
||||
"message": "Manage bookmarks"
|
||||
|
@ -21151,6 +21228,18 @@
|
|||
"in-use-system"
|
||||
]
|
||||
},
|
||||
{
|
||||
"key": {
|
||||
"message": "TeaForo connection"
|
||||
},
|
||||
"translated": "TeaForo kapcsolat",
|
||||
"flags": [
|
||||
"google-translated",
|
||||
"human-verified",
|
||||
"ui-visible",
|
||||
"in-use-system"
|
||||
]
|
||||
},
|
||||
{
|
||||
"key": {
|
||||
"message": "Disabled backrounds within the hostbanner"
|
||||
|
@ -25955,6 +26044,18 @@
|
|||
"in-use-system"
|
||||
]
|
||||
},
|
||||
{
|
||||
"key": {
|
||||
"message": "TeaForo Connection"
|
||||
},
|
||||
"translated": "TeaForo kapcsolat",
|
||||
"flags": [
|
||||
"google-translated",
|
||||
"human-verified",
|
||||
"ui-visible",
|
||||
"in-use-system"
|
||||
]
|
||||
},
|
||||
{
|
||||
"key": {
|
||||
"message": "Version"
|
||||
|
@ -29835,6 +29936,17 @@
|
|||
"in-use-system"
|
||||
]
|
||||
},
|
||||
{
|
||||
"key": {
|
||||
"message": "Renewing TeaForo data."
|
||||
},
|
||||
"translated": "A TeaForo adatok megújítása.",
|
||||
"flags": [
|
||||
"google-translated",
|
||||
"human-verified",
|
||||
"in-use-system"
|
||||
]
|
||||
},
|
||||
{
|
||||
"key": {
|
||||
"message": "Unmute headphones"
|
||||
|
|
|
@ -11161,6 +11161,116 @@
|
|||
"in-use-system"
|
||||
]
|
||||
},
|
||||
{
|
||||
"key": {
|
||||
"message": "No TeaForo authentification found. TeaForo connection status: unconnected"
|
||||
},
|
||||
"translated": "Geen TeaForo-authenticatie gevonden. TeaForo-verbindingsstatus: niet verbonden",
|
||||
"flags": [
|
||||
"google-translated",
|
||||
"in-use-system"
|
||||
]
|
||||
},
|
||||
{
|
||||
"key": {
|
||||
"message": "Failed to initialize TeaForo connection from local data. Error: %o"
|
||||
},
|
||||
"translated": "Het initialiseren van TeaForo-verbinding op basis van lokale gegevens is mislukt. Fout:% o",
|
||||
"flags": [
|
||||
"google-translated",
|
||||
"in-use-system"
|
||||
]
|
||||
},
|
||||
{
|
||||
"key": {
|
||||
"message": "TeaForo data should be renewed. Executing renew."
|
||||
},
|
||||
"translated": "TeaForo-gegevens moeten worden vernieuwd. Verlenging uitvoeren.",
|
||||
"flags": [
|
||||
"google-translated",
|
||||
"in-use-system"
|
||||
]
|
||||
},
|
||||
{
|
||||
"key": {
|
||||
"message": "TeaForo data has been successfully renewed."
|
||||
},
|
||||
"translated": "TeaForo-gegevens zijn met succes vernieuwd.",
|
||||
"flags": [
|
||||
"google-translated",
|
||||
"in-use-system"
|
||||
]
|
||||
},
|
||||
{
|
||||
"key": {
|
||||
"message": "Failed to renew TeaForo data. New login required."
|
||||
},
|
||||
"translated": "Kan TeaForo-gegevens niet vernieuwen. Nieuwe login vereist.",
|
||||
"flags": [
|
||||
"google-translated",
|
||||
"in-use-system"
|
||||
]
|
||||
},
|
||||
{
|
||||
"key": {
|
||||
"message": "Failed to renew TeaForo data. An error occurred: %o"
|
||||
},
|
||||
"translated": "Kan TeaForo-gegevens niet vernieuwen. Er is een fout opgetreden:% o",
|
||||
"flags": [
|
||||
"google-translated",
|
||||
"in-use-system"
|
||||
]
|
||||
},
|
||||
{
|
||||
"key": {
|
||||
"message": "TeaForo data is expired. TeaForo connection isn't available!"
|
||||
},
|
||||
"translated": "TeaForo-gegevens zijn verlopen. TeaForo-verbinding is niet beschikbaar!",
|
||||
"flags": [
|
||||
"google-translated",
|
||||
"in-use-system"
|
||||
]
|
||||
},
|
||||
{
|
||||
"key": {
|
||||
"message": "Renewing TeaForo data."
|
||||
},
|
||||
"translated": "TeaForo-gegevens vernieuwen.",
|
||||
"flags": [
|
||||
"google-translated",
|
||||
"in-use-system"
|
||||
]
|
||||
},
|
||||
{
|
||||
"key": {
|
||||
"message": "TeaForo data has been successfully renewed."
|
||||
},
|
||||
"translated": "TeaForo-gegevens zijn met succes vernieuwd.",
|
||||
"flags": [
|
||||
"google-translated",
|
||||
"in-use-system"
|
||||
]
|
||||
},
|
||||
{
|
||||
"key": {
|
||||
"message": "Failed to renew TeaForo data. New login required."
|
||||
},
|
||||
"translated": "Kan TeaForo-gegevens niet vernieuwen. Nieuwe login vereist.",
|
||||
"flags": [
|
||||
"google-translated",
|
||||
"in-use-system"
|
||||
]
|
||||
},
|
||||
{
|
||||
"key": {
|
||||
"message": "Failed to renew TeaForo data. An error occurred: %o"
|
||||
},
|
||||
"translated": "Kan TeaForo-gegevens niet vernieuwen. Er is een fout opgetreden:% o",
|
||||
"flags": [
|
||||
"google-translated",
|
||||
"in-use-system"
|
||||
]
|
||||
},
|
||||
{
|
||||
"key": {
|
||||
"message": "Server Groups"
|
||||
|
@ -24813,6 +24923,17 @@
|
|||
"in-use-system"
|
||||
]
|
||||
},
|
||||
{
|
||||
"key": {
|
||||
"message": "TeaForo connection"
|
||||
},
|
||||
"translated": "TeaForo-verbinding",
|
||||
"flags": [
|
||||
"google-translated",
|
||||
"ui-visible",
|
||||
"in-use-system"
|
||||
]
|
||||
},
|
||||
{
|
||||
"key": {
|
||||
"message": "Disabled backrounds within the hostbanner"
|
||||
|
@ -28237,6 +28358,17 @@
|
|||
"in-use-system"
|
||||
]
|
||||
},
|
||||
{
|
||||
"key": {
|
||||
"message": "TeaForo Connection"
|
||||
},
|
||||
"translated": "TeaForo-verbinding",
|
||||
"flags": [
|
||||
"google-translated",
|
||||
"ui-visible",
|
||||
"in-use-system"
|
||||
]
|
||||
},
|
||||
{
|
||||
"key": {
|
||||
"message": "Version"
|
||||
|
|
|
@ -13877,6 +13877,76 @@
|
|||
"message": "failed to send logout request"
|
||||
}
|
||||
},
|
||||
{
|
||||
"translated": "Nie znaleziono uwierzytelnienia TeaForo. Status połączenia TeaForo: niepodłączony",
|
||||
"flags": [
|
||||
"google-translate",
|
||||
"in-use-system"
|
||||
],
|
||||
"key": {
|
||||
"message": "No TeaForo authentification found. TeaForo connection status: unconnected"
|
||||
}
|
||||
},
|
||||
{
|
||||
"translated": "Nie można zainicjować połączenia TeaForo z danych lokalnych. Błąd: %o",
|
||||
"flags": [
|
||||
"google-translate",
|
||||
"in-use-system"
|
||||
],
|
||||
"key": {
|
||||
"message": "Failed to initialize TeaForo connection from local data. Error: %o"
|
||||
}
|
||||
},
|
||||
{
|
||||
"translated": "Dane TeaForo powinny zostać odnowione. Wykonywanie odnowienia.",
|
||||
"flags": [
|
||||
"google-translate",
|
||||
"in-use-system"
|
||||
],
|
||||
"key": {
|
||||
"message": "TeaForo data should be renewed. Executing renew."
|
||||
}
|
||||
},
|
||||
{
|
||||
"translated": "Dane TeaForo zostały pomyślnie odnowione.",
|
||||
"flags": [
|
||||
"google-translate",
|
||||
"in-use-system"
|
||||
],
|
||||
"key": {
|
||||
"message": "TeaForo data has been successfully renewed."
|
||||
}
|
||||
},
|
||||
{
|
||||
"translated": "Nie udało się odnowić danych TeaForo. Wymagane nowe logowanie.",
|
||||
"flags": [
|
||||
"google-translate",
|
||||
"in-use-system"
|
||||
],
|
||||
"key": {
|
||||
"message": "Failed to renew TeaForo data. New login required."
|
||||
}
|
||||
},
|
||||
{
|
||||
"translated": "Nie udało się odnowić danych TeaForo. Wystąpił błąd: %o",
|
||||
"flags": [
|
||||
"google-translate",
|
||||
"in-use-system"
|
||||
],
|
||||
"key": {
|
||||
"message": "Failed to renew TeaForo data. An error occurred: %o"
|
||||
}
|
||||
},
|
||||
{
|
||||
"translated": "Dane TeaForo wygasły. Połączenie TeaForo nie jest dostępne!",
|
||||
"flags": [
|
||||
"google-translate",
|
||||
"in-use-system"
|
||||
],
|
||||
"key": {
|
||||
"message": "TeaForo data is expired. TeaForo connection isn't available!"
|
||||
}
|
||||
},
|
||||
{
|
||||
"translated": "Nie udało się zdekodować danych audio dla %o: %o",
|
||||
"flags": [
|
||||
|
@ -17767,6 +17837,17 @@
|
|||
"message": "Identity"
|
||||
}
|
||||
},
|
||||
{
|
||||
"translated": "Połączenie TeaForo",
|
||||
"flags": [
|
||||
"google-translate",
|
||||
"ui-visible",
|
||||
"in-use-system"
|
||||
],
|
||||
"key": {
|
||||
"message": "TeaForo connection"
|
||||
}
|
||||
},
|
||||
{
|
||||
"translated": "Wyłączone backrounds w hostbanner",
|
||||
"flags": [
|
||||
|
@ -19376,6 +19457,17 @@
|
|||
"message": "Database ID:"
|
||||
}
|
||||
},
|
||||
{
|
||||
"translated": "Połączenie TeaForo",
|
||||
"flags": [
|
||||
"google-translate",
|
||||
"ui-visible",
|
||||
"in-use-system"
|
||||
],
|
||||
"key": {
|
||||
"message": "TeaForo Connection"
|
||||
}
|
||||
},
|
||||
{
|
||||
"translated": "Zbuduj znacznik czasu:",
|
||||
"flags": [
|
||||
|
@ -25830,6 +25922,16 @@
|
|||
"in-use-system"
|
||||
]
|
||||
},
|
||||
{
|
||||
"key": {
|
||||
"message": "Renewing TeaForo data."
|
||||
},
|
||||
"translated": "Odnawianie danych TeaForo.",
|
||||
"flags": [
|
||||
"google-translated",
|
||||
"in-use-system"
|
||||
]
|
||||
},
|
||||
{
|
||||
"key": {
|
||||
"message": "Set away on all servers"
|
||||
|
|
|
@ -5745,6 +5745,76 @@
|
|||
"in-use-system"
|
||||
]
|
||||
},
|
||||
{
|
||||
"key": {
|
||||
"message": "No TeaForo authentification found. TeaForo connection status: unconnected"
|
||||
},
|
||||
"translated": "Nenhuma autenticação TeaForum encontrada. Status da conexão TeaForum: desconectado",
|
||||
"flags": [
|
||||
"google-translated",
|
||||
"in-use-system"
|
||||
]
|
||||
},
|
||||
{
|
||||
"key": {
|
||||
"message": "Failed to initialize TeaForo connection from local data. Error: %o"
|
||||
},
|
||||
"translated": "Falha ao inicializar a conexão TeaForum a partir de dados locais. Erro: %o",
|
||||
"flags": [
|
||||
"google-translated",
|
||||
"in-use-system"
|
||||
]
|
||||
},
|
||||
{
|
||||
"key": {
|
||||
"message": "TeaForo data should be renewed. Executing renew."
|
||||
},
|
||||
"translated": "Os dados do TeaForum devem ser renovados. Executando renovar.",
|
||||
"flags": [
|
||||
"google-translated",
|
||||
"in-use-system"
|
||||
]
|
||||
},
|
||||
{
|
||||
"key": {
|
||||
"message": "TeaForo data has been successfully renewed."
|
||||
},
|
||||
"translated": "Os dados do TeaForum foram renovados com sucesso.",
|
||||
"flags": [
|
||||
"google-translated",
|
||||
"in-use-system"
|
||||
]
|
||||
},
|
||||
{
|
||||
"key": {
|
||||
"message": "Failed to renew TeaForo data. New login required."
|
||||
},
|
||||
"translated": "Falha ao renovar os dados do TeaForum. Novo login necessário.",
|
||||
"flags": [
|
||||
"google-translated",
|
||||
"in-use-system"
|
||||
]
|
||||
},
|
||||
{
|
||||
"key": {
|
||||
"message": "Failed to renew TeaForo data. An error occurred: %o"
|
||||
},
|
||||
"translated": "Falha ao renovar os dados do TeaForum. Ocorreu um erro: %o",
|
||||
"flags": [
|
||||
"google-translated",
|
||||
"in-use-system"
|
||||
]
|
||||
},
|
||||
{
|
||||
"key": {
|
||||
"message": "TeaForo data is expired. TeaForo connection isn't available!"
|
||||
},
|
||||
"translated": "Os dados do TeaForum expiraram. A conexão TeaForum não está disponível!",
|
||||
"flags": [
|
||||
"google-translated",
|
||||
"in-use-system"
|
||||
]
|
||||
},
|
||||
{
|
||||
"key": {
|
||||
"message": "Manage bookmarks"
|
||||
|
@ -19224,6 +19294,17 @@
|
|||
"in-use-system"
|
||||
]
|
||||
},
|
||||
{
|
||||
"key": {
|
||||
"message": "TeaForo connection"
|
||||
},
|
||||
"translated": "Conexão TeaForum",
|
||||
"flags": [
|
||||
"google-translated",
|
||||
"ui-visible",
|
||||
"in-use-system"
|
||||
]
|
||||
},
|
||||
{
|
||||
"key": {
|
||||
"message": "Disabled backrounds within the hostbanner"
|
||||
|
@ -23615,6 +23696,17 @@
|
|||
"in-use-system"
|
||||
]
|
||||
},
|
||||
{
|
||||
"key": {
|
||||
"message": "TeaForo Connection"
|
||||
},
|
||||
"translated": "Conexão TeaForum",
|
||||
"flags": [
|
||||
"google-translated",
|
||||
"ui-visible",
|
||||
"in-use-system"
|
||||
]
|
||||
},
|
||||
{
|
||||
"key": {
|
||||
"message": "Version"
|
||||
|
@ -26864,6 +26956,16 @@
|
|||
"in-use-system"
|
||||
]
|
||||
},
|
||||
{
|
||||
"key": {
|
||||
"message": "Renewing TeaForo data."
|
||||
},
|
||||
"translated": "Renovando dados do TeaForo.",
|
||||
"flags": [
|
||||
"google-translated",
|
||||
"in-use-system"
|
||||
]
|
||||
},
|
||||
{
|
||||
"key": {
|
||||
"message": "Set away on all servers"
|
||||
|
|
|
@ -13450,6 +13450,76 @@
|
|||
"message": "failed to send logout request"
|
||||
}
|
||||
},
|
||||
{
|
||||
"translated": "Аутентификация TeaForo не найдена. Состояние соединения TeaForo: не подключено",
|
||||
"flags": [
|
||||
"google-translate",
|
||||
"in-use-system"
|
||||
],
|
||||
"key": {
|
||||
"message": "No TeaForo authentification found. TeaForo connection status: unconnected"
|
||||
}
|
||||
},
|
||||
{
|
||||
"translated": "Не удалось инициализировать соединение TeaForo из локальных данных. Ошибка: %o",
|
||||
"flags": [
|
||||
"google-translate",
|
||||
"in-use-system"
|
||||
],
|
||||
"key": {
|
||||
"message": "Failed to initialize TeaForo connection from local data. Error: %o"
|
||||
}
|
||||
},
|
||||
{
|
||||
"translated": "Данные TeaForo должны быть обновлены. Выполнение возобновления.",
|
||||
"flags": [
|
||||
"google-translate",
|
||||
"in-use-system"
|
||||
],
|
||||
"key": {
|
||||
"message": "TeaForo data should be renewed. Executing renew."
|
||||
}
|
||||
},
|
||||
{
|
||||
"translated": "Данные TeaForo были успешно обновлены.",
|
||||
"flags": [
|
||||
"google-translate",
|
||||
"in-use-system"
|
||||
],
|
||||
"key": {
|
||||
"message": "TeaForo data has been successfully renewed."
|
||||
}
|
||||
},
|
||||
{
|
||||
"translated": "Не удалось обновить данные TeaForo. Требуется новый логин.",
|
||||
"flags": [
|
||||
"google-translate",
|
||||
"in-use-system"
|
||||
],
|
||||
"key": {
|
||||
"message": "Failed to renew TeaForo data. New login required."
|
||||
}
|
||||
},
|
||||
{
|
||||
"translated": "Не удалось обновить данные TeaForo. Произошла ошибка: %o",
|
||||
"flags": [
|
||||
"google-translate",
|
||||
"in-use-system"
|
||||
],
|
||||
"key": {
|
||||
"message": "Failed to renew TeaForo data. An error occurred: %o"
|
||||
}
|
||||
},
|
||||
{
|
||||
"translated": "Срок действия данных TeaForo истек. Соединение TeaForo недоступно!",
|
||||
"flags": [
|
||||
"google-translate",
|
||||
"in-use-system"
|
||||
],
|
||||
"key": {
|
||||
"message": "TeaForo data is expired. TeaForo connection isn't available!"
|
||||
}
|
||||
},
|
||||
{
|
||||
"translated": "Не удалось декодировать аудиоданные для %o: %o",
|
||||
"flags": [
|
||||
|
@ -17351,6 +17421,17 @@
|
|||
"message": "Identity"
|
||||
}
|
||||
},
|
||||
{
|
||||
"translated": "TeaForo соединение",
|
||||
"flags": [
|
||||
"google-translate",
|
||||
"ui-visible",
|
||||
"in-use-system"
|
||||
],
|
||||
"key": {
|
||||
"message": "TeaForo connection"
|
||||
}
|
||||
},
|
||||
{
|
||||
"translated": "Отключенные фоны в hostbanner",
|
||||
"flags": [
|
||||
|
@ -18971,6 +19052,17 @@
|
|||
"message": "Database ID:"
|
||||
}
|
||||
},
|
||||
{
|
||||
"translated": "TeaForo Connection",
|
||||
"flags": [
|
||||
"google-translate",
|
||||
"ui-visible",
|
||||
"in-use-system"
|
||||
],
|
||||
"key": {
|
||||
"message": "TeaForo Connection"
|
||||
}
|
||||
},
|
||||
{
|
||||
"translated": "Отметка времени создания:",
|
||||
"flags": [
|
||||
|
@ -25415,6 +25507,16 @@
|
|||
"in-use-system"
|
||||
]
|
||||
},
|
||||
{
|
||||
"key": {
|
||||
"message": "Renewing TeaForo data."
|
||||
},
|
||||
"translated": "Обновление данных TeaForo.",
|
||||
"flags": [
|
||||
"google-translated",
|
||||
"in-use-system"
|
||||
]
|
||||
},
|
||||
{
|
||||
"key": {
|
||||
"message": "Set away on all servers"
|
||||
|
|
|
@ -9324,6 +9324,15 @@
|
|||
"message": "Sounds"
|
||||
}
|
||||
},
|
||||
{
|
||||
"translated": "Аккаунт форума TeaSpeak",
|
||||
"flags": [
|
||||
"google-translate"
|
||||
],
|
||||
"key": {
|
||||
"message": "TeaForo connection"
|
||||
}
|
||||
},
|
||||
{
|
||||
"translated": "Идентификация",
|
||||
"flags": [
|
||||
|
|
|
@ -13877,6 +13877,76 @@
|
|||
"message": "failed to send logout request"
|
||||
}
|
||||
},
|
||||
{
|
||||
"translated": "TeaForo kimlik doğrulaması bulunamadı. TeaForo bağlantı durumu: bağlantısız",
|
||||
"flags": [
|
||||
"human-modified",
|
||||
"in-use-system"
|
||||
],
|
||||
"key": {
|
||||
"message": "No TeaForo authentification found. TeaForo connection status: unconnected"
|
||||
}
|
||||
},
|
||||
{
|
||||
"translated": "TeaForo bağlantısı yerel verilerden başlatılamadı. Hata: %o",
|
||||
"flags": [
|
||||
"human-modified",
|
||||
"in-use-system"
|
||||
],
|
||||
"key": {
|
||||
"message": "Failed to initialize TeaForo connection from local data. Error: %o"
|
||||
}
|
||||
},
|
||||
{
|
||||
"translated": "TeaForo verileri yenilenmelidir. Yenileme çalıştırılıyor.",
|
||||
"flags": [
|
||||
"human-modified",
|
||||
"in-use-system"
|
||||
],
|
||||
"key": {
|
||||
"message": "TeaForo data should be renewed. Executing renew."
|
||||
}
|
||||
},
|
||||
{
|
||||
"translated": "TeaForo verileri başarıyla yenilendi.",
|
||||
"flags": [
|
||||
"human-modified",
|
||||
"in-use-system"
|
||||
],
|
||||
"key": {
|
||||
"message": "TeaForo data has been successfully renewed."
|
||||
}
|
||||
},
|
||||
{
|
||||
"translated": "TeaForo verileri yenilenemedi. Yeni giriş gerekli.",
|
||||
"flags": [
|
||||
"human-modified",
|
||||
"in-use-system"
|
||||
],
|
||||
"key": {
|
||||
"message": "Failed to renew TeaForo data. New login required."
|
||||
}
|
||||
},
|
||||
{
|
||||
"translated": "TeaForo verileri yenilenemedi. Bir hata oluştu: %o",
|
||||
"flags": [
|
||||
"human-modified",
|
||||
"in-use-system"
|
||||
],
|
||||
"key": {
|
||||
"message": "Failed to renew TeaForo data. An error occurred: %o"
|
||||
}
|
||||
},
|
||||
{
|
||||
"translated": "TeaForo verilerinin süresi doldu. TeaForo bağlantısı mevcut değil!",
|
||||
"flags": [
|
||||
"human-modified",
|
||||
"in-use-system"
|
||||
],
|
||||
"key": {
|
||||
"message": "TeaForo data is expired. TeaForo connection isn't available!"
|
||||
}
|
||||
},
|
||||
{
|
||||
"translated": " %o için ses verileri kodu çözülemedi: %o",
|
||||
"flags": [
|
||||
|
@ -17767,6 +17837,17 @@
|
|||
"message": "Identity"
|
||||
}
|
||||
},
|
||||
{
|
||||
"translated": "TeaForo bağlantısı",
|
||||
"flags": [
|
||||
"human-modified",
|
||||
"ui-visible",
|
||||
"in-use-system"
|
||||
],
|
||||
"key": {
|
||||
"message": "TeaForo connection"
|
||||
}
|
||||
},
|
||||
{
|
||||
"translated": "Ana bilgisayardaki engelli artalanları",
|
||||
"flags": [
|
||||
|
@ -19376,6 +19457,17 @@
|
|||
"message": "Database ID:"
|
||||
}
|
||||
},
|
||||
{
|
||||
"translated": "TeaForo Bağlantısı",
|
||||
"flags": [
|
||||
"human-modified",
|
||||
"ui-visible",
|
||||
"in-use-system"
|
||||
],
|
||||
"key": {
|
||||
"message": "TeaForo Connection"
|
||||
}
|
||||
},
|
||||
{
|
||||
"translated": "Zaman damgası oluşturun:",
|
||||
"flags": [
|
||||
|
@ -25820,6 +25912,16 @@
|
|||
"in-use-system"
|
||||
]
|
||||
},
|
||||
{
|
||||
"key": {
|
||||
"message": "Renewing TeaForo data."
|
||||
},
|
||||
"translated": "TeaForo verilerini yenileme.",
|
||||
"flags": [
|
||||
"google-translated",
|
||||
"in-use-system"
|
||||
]
|
||||
},
|
||||
{
|
||||
"key": {
|
||||
"message": "Set away on all servers"
|
||||
|
|
|
@ -166,6 +166,11 @@ export class SelectedClientInfo {
|
|||
};
|
||||
this.events.fire("notify_cache_changed", { category: "version" });
|
||||
}
|
||||
|
||||
if('client_teaforo_flags' in event.updated_properties || 'client_teaforo_name' in event.updated_properties || 'client_teaforo_id' in event.updated_properties) {
|
||||
this.updateForumAccount(client);
|
||||
this.events.fire("notify_cache_changed", { category: "forum-account" });
|
||||
}
|
||||
}));
|
||||
|
||||
events.push(client.events.on("notify_audio_level_changed", () => {
|
||||
|
@ -204,6 +209,18 @@ export class SelectedClientInfo {
|
|||
}
|
||||
}
|
||||
|
||||
private updateForumAccount(client: ClientEntry) {
|
||||
if(client.properties.client_teaforo_id) {
|
||||
this.currentClientStatus.forumAccount = {
|
||||
flags: client.properties.client_teaforo_flags,
|
||||
nickname: client.properties.client_teaforo_name,
|
||||
userId: client.properties.client_teaforo_id
|
||||
};
|
||||
} else {
|
||||
this.currentClientStatus.forumAccount = undefined;
|
||||
}
|
||||
}
|
||||
|
||||
private updateChannelGroup(client: ClientEntry) {
|
||||
this.currentClientStatus.channelGroup = client.properties.client_channel_group_id;
|
||||
this.currentClientStatus.channelGroupInheritedChannel = client.properties.client_channel_group_inherited_channel_id;
|
||||
|
@ -242,5 +259,6 @@ export class SelectedClientInfo {
|
|||
this.updateCachedClientStatus(client);
|
||||
this.updateCachedCountry(client);
|
||||
this.updateCachedVolume(client);
|
||||
this.updateForumAccount(client);
|
||||
}
|
||||
}
|
|
@ -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) {
|
||||
|
|
|
@ -1,5 +1,6 @@
|
|||
import * as loader from "tc-loader";
|
||||
import {initializeI18N, tra} from "./i18n/localize";
|
||||
import * as fidentity from "./profiles/identities/TeaForumIdentity";
|
||||
import * as global_ev_handler from "./events/ClientGlobalControlHandler";
|
||||
import {AppParameters, settings, Settings, UrlParameterBuilder, UrlParameterParser} from "tc-shared/settings";
|
||||
import {LogCategory, logDebug, logError, logInfo, logWarn} from "tc-shared/log";
|
||||
|
@ -386,6 +387,8 @@ function main() {
|
|||
server_connections.setActiveConnectionHandler(initialHandler);
|
||||
initialHandler.acquireInputHardware().then(() => {});
|
||||
|
||||
/** Setup the XF forum identity **/
|
||||
fidentity.update_forum();
|
||||
initializeKeyControl();
|
||||
|
||||
checkForUpdatedApp();
|
||||
|
|
|
@ -1,17 +1,18 @@
|
|||
import { decode_identity, IdentitifyType, Identity } from "../profiles/Identity";
|
||||
import { guid } from "../crypto/uid";
|
||||
import { TeaSpeakIdentity } from "../profiles/identities/TeamSpeakIdentity";
|
||||
import { AbstractServerConnection } from "../connection/ConnectionBase";
|
||||
import { HandshakeIdentityHandler } from "../connection/HandshakeHandler";
|
||||
import { createErrorModal } from "../ui/elements/Modal";
|
||||
import { formatMessage } from "../ui/frames/chat";
|
||||
import {decode_identity, IdentitifyType, Identity} from "../profiles/Identity";
|
||||
import {guid} from "../crypto/uid";
|
||||
import {TeaForumIdentity} from "../profiles/identities/TeaForumIdentity";
|
||||
import {TeaSpeakIdentity} from "../profiles/identities/TeamSpeakIdentity";
|
||||
import {AbstractServerConnection} from "../connection/ConnectionBase";
|
||||
import {HandshakeIdentityHandler} from "../connection/HandshakeHandler";
|
||||
import {createErrorModal} from "../ui/elements/Modal";
|
||||
import {formatMessage} from "../ui/frames/chat";
|
||||
import * as loader from "tc-loader";
|
||||
import { Stage } from "tc-loader";
|
||||
import { LogCategory, logDebug, logError } from "tc-shared/log";
|
||||
import { tr } from "tc-shared/i18n/localize";
|
||||
import { getStorageAdapter } from "tc-shared/StorageAdapter";
|
||||
import { ignorePromise } from "tc-shared/proto";
|
||||
import { assertMainApplication } from "tc-shared/ui/utils";
|
||||
import {Stage} from "tc-loader";
|
||||
import {LogCategory, logDebug, logError} from "tc-shared/log";
|
||||
import {tr} from "tc-shared/i18n/localize";
|
||||
import {getStorageAdapter} from "tc-shared/StorageAdapter";
|
||||
import {ignorePromise} from "tc-shared/proto";
|
||||
import {assertMainApplication} from "tc-shared/ui/utils";
|
||||
|
||||
/*
|
||||
* We're loading & saving profiles with the StorageAdapter.
|
||||
|
@ -51,7 +52,9 @@ export class ConnectionProfile {
|
|||
if (current_type === undefined)
|
||||
return undefined;
|
||||
|
||||
if (current_type == IdentitifyType.TEAMSPEAK || current_type == IdentitifyType.NICKNAME) {
|
||||
if (current_type == IdentitifyType.TEAFORO) {
|
||||
return TeaForumIdentity.identity();
|
||||
} else if (current_type == IdentitifyType.TEAMSPEAK || current_type == IdentitifyType.NICKNAME) {
|
||||
return this.identities[IdentitifyType[current_type].toLowerCase()];
|
||||
}
|
||||
|
||||
|
@ -141,7 +144,7 @@ async function loadConnectProfiles() {
|
|||
const profiles_json = await getStorageAdapter().get("profiles");
|
||||
let profiles_data: ProfilesData = (() => {
|
||||
try {
|
||||
return profiles_json ? JSON.parse(profiles_json) : { version: 0 } as any;
|
||||
return profiles_json ? JSON.parse(profiles_json) : {version: 0} as any;
|
||||
} catch (error) {
|
||||
logError(LogCategory.IDENTITIES, tr("Invalid profile json! Resetting profiles :( (%o)"), profiles_json);
|
||||
createErrorModal(tr("Profile data invalid"), formatMessage(tr("The profile data is invalid.{:br:}This might cause data loss."))).open();
|
||||
|
@ -167,7 +170,7 @@ async function loadConnectProfiles() {
|
|||
}
|
||||
|
||||
const defaultProfile = findConnectProfile("default");
|
||||
if (!defaultProfile) { //Create a default profile
|
||||
if (!defaultProfile) { //Create a default profile and teaforo profile
|
||||
{
|
||||
const profile = createConnectProfile(tr("Default Profile"), "default");
|
||||
profile.defaultPassword = "";
|
||||
|
@ -191,6 +194,15 @@ async function loadConnectProfiles() {
|
|||
}
|
||||
}
|
||||
|
||||
{ /* forum identity (works only when connected to the forum) */
|
||||
const profile = createConnectProfile(tr("TeaSpeak Forum Profile"), "teaforo");
|
||||
profile.defaultPassword = "";
|
||||
profile.defaultUsername = "";
|
||||
|
||||
profile.setIdentity(IdentitifyType.TEAFORO, TeaForumIdentity.identity());
|
||||
profile.selectedIdentityType = IdentitifyType[IdentitifyType.TEAFORO];
|
||||
}
|
||||
|
||||
save();
|
||||
}
|
||||
}
|
||||
|
@ -268,7 +280,7 @@ export function delete_profile(profile: ConnectionProfile) {
|
|||
}
|
||||
|
||||
window.addEventListener("beforeunload", event => {
|
||||
if (requires_save()) {
|
||||
if(requires_save()) {
|
||||
save();
|
||||
}
|
||||
});
|
||||
|
|
|
@ -1,46 +1,51 @@
|
|||
import { AbstractServerConnection, ServerCommand } from "../connection/ConnectionBase";
|
||||
import { HandshakeIdentityHandler } from "../connection/HandshakeHandler";
|
||||
import { AbstractCommandHandler } from "../connection/AbstractCommandHandler";
|
||||
import { LogCategory, logError, logWarn } from "tc-shared/log";
|
||||
import { tr } from "tc-shared/i18n/localize";
|
||||
import {AbstractServerConnection, ServerCommand} from "../connection/ConnectionBase";
|
||||
import {HandshakeIdentityHandler} from "../connection/HandshakeHandler";
|
||||
import {AbstractCommandHandler} from "../connection/AbstractCommandHandler";
|
||||
import {LogCategory, logError, logWarn} from "tc-shared/log";
|
||||
import {tr} from "tc-shared/i18n/localize";
|
||||
|
||||
export enum IdentitifyType {
|
||||
TEAFORO,
|
||||
TEAMSPEAK,
|
||||
NICKNAME
|
||||
}
|
||||
|
||||
export interface Identity {
|
||||
fallback_name(): string | undefined;
|
||||
uid(): string;
|
||||
type(): IdentitifyType;
|
||||
fallback_name(): string | undefined ;
|
||||
uid() : string;
|
||||
type() : IdentitifyType;
|
||||
|
||||
valid(): boolean;
|
||||
valid() : boolean;
|
||||
|
||||
encode?(): string;
|
||||
decode(data: string): Promise<void>;
|
||||
encode?() : string;
|
||||
decode(data: string) : Promise<void>;
|
||||
|
||||
spawn_identity_handshake_handler(connection: AbstractServerConnection): HandshakeIdentityHandler;
|
||||
spawn_identity_handshake_handler(connection: AbstractServerConnection) : HandshakeIdentityHandler;
|
||||
}
|
||||
|
||||
/* avoid circular dependencies here */
|
||||
export async function decode_identity(type: IdentitifyType, data: string): Promise<Identity> {
|
||||
export async function decode_identity(type: IdentitifyType, data: string) : Promise<Identity> {
|
||||
let identity: Identity;
|
||||
switch (type) {
|
||||
case IdentitifyType.NICKNAME:
|
||||
const nidentity = require("tc-shared/profiles/identities/NameIdentity");
|
||||
identity = new nidentity.NameIdentity();
|
||||
break;
|
||||
case IdentitifyType.TEAFORO:
|
||||
const fidentity = require("tc-shared/profiles/identities/TeaForumIdentity");
|
||||
identity = new fidentity.TeaForumIdentity(undefined);
|
||||
break;
|
||||
case IdentitifyType.TEAMSPEAK:
|
||||
const tidentity = require("tc-shared/profiles/identities/TeamSpeakIdentity");
|
||||
identity = new tidentity.TeaSpeakIdentity(undefined, undefined);
|
||||
break;
|
||||
}
|
||||
if (!identity)
|
||||
if(!identity)
|
||||
return undefined;
|
||||
|
||||
try {
|
||||
await identity.decode(data)
|
||||
} catch (error) {
|
||||
} catch(error) {
|
||||
logError(LogCategory.IDENTITIES, tr("Failed to decode identity: %o"), error);
|
||||
return undefined;
|
||||
}
|
||||
|
@ -55,6 +60,10 @@ export function create_identity(type: IdentitifyType) {
|
|||
const nidentity = require("tc-shared/profiles/identities/NameIdentity");
|
||||
identity = new nidentity.NameIdentity();
|
||||
break;
|
||||
case IdentitifyType.TEAFORO:
|
||||
const fidentity = require("tc-shared/profiles/identities/TeaForumIdentity");
|
||||
identity = new fidentity.TeaForumIdentity(undefined);
|
||||
break;
|
||||
case IdentitifyType.TEAMSPEAK:
|
||||
const tidentity = require("tc-shared/profiles/identities/TeamSpeakIdentity");
|
||||
identity = new tidentity.TeaSpeakIdentity(undefined, undefined);
|
||||
|
@ -73,9 +82,9 @@ export class HandshakeCommandHandler<T extends AbstractHandshakeIdentityHandler>
|
|||
|
||||
|
||||
handle_command(command: ServerCommand): boolean {
|
||||
if (typeof this[command.command] === "function") {
|
||||
if(typeof this[command.command] === "function") {
|
||||
this[command.command](command.arguments);
|
||||
} else if (command.command == "error") {
|
||||
} else if(command.command == "error") {
|
||||
return false;
|
||||
} else {
|
||||
logWarn(LogCategory.IDENTITIES, tr("Received unknown command while handshaking (%o)"), command);
|
||||
|
@ -102,12 +111,12 @@ export abstract class AbstractHandshakeIdentityHandler implements HandshakeIdent
|
|||
abstract executeHandshake();
|
||||
|
||||
protected trigger_success() {
|
||||
for (const callback of this.callbacks)
|
||||
for(const callback of this.callbacks)
|
||||
callback(true);
|
||||
}
|
||||
|
||||
protected trigger_fail(message: string) {
|
||||
for (const callback of this.callbacks)
|
||||
for(const callback of this.callbacks)
|
||||
callback(false, message);
|
||||
}
|
||||
}
|
135
shared/js/profiles/identities/TeaForumIdentity.ts
Normal file
135
shared/js/profiles/identities/TeaForumIdentity.ts
Normal file
|
@ -0,0 +1,135 @@
|
|||
import {
|
||||
AbstractHandshakeIdentityHandler,
|
||||
HandshakeCommandHandler,
|
||||
IdentitifyType,
|
||||
Identity
|
||||
} from "../../profiles/Identity";
|
||||
import {LogCategory, logError} from "../../log";
|
||||
import {CommandResult} from "../../connection/ServerConnectionDeclaration";
|
||||
import {AbstractServerConnection} from "../../connection/ConnectionBase";
|
||||
import {HandshakeIdentityHandler} from "../../connection/HandshakeHandler";
|
||||
import * as forum from "./teaspeak-forum";
|
||||
import { tr } from "tc-shared/i18n/localize";
|
||||
|
||||
class TeaForumHandshakeHandler extends AbstractHandshakeIdentityHandler {
|
||||
readonly identity: TeaForumIdentity;
|
||||
handler: HandshakeCommandHandler<TeaForumHandshakeHandler>;
|
||||
|
||||
constructor(connection: AbstractServerConnection, identity: TeaForumIdentity) {
|
||||
super(connection);
|
||||
this.identity = identity;
|
||||
this.handler = new HandshakeCommandHandler(connection, this);
|
||||
this.handler["handshakeidentityproof"] = this.handle_proof.bind(this);
|
||||
}
|
||||
|
||||
executeHandshake() {
|
||||
this.connection.getCommandHandler().registerHandler(this.handler);
|
||||
this.connection.send_command("handshakebegin", {
|
||||
intention: 0,
|
||||
authentication_method: this.identity.type(),
|
||||
data: this.identity.data().data_json()
|
||||
}).catch(error => {
|
||||
logError(LogCategory.IDENTITIES, tr("Failed to initialize TeaForum based handshake. Error: %o"), error);
|
||||
|
||||
if(error instanceof CommandResult)
|
||||
error = error.extra_message || error.message;
|
||||
this.trigger_fail("failed to execute begin (" + error + ")");
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
private handle_proof(json) {
|
||||
this.connection.send_command("handshakeindentityproof", {
|
||||
proof: this.identity.data().data_sign()
|
||||
}).catch(error => {
|
||||
logError(LogCategory.IDENTITIES, tr("Failed to proof the identity. Error: %o"), error);
|
||||
|
||||
if(error instanceof CommandResult)
|
||||
error = error.extra_message || error.message;
|
||||
this.trigger_fail("failed to execute proof (" + error + ")");
|
||||
}).then(() => this.trigger_success());
|
||||
}
|
||||
|
||||
protected trigger_fail(message: string) {
|
||||
this.connection.getCommandHandler().unregisterHandler(this.handler);
|
||||
super.trigger_fail(message);
|
||||
}
|
||||
|
||||
protected trigger_success() {
|
||||
this.connection.getCommandHandler().unregisterHandler(this.handler);
|
||||
super.trigger_success();
|
||||
}
|
||||
}
|
||||
|
||||
export class TeaForumIdentity implements Identity {
|
||||
private readonly identity_data: forum.Data;
|
||||
|
||||
valid() : boolean {
|
||||
return !!this.identity_data && !this.identity_data.is_expired();
|
||||
}
|
||||
|
||||
constructor(data: forum.Data) {
|
||||
this.identity_data = data;
|
||||
}
|
||||
|
||||
data() {
|
||||
return this.identity_data;
|
||||
}
|
||||
|
||||
decode(data) : Promise<void> {
|
||||
data = JSON.parse(data);
|
||||
if(data.version !== 1)
|
||||
throw "invalid version";
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
encode() : string {
|
||||
return JSON.stringify({
|
||||
version: 1
|
||||
});
|
||||
}
|
||||
|
||||
spawn_identity_handshake_handler(connection: AbstractServerConnection) : HandshakeIdentityHandler {
|
||||
return new TeaForumHandshakeHandler(connection, this);
|
||||
}
|
||||
|
||||
fallback_name(): string | undefined {
|
||||
return this.identity_data ? this.identity_data.name() : undefined;
|
||||
}
|
||||
|
||||
type(): IdentitifyType {
|
||||
return IdentitifyType.TEAFORO;
|
||||
}
|
||||
|
||||
uid(): string {
|
||||
//FIXME: Real UID!
|
||||
return "TeaForo#" + ((this.identity_data ? this.identity_data.name() : "Another TeaSpeak user"));
|
||||
}
|
||||
|
||||
public static identity() {
|
||||
return static_identity;
|
||||
}
|
||||
}
|
||||
|
||||
let static_identity: TeaForumIdentity;
|
||||
|
||||
export function set_static_identity(identity: TeaForumIdentity) {
|
||||
static_identity = identity;
|
||||
}
|
||||
|
||||
export function update_forum() {
|
||||
if(forum.logged_in() && (!static_identity || static_identity.data() !== forum.data())) {
|
||||
static_identity = new TeaForumIdentity(forum.data());
|
||||
} else {
|
||||
static_identity = undefined;
|
||||
}
|
||||
}
|
||||
|
||||
export function valid_static_forum_identity() : boolean {
|
||||
return static_identity && static_identity.valid();
|
||||
}
|
||||
|
||||
export function static_forum_identity() : TeaForumIdentity | undefined {
|
||||
return static_identity;
|
||||
}
|
399
shared/js/profiles/identities/teaspeak-forum.ts
Normal file
399
shared/js/profiles/identities/teaspeak-forum.ts
Normal file
|
@ -0,0 +1,399 @@
|
|||
import {settings, Settings} from "../../settings";
|
||||
import * as loader from "tc-loader";
|
||||
import * as fidentity from "./TeaForumIdentity";
|
||||
import {LogCategory, logDebug, logError, logInfo, logWarn} from "../../log";
|
||||
import {tr} from "tc-shared/i18n/localize";
|
||||
import {getStorageAdapter} from "tc-shared/StorageAdapter";
|
||||
|
||||
/* TODO: Properly redesign this whole system! */
|
||||
|
||||
declare global {
|
||||
interface Window {
|
||||
grecaptcha: GReCaptcha;
|
||||
}
|
||||
}
|
||||
|
||||
interface GReCaptcha {
|
||||
render(container: string | HTMLElement, parameters: {
|
||||
sitekey: string;
|
||||
theme?: "dark" | "light";
|
||||
size?: "compact" | "normal";
|
||||
|
||||
tabindex?: number;
|
||||
|
||||
callback?: (token: string) => any;
|
||||
"expired-callback"?: () => any;
|
||||
"error-callback"?: (error: any) => any;
|
||||
}) : string; /* widget_id */
|
||||
|
||||
reset(widget_id?: string);
|
||||
}
|
||||
|
||||
export namespace gcaptcha {
|
||||
export async function initialize() {
|
||||
if(typeof(window.grecaptcha) === "undefined") {
|
||||
let script = document.createElement("script");
|
||||
script.async = true;
|
||||
|
||||
let timeout;
|
||||
const callback_name = "captcha_callback_" + Math.random().toString().replace(".", "");
|
||||
try {
|
||||
await new Promise((resolve, reject) => {
|
||||
script.onerror = reject;
|
||||
window[callback_name] = resolve;
|
||||
script.src = "https://www.google.com/recaptcha/api.js?onload=" + encodeURIComponent(callback_name) + "&render=explicit";
|
||||
|
||||
document.body.append(script);
|
||||
timeout = setTimeout(() => reject("timeout"), 15000);
|
||||
});
|
||||
} catch(error) {
|
||||
script.remove();
|
||||
script = undefined;
|
||||
|
||||
logError(LogCategory.GENERAL, tr("Failed to fetch recaptcha javascript source: %o"), error);
|
||||
throw tr("failed to download source");
|
||||
} finally {
|
||||
if(script)
|
||||
script.onerror = undefined;
|
||||
delete window[callback_name];
|
||||
timeout && clearTimeout(timeout);
|
||||
}
|
||||
}
|
||||
|
||||
if(typeof(window.grecaptcha) === "undefined") {
|
||||
throw tr("failed to load recaptcha");
|
||||
}
|
||||
}
|
||||
|
||||
export async function spawn(container: JQuery, key: string, callback_data: (token: string) => any) {
|
||||
try {
|
||||
await initialize();
|
||||
} catch(error) {
|
||||
logError(LogCategory.GENERAL, tr("Failed to initialize G-Recaptcha. Error: %o"), error);
|
||||
throw tr("initialisation failed");
|
||||
}
|
||||
if(container.attr("captcha-uuid"))
|
||||
window.grecaptcha.reset(container.attr("captcha-uuid"));
|
||||
else {
|
||||
container.attr("captcha-uuid", window.grecaptcha.render(container[0], {
|
||||
"sitekey": key,
|
||||
callback: callback_data
|
||||
}));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
function getForumApiURL() {
|
||||
return settings.getValue(Settings.KEY_TEAFORO_URL);
|
||||
}
|
||||
|
||||
export class Data {
|
||||
readonly auth_key: string;
|
||||
readonly raw: string;
|
||||
readonly sign: string;
|
||||
|
||||
parsed: {
|
||||
user_id: number;
|
||||
user_name: string;
|
||||
|
||||
data_age: number;
|
||||
|
||||
user_group_id: number;
|
||||
|
||||
is_staff: boolean;
|
||||
user_groups: number[];
|
||||
};
|
||||
|
||||
constructor(auth: string, raw: string, sign: string) {
|
||||
this.auth_key = auth;
|
||||
this.raw = raw;
|
||||
this.sign = sign;
|
||||
|
||||
this.parsed = JSON.parse(raw);
|
||||
}
|
||||
|
||||
|
||||
data_json() : string { return this.raw; }
|
||||
data_sign() : string { return this.sign; }
|
||||
|
||||
name() : string { return this.parsed.user_name; }
|
||||
|
||||
user_id() { return this.parsed.user_id; }
|
||||
user_group() { return this.parsed.user_group_id; }
|
||||
|
||||
is_stuff() : boolean { return this.parsed.is_staff; }
|
||||
is_premium() : boolean { return this.parsed.user_groups.indexOf(5) != -1; }
|
||||
|
||||
data_age() : Date { return new Date(this.parsed.data_age); }
|
||||
|
||||
is_expired() : boolean { return this.parsed.data_age + 48 * 60 * 60 * 1000 < Date.now(); }
|
||||
should_renew() : boolean { return this.parsed.data_age + 24 * 60 * 60 * 1000 < Date.now(); } /* renew data all 24hrs */
|
||||
}
|
||||
let forumData: Data | undefined;
|
||||
|
||||
export function logged_in() : boolean {
|
||||
return !!forumData && !forumData.is_expired();
|
||||
}
|
||||
|
||||
export function data() : Data { return forumData; }
|
||||
|
||||
export interface LoginResult {
|
||||
status: "success" | "captcha" | "error";
|
||||
|
||||
error_message?: string;
|
||||
captcha?: {
|
||||
type: "gre-captcha" | "unknown";
|
||||
data: any; /* in case of gre-captcha it would be the side key */
|
||||
};
|
||||
}
|
||||
|
||||
export async function login(username: string, password: string, captcha?: any) : Promise<LoginResult> {
|
||||
let response;
|
||||
try {
|
||||
response = await new Promise<any>((resolve, reject) => {
|
||||
$.ajax({
|
||||
url: getForumApiURL() + "?web-api/v1/login",
|
||||
type: "POST",
|
||||
cache: false,
|
||||
data: {
|
||||
username: username,
|
||||
password: password,
|
||||
remember: true,
|
||||
"g-recaptcha-response": captcha
|
||||
},
|
||||
|
||||
crossDomain: true,
|
||||
|
||||
success: resolve,
|
||||
error: (xhr, status, error) => {
|
||||
logDebug(LogCategory.GENERAL, tr("Login request failed %o: %o"), status, error);
|
||||
reject(tr("request failed"));
|
||||
}
|
||||
})
|
||||
});
|
||||
} catch(error) {
|
||||
return {
|
||||
status: "error",
|
||||
error_message: tr("failed to send login request")
|
||||
};
|
||||
}
|
||||
|
||||
if(response["status"] !== "ok") {
|
||||
logError(LogCategory.GENERAL, tr("Response status not okey. Error happend: %o"), response);
|
||||
return {
|
||||
status: "error",
|
||||
error_message: (response["errors"] || [])[0] || tr("Unknown error")
|
||||
};
|
||||
}
|
||||
|
||||
if(!response["success"]) {
|
||||
logError(LogCategory.GENERAL, tr("Login failed. Response %o"), response);
|
||||
|
||||
let message = tr("failed to login");
|
||||
let captcha;
|
||||
/* user/password wrong | and maybe captcha required */
|
||||
if(response["code"] == 1 || response["code"] == 3)
|
||||
message = tr("Invalid username or password");
|
||||
if(response["code"] == 2 || response["code"] == 3) {
|
||||
captcha = {
|
||||
type: response["captcha"]["type"],
|
||||
data: response["captcha"]["siteKey"] //TODO: Why so static here?
|
||||
};
|
||||
if(response["code"] == 2)
|
||||
message = tr("captcha required");
|
||||
}
|
||||
|
||||
return {
|
||||
status: typeof(captcha) !== "undefined" ? "captcha" : "error",
|
||||
error_message: message,
|
||||
captcha: captcha
|
||||
};
|
||||
}
|
||||
//document.cookie = "user_data=" + response["data"] + ";path=/";
|
||||
//document.cookie = "user_sign=" + response["sign"] + ";path=/";
|
||||
|
||||
try {
|
||||
forumData = new Data(response["auth-key"], response["data"], response["sign"]);
|
||||
const adapter = getStorageAdapter();
|
||||
await adapter.set("teaspeak-forum-data", response["data"]);
|
||||
await adapter.set("teaspeak-forum-sign", response["sign"]);
|
||||
await adapter.set("teaspeak-forum-auth", response["auth-key"]);
|
||||
fidentity.update_forum();
|
||||
} catch(error) {
|
||||
logError(LogCategory.GENERAL, tr("Failed to parse forum given data: %o"), error);
|
||||
return {
|
||||
status: "error",
|
||||
error_message: tr("Failed to parse response data")
|
||||
}
|
||||
}
|
||||
|
||||
return {
|
||||
status: "success"
|
||||
};
|
||||
}
|
||||
|
||||
async function resetForumLocalData() {
|
||||
const adapter = getStorageAdapter();
|
||||
await adapter.delete("teaspeak-forum-data");
|
||||
await adapter.delete("teaspeak-forum-sign");
|
||||
await adapter.delete("teaspeak-forum-auth");
|
||||
}
|
||||
|
||||
export async function renew_data() : Promise<"success" | "login-required"> {
|
||||
let response;
|
||||
try {
|
||||
response = await new Promise<any>((resolve, reject) => {
|
||||
$.ajax({
|
||||
url: getForumApiURL() + "?web-api/v1/renew-data",
|
||||
type: "GET",
|
||||
cache: false,
|
||||
|
||||
crossDomain: true,
|
||||
|
||||
data: {
|
||||
"auth-key": forumData.auth_key
|
||||
},
|
||||
|
||||
success: resolve,
|
||||
error: (xhr, status, error) => {
|
||||
logError(LogCategory.GENERAL, tr("Renew request failed %o: %o"), status, error);
|
||||
reject(tr("request failed"));
|
||||
}
|
||||
})
|
||||
});
|
||||
} catch(error) {
|
||||
throw tr("failed to send renew request");
|
||||
}
|
||||
|
||||
if(response["status"] !== "ok") {
|
||||
logError(LogCategory.GENERAL, tr("Response status not okey. Error happend: %o"), response);
|
||||
throw (response["errors"] || [])[0] || tr("Unknown error");
|
||||
}
|
||||
|
||||
if(!response["success"]) {
|
||||
if(response["code"] == 1) {
|
||||
return "login-required";
|
||||
}
|
||||
throw "invalid error code (" + response["code"] + ")";
|
||||
}
|
||||
if(!response["data"] || !response["sign"])
|
||||
throw tr("response missing data");
|
||||
|
||||
logDebug(LogCategory.GENERAL, tr("Renew succeeded. Parsing data."));
|
||||
|
||||
try {
|
||||
forumData = new Data(forumData.auth_key, response["data"], response["sign"]);
|
||||
await getStorageAdapter().set("teaspeak-forum-data", response["data"]);
|
||||
await getStorageAdapter().set("teaspeak-forum-sign", response["sign"]);
|
||||
fidentity.update_forum();
|
||||
} catch(error) {
|
||||
logError(LogCategory.GENERAL, tr("Failed to parse forum given data: %o"), error);
|
||||
throw tr("failed to parse data");
|
||||
}
|
||||
|
||||
return "success";
|
||||
}
|
||||
|
||||
export async function logout() : Promise<void> {
|
||||
if(!logged_in()) {
|
||||
return;
|
||||
}
|
||||
|
||||
let response;
|
||||
try {
|
||||
response = await new Promise<any>((resolve, reject) => {
|
||||
$.ajax({
|
||||
url: getForumApiURL() + "?web-api/v1/logout",
|
||||
type: "GET",
|
||||
cache: false,
|
||||
|
||||
crossDomain: true,
|
||||
|
||||
data: {
|
||||
"auth-key": forumData.auth_key
|
||||
},
|
||||
|
||||
success: resolve,
|
||||
error: (xhr, status, error) => {
|
||||
logInfo(LogCategory.GENERAL, tr("Logout request failed %o: %o"), status, error);
|
||||
reject(tr("request failed"));
|
||||
}
|
||||
})
|
||||
});
|
||||
} catch(error) {
|
||||
throw tr("failed to send logout request");
|
||||
}
|
||||
|
||||
if(response["status"] !== "ok") {
|
||||
logError(LogCategory.GENERAL, tr("Response status not ok. Error happened: %o"), response);
|
||||
throw (response["errors"] || [])[0] || tr("Unknown error");
|
||||
}
|
||||
|
||||
if(!response["success"]) {
|
||||
/* code 1 means not logged in, its an success */
|
||||
if(response["code"] != 1) {
|
||||
throw "invalid error code (" + response["code"] + ")";
|
||||
}
|
||||
}
|
||||
|
||||
forumData = undefined;
|
||||
await resetForumLocalData();
|
||||
fidentity.update_forum();
|
||||
}
|
||||
|
||||
loader.register_task(loader.Stage.JAVASCRIPT_INITIALIZING, {
|
||||
name: "TeaForo initialize",
|
||||
priority: 10,
|
||||
function: async () => {
|
||||
const rawData = await getStorageAdapter().get("teaspeak-forum-data");
|
||||
const rawSign = await getStorageAdapter().get("teaspeak-forum-sign");
|
||||
const rawForumAuth = await getStorageAdapter().get("teaspeak-forum-auth");
|
||||
if(!rawData || !rawSign || !rawForumAuth) {
|
||||
logInfo(LogCategory.GENERAL, tr("No TeaForo authentication found. TeaForo connection status: unconnected"));
|
||||
return;
|
||||
}
|
||||
|
||||
try {
|
||||
forumData = new Data(rawForumAuth, rawData, rawSign);
|
||||
} catch(error) {
|
||||
logError(LogCategory.GENERAL, tr("Failed to initialize TeaForo connection from local data. Error: %o"), error);
|
||||
return;
|
||||
}
|
||||
if(forumData.should_renew()) {
|
||||
logInfo(LogCategory.GENERAL, tr("TeaForo data should be renewed. Executing renew."));
|
||||
renew_data().then(async status => {
|
||||
if(status === "success") {
|
||||
logInfo(LogCategory.GENERAL, tr("TeaForo data has been successfully renewed."));
|
||||
} else {
|
||||
logWarn(LogCategory.GENERAL, tr("Failed to renew TeaForo data. New login required."));
|
||||
await resetForumLocalData();
|
||||
}
|
||||
}).catch(error => {
|
||||
logWarn(LogCategory.GENERAL, tr("Failed to renew TeaForo data. An error occurred: %o"), error);
|
||||
});
|
||||
return;
|
||||
}
|
||||
|
||||
if(forumData && forumData.is_expired()) {
|
||||
logError(LogCategory.GENERAL, tr("TeaForo data is expired. TeaForo connection isn't available!"));
|
||||
}
|
||||
|
||||
|
||||
setInterval(() => {
|
||||
/* if we don't have any _data object set we could not renew anything */
|
||||
if(forumData) {
|
||||
logInfo(LogCategory.IDENTITIES, tr("Renewing TeaForo data."));
|
||||
renew_data().then(async status => {
|
||||
if(status === "success") {
|
||||
logInfo(LogCategory.IDENTITIES,tr("TeaForo data has been successfully renewed."));
|
||||
} else {
|
||||
logWarn(LogCategory.IDENTITIES,tr("Failed to renew TeaForo data. New login required."));
|
||||
await resetForumLocalData();
|
||||
}
|
||||
}).catch(error => {
|
||||
logWarn(LogCategory.GENERAL, tr("Failed to renew TeaForo data. An error occurred: %o"), error);
|
||||
});
|
||||
}
|
||||
}, 24 * 60 * 60 * 1000);
|
||||
}
|
||||
});
|
|
@ -572,6 +572,11 @@ export class Settings {
|
|||
valueType: "boolean",
|
||||
};
|
||||
|
||||
static readonly KEY_TEAFORO_URL: ValuedRegistryKey<string> = {
|
||||
key: "teaforo_url",
|
||||
defaultValue: "https://forum.teaspeak.de/",
|
||||
valueType: "string",
|
||||
};
|
||||
|
||||
static readonly KEY_FONT_SIZE: ValuedRegistryKey<number> = {
|
||||
key: "font_size",
|
||||
|
|
|
@ -74,6 +74,10 @@ export class ClientProperties {
|
|||
client_output_muted: boolean = false;
|
||||
client_is_channel_commander: boolean = false;
|
||||
|
||||
client_teaforo_id: number = 0;
|
||||
client_teaforo_name: string = "";
|
||||
client_teaforo_flags: number = 0; /* 0x01 := Banned | 0x02 := Stuff | 0x04 := Premium */
|
||||
|
||||
|
||||
/* not updated in view! */
|
||||
client_month_bytes_uploaded: number = 0;
|
||||
|
|
|
@ -367,6 +367,11 @@ $bot_thumbnail_height: 9em;
|
|||
}
|
||||
}
|
||||
|
||||
&.clientTeaforoAccount {
|
||||
a, a:visited {
|
||||
color: #d9d9d9;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -248,6 +248,44 @@ const ClientVolume = React.memo(() => {
|
|||
);
|
||||
});
|
||||
|
||||
const ClientForumAccount = React.memo(() => {
|
||||
const events = useContext(EventsContext);
|
||||
const client = useContext(ClientContext);
|
||||
const [ forum, setForum ] = useDependentState<ClientForumInfo>(() => {
|
||||
if(client.type !== "none") {
|
||||
events.fire("query_forum");
|
||||
}
|
||||
|
||||
return undefined;
|
||||
}, [ client.contextHash ]);
|
||||
|
||||
events.reactUse("notify_forum", event => setForum(event.forum), undefined, []);
|
||||
|
||||
if(!forum) {
|
||||
return null;
|
||||
}
|
||||
|
||||
let text = forum.nickname;
|
||||
if((forum.flags & 0x01) > 0) {
|
||||
text += " (" + tr("Banned") + ")";
|
||||
}
|
||||
|
||||
if((forum.flags & 0x02) > 0) {
|
||||
text += " (" + tr("Stuff") + ")";
|
||||
}
|
||||
|
||||
if((forum.flags & 0x04) > 0) {
|
||||
text += " (" + tr("Premium") + ")";
|
||||
}
|
||||
|
||||
|
||||
return (
|
||||
<InfoBlock clientIcon={ClientIcon.ClientInfoForumAccount} valueClass={cssStyle.clientTeaforoAccount}>
|
||||
<Translatable>TeaSpeak Forum account</Translatable>
|
||||
<a href={"https://forum.teaspeak.de/index.php?members/" + forum.userId} target={"_blank"}>{text}</a>
|
||||
</InfoBlock>
|
||||
);
|
||||
});
|
||||
|
||||
const ClientVersion = React.memo(() => {
|
||||
const events = useContext(EventsContext);
|
||||
|
@ -456,6 +494,7 @@ const ConnectedClientInfoBlock = () => {
|
|||
<React.Fragment key={"info"}>
|
||||
<ClientOnlineSince />
|
||||
<ClientCountry />
|
||||
<ClientForumAccount />
|
||||
<ClientVolume />
|
||||
<ClientVersion />
|
||||
<ClientStatus />
|
||||
|
|
|
@ -147,6 +147,31 @@ function apply_basic_info(client: ClientEntry, tag: JQuery, modal: Modal, callba
|
|||
});
|
||||
}
|
||||
|
||||
/* TeaForo */
|
||||
{
|
||||
const container = tag.find(".property-teaforo .value").empty();
|
||||
|
||||
if (client.properties.client_teaforo_id) {
|
||||
container.children().remove();
|
||||
|
||||
let text = client.properties.client_teaforo_name;
|
||||
if ((client.properties.client_teaforo_flags & 0x01) > 0)
|
||||
text += " (" + tr("Banned") + ")";
|
||||
if ((client.properties.client_teaforo_flags & 0x02) > 0)
|
||||
text += " (" + tr("Stuff") + ")";
|
||||
if ((client.properties.client_teaforo_flags & 0x04) > 0)
|
||||
text += " (" + tr("Premium") + ")";
|
||||
|
||||
$.spawn("a")
|
||||
.attr("href", "https://forum.teaspeak.de/index.php?members/" + client.properties.client_teaforo_id)
|
||||
.attr("target", "_blank")
|
||||
.text(text)
|
||||
.appendTo(container);
|
||||
} else {
|
||||
container.append($.spawn("a").text(tr("Not connected")));
|
||||
}
|
||||
}
|
||||
|
||||
/* Version */
|
||||
{
|
||||
const container = tag.find(".property-version");
|
||||
|
|
|
@ -6,6 +6,7 @@ import {manager, setSoundMasterVolume, Sound} from "tc-shared/audio/Sounds";
|
|||
import * as profiles from "tc-shared/profiles/ConnectionProfile";
|
||||
import {ConnectionProfile} from "tc-shared/profiles/ConnectionProfile";
|
||||
import {IdentitifyType} from "tc-shared/profiles/Identity";
|
||||
import {TeaForumIdentity} from "tc-shared/profiles/identities/TeaForumIdentity";
|
||||
import {TeaSpeakIdentity} from "tc-shared/profiles/identities/TeamSpeakIdentity";
|
||||
import {NameIdentity} from "tc-shared/profiles/identities/NameIdentity";
|
||||
import {LogCategory, logDebug, logError, logTrace, logWarn} from "tc-shared/log";
|
||||
|
@ -13,6 +14,7 @@ import * as i18n from "tc-shared/i18n/localize";
|
|||
import {RepositoryTranslation, TranslationRepository} from "tc-shared/i18n/localize";
|
||||
import {Registry} from "tc-shared/events";
|
||||
import * as i18nc from "../../i18n/CountryFlag";
|
||||
import * as forum from "tc-shared/profiles/identities/teaspeak-forum";
|
||||
import {formatMessage, set_icon_size} from "tc-shared/ui/frames/chat";
|
||||
import {spawnTeamSpeakIdentityImport, spawnTeamSpeakIdentityImprove} from "tc-shared/ui/modal/ModalIdentity";
|
||||
import {getAudioBackend, OutputDevice} from "tc-shared/audio/Player";
|
||||
|
@ -30,8 +32,12 @@ type ProfileInfoEvent = {
|
|||
id: string,
|
||||
name: string,
|
||||
nickname: string,
|
||||
identity_type: "teamspeak" | "nickname",
|
||||
identity_type: "teaforo" | "teamspeak" | "nickname",
|
||||
|
||||
identity_forum?: {
|
||||
valid: boolean,
|
||||
fallback_name: string
|
||||
},
|
||||
identity_nickname?: {
|
||||
name: string,
|
||||
fallback_name: string
|
||||
|
@ -65,7 +71,7 @@ export interface SettingProfileEvents {
|
|||
|
||||
"select-identity-type": {
|
||||
profile_id: string,
|
||||
identity_type: "teamspeak" | "nickname" | "unset"
|
||||
identity_type: "teamspeak" | "teaforo" | "nickname" | "unset"
|
||||
},
|
||||
|
||||
"query-profile-validity": { profile_id: string },
|
||||
|
@ -226,6 +232,7 @@ export function spawnSettingsModal(default_page?: string): Modal {
|
|||
settings_audio_speaker(modal.htmlTag.find(".right .container.audio-speaker"), modal);
|
||||
settings_audio_sounds(modal.htmlTag.find(".right .container.audio-sounds"), modal);
|
||||
const update_profiles = settings_identity_profiles(modal.htmlTag.find(".right .container.identity-profiles"), modal);
|
||||
settings_identity_forum(modal.htmlTag.find(".right .container.identity-forum"), modal, update_profiles as any);
|
||||
|
||||
modal.close_listener.push(() => {
|
||||
if (profiles.requires_save())
|
||||
|
@ -873,6 +880,7 @@ export namespace modal_settings {
|
|||
});
|
||||
|
||||
const build_profile_info = (profile: ConnectionProfile) => {
|
||||
const forum_data = profile.selectedIdentity(IdentitifyType.TEAFORO) as TeaForumIdentity;
|
||||
const teamspeak_data = profile.selectedIdentity(IdentitifyType.TEAMSPEAK) as TeaSpeakIdentity;
|
||||
const nickname_data = profile.selectedIdentity(IdentitifyType.NICKNAME) as NameIdentity;
|
||||
|
||||
|
@ -881,6 +889,10 @@ export namespace modal_settings {
|
|||
name: profile.profileName,
|
||||
nickname: profile.defaultUsername,
|
||||
identity_type: profile.selectedIdentityType as any,
|
||||
identity_forum: !forum_data ? undefined : {
|
||||
valid: forum_data.valid(),
|
||||
fallback_name: forum_data.fallback_name()
|
||||
},
|
||||
identity_nickname: !nickname_data ? undefined : {
|
||||
name: nickname_data.name(),
|
||||
fallback_name: nickname_data.fallback_name()
|
||||
|
@ -1453,6 +1465,7 @@ export namespace modal_settings {
|
|||
if (event.status === "success") {
|
||||
current_identity_type = event.info.identity_type;
|
||||
fallback_names["nickname"] = event.info.identity_nickname ? event.info.identity_nickname.fallback_name : undefined;
|
||||
fallback_names["teaforo"] = event.info.identity_forum ? event.info.identity_forum.fallback_name : undefined;
|
||||
fallback_names["teamspeak"] = event.info.identity_teamspeak ? event.info.identity_teamspeak.fallback_name : undefined;
|
||||
|
||||
last_name = event.info.nickname;
|
||||
|
@ -1709,6 +1722,37 @@ export namespace modal_settings {
|
|||
button_improve.on('click', event => event_registry.fire("improve-identity-teamspeak-level", {profile_id: current_profile}));
|
||||
}
|
||||
|
||||
/* special info TeaSpeak - Forum */
|
||||
{
|
||||
const container_settings = container.find(".container-teaforo");
|
||||
const container_valid = container_settings.find(".container-valid");
|
||||
const container_invalid = container_settings.find(".container-invalid");
|
||||
|
||||
const button_setup = container_settings.find(".button-setup");
|
||||
|
||||
event_registry.on("select-identity-type", event => {
|
||||
if (event.profile_id !== current_profile) return;
|
||||
|
||||
container_settings.toggle(event.identity_type === "teaforo");
|
||||
});
|
||||
|
||||
event_registry.on("query-profile", event => {
|
||||
container_valid.toggle(false);
|
||||
container_invalid.toggle(false);
|
||||
});
|
||||
|
||||
event_registry.on("query-profile-result", event => {
|
||||
if (event.profile_id !== current_profile) return;
|
||||
|
||||
const valid = event.status === "success" && event.info.identity_forum && event.info.identity_forum.valid;
|
||||
container_valid.toggle(!!valid);
|
||||
container_invalid.toggle(!valid);
|
||||
});
|
||||
|
||||
button_setup.on('click', event => event_registry.fire_react("setup-forum-connection"));
|
||||
button_setup.toggle(settings.forum_setuppable);
|
||||
}
|
||||
|
||||
/* special info nickname */
|
||||
{
|
||||
const container_settings = container.find(".container-nickname");
|
||||
|
@ -1883,3 +1927,117 @@ export namespace modal_settings {
|
|||
event_registry.fire("select-identity-type", {profile_id: "default", identity_type: undefined});
|
||||
}
|
||||
}
|
||||
|
||||
function settings_identity_forum(container: JQuery, modal: Modal, update_profiles: () => any) {
|
||||
const containers_connected = container.find(".show-connected");
|
||||
const containers_disconnected = container.find(".show-disconnected");
|
||||
|
||||
const update_state = () => {
|
||||
const logged_in = forum.logged_in();
|
||||
containers_connected.toggle(logged_in);
|
||||
containers_disconnected.toggle(!logged_in);
|
||||
|
||||
if (logged_in) {
|
||||
container.find(".forum-username").text(forum.data().name());
|
||||
container.find(".forum-premium").text(forum.data().is_premium() ? tr("Yes") : tr("No"));
|
||||
}
|
||||
};
|
||||
|
||||
/* login */
|
||||
{
|
||||
const button_login = container.find(".button-login");
|
||||
const input_username = container.find(".input-username");
|
||||
const input_password = container.find(".input-password");
|
||||
const container_error = container.find(".container-login .container-error");
|
||||
|
||||
const container_captcha_g = container.find(".g-recaptcha");
|
||||
let captcha: boolean | string = false;
|
||||
|
||||
const update_button_state = () => {
|
||||
let enabled = true;
|
||||
enabled = enabled && !!input_password.val();
|
||||
enabled = enabled && !!input_username.val();
|
||||
enabled = enabled && (typeof (captcha) === "boolean" ? !captcha : !!captcha);
|
||||
button_login.prop("disabled", !enabled);
|
||||
};
|
||||
|
||||
/* username */
|
||||
input_username.on('change keyup', update_button_state);
|
||||
|
||||
/* password */
|
||||
input_password.on('change keyup', update_button_state);
|
||||
|
||||
button_login.on('click', event => {
|
||||
input_username.prop("disabled", true);
|
||||
input_password.prop("disabled", true);
|
||||
button_login.prop("disabled", true);
|
||||
container_error.removeClass("shown");
|
||||
|
||||
forum.login(input_username.val() as string, input_password.val() as string, typeof (captcha) === "string" ? captcha : undefined).then(state => {
|
||||
captcha = false;
|
||||
|
||||
logTrace(LogCategory.GENERAL, tr("Forum login result: %o"), state);
|
||||
if (state.status === "success") {
|
||||
update_state();
|
||||
update_profiles();
|
||||
return;
|
||||
}
|
||||
|
||||
setTimeout(() => {
|
||||
if (!!state.error_message) /* clear password if we have an error */
|
||||
input_password.val("");
|
||||
input_password.focus();
|
||||
update_button_state();
|
||||
}, 0);
|
||||
if (state.status === "captcha") {
|
||||
//TODO Works currently only with localhost!
|
||||
button_login.hide();
|
||||
container_error.text(state.error_message || tr("Captcha required")).addClass("shown");
|
||||
|
||||
captcha = "";
|
||||
|
||||
logDebug(LogCategory.GENERAL, tr("Showing captcha for site-key: %o"), state.captcha.data);
|
||||
forum.gcaptcha.spawn(container_captcha_g, state.captcha.data, token => {
|
||||
captcha = token;
|
||||
logTrace(LogCategory.GENERAL, tr("Got captcha token: %o"), token);
|
||||
container_captcha_g.hide();
|
||||
button_login.show();
|
||||
update_button_state();
|
||||
}).catch(error => {
|
||||
logError(LogCategory.GENERAL, tr("Failed to initialize forum captcha: %o"), error);
|
||||
container_error.text("Failed to initialize GReCaptcha! No authentication possible.").addClass("shown");
|
||||
container_captcha_g.hide();
|
||||
button_login.hide();
|
||||
});
|
||||
container_captcha_g.show();
|
||||
} else {
|
||||
container_error.text(state.error_message || tr("Unknown error")).addClass("shown");
|
||||
}
|
||||
}).catch(error => {
|
||||
logError(LogCategory.GENERAL, tr("Failed to login within the forum. Error: %o"), error);
|
||||
createErrorModal(tr("Forum login failed."), tr("Forum login failed. Lookup the console for more information")).open();
|
||||
}).then(() => {
|
||||
input_username.prop("disabled", false);
|
||||
input_password.prop("disabled", false);
|
||||
update_button_state();
|
||||
});
|
||||
});
|
||||
update_button_state();
|
||||
}
|
||||
|
||||
/* logout */
|
||||
{
|
||||
container.find(".button-logout").on('click', event => {
|
||||
forum.logout().catch(error => {
|
||||
logError(LogCategory.IDENTITIES, tr("Failed to logout from forum: %o"), error);
|
||||
createErrorModal(tr("Forum logout failed"), formatMessage(tr("Failed to logout from forum account.{:br:}Error: {}"), error)).open();
|
||||
}).then(() => {
|
||||
if (modal.shown)
|
||||
update_state();
|
||||
update_profiles();
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
update_state();
|
||||
}
|
|
@ -14,7 +14,6 @@
|
|||
},
|
||||
"include": [
|
||||
"webpack.config.ts",
|
||||
"webpack-client.config.ts",
|
||||
"webpack-web.config.ts",
|
||||
"webpack/build-definitions.d.ts",
|
||||
"webpack/HtmlWebpackInlineSource.ts",
|
||||
|
|
|
@ -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);
|
||||
});
|
Loading…
Add table
Reference in a new issue