Compare commits

...

18 Commits
main ... strip2

Author SHA1 Message Date
gapodo a198a62489 use native
ci/woodpecker/push/base Pipeline was successful Details
2023-11-21 01:39:20 +01:00
gapodo 40586967f5 twitter icons?
ci/woodpecker/push/base Pipeline was successful Details
2023-11-21 01:33:23 +01:00
gapodo 1be03a780e new icon
ci/woodpecker/push/base Pipeline was successful Details
2023-11-21 01:27:25 +01:00
gapodo 51149349d6 fix?
ci/woodpecker/push/base Pipeline was successful Details
2023-11-21 01:03:14 +01:00
gapodo 6372bff69f next
ci/woodpecker/push/base Pipeline failed Details
2023-11-21 00:36:09 +01:00
gapodo 9bb82e3083 fix?
ci/woodpecker/push/base Pipeline was successful Details
2023-11-20 23:57:08 +01:00
gapodo 7d5496e105 redo emoji
ci/woodpecker/push/base Pipeline was successful Details
2023-11-20 23:34:41 +01:00
gapodo 4c5e744f62 build...
ci/woodpecker/push/base Pipeline was successful Details
2023-11-20 14:17:03 +01:00
gapodo 86351e336c build
ci/woodpecker/push/base Pipeline was successful Details
2023-11-20 13:56:13 +01:00
gapodo 24c6a1e22e update build 2023-11-20 13:52:23 +01:00
gapodo 2a1fd11e2d stun change
ci/woodpecker/push/base Pipeline was successful Details
2023-11-20 01:13:22 +01:00
gapodo 063fdae679 autotag
ci/woodpecker/push/base Pipeline was successful Details
2023-11-19 23:38:50 +01:00
gapodo e5551cea09 fix?
ci/woodpecker/push/base Pipeline was successful Details
2023-11-19 23:07:07 +01:00
gapodo 3ec3db37e0 ci
ci/woodpecker/push/base Pipeline failed Details
2023-11-19 23:00:03 +01:00
gapodo feb564d4a0 save all with +x as script changes them anyways 2023-11-18 20:58:15 +01:00
gapodo bde4bbf5ad build... 2023-11-18 19:25:19 +01:00
gapodo ef0813dd84 hard lock wabt (has breaking change within minor version) 2023-11-17 22:25:04 +01:00
gapodo 5b8b4d07c3 updates... 2023-11-17 21:47:09 +01:00
50 changed files with 5933 additions and 3719 deletions

1
.gitignore vendored
View File

@ -2,6 +2,7 @@
.idea/
node_modules/
.sass-cache/
.npm/
/auth/certs/
/auth/js/auth.js.map

4
.npmrc Normal file
View File

@ -0,0 +1,4 @@
audit=false
fund=false
update-notifier=false
package-lock=true

89
.woodpecker/base.yaml Normal file
View File

@ -0,0 +1,89 @@
when:
event: [push, deployment, manual, cron]
labels:
platform: linux/amd64
variables:
- &node_image 'node:14-bullseye'
- &buildx_image 'woodpeckerci/plugin-docker-buildx:2.2.1'
- &platforms 'linux/amd64'
- &dockerfile 'docker/Dockerfile.ci'
steps:
prepare-npm:
image: *node_image
secrets:
- npmconf
commands:
- git config --add safe.directory '*'
- if [ "$${NPMCONF:-}" != "" ]; then echo "$${NPMCONF}" >> "$${HOME}/.npmrc"; fi
- npm ci
- npx browserslist@latest --update-db
build-npm:
image: *node_image
commands:
- bash ./scripts/build.sh web rel
build-docker-next:
image: *buildx_image
pull: true
settings:
platforms: *platforms
dockerfile: *dockerfile
context: .
registry:
from_secret: registry_domain
repo:
from_secret: target_image_name
password:
from_secret: registry_token
username:
from_secret: registry_user
auto_tag: true
tag: [next, "next-${CI_COMMIT_SHA:0:8}"]
when:
branch: ${CI_REPO_DEFAULT_BRANCH}
event: push
build-docker-branch:
image: *buildx_image
pull: true
settings:
platforms: *platforms
dockerfile: *dockerfile
context: .
registry:
from_secret: registry_domain
repo:
from_secret: target_image_name
password:
from_secret: registry_token
username:
from_secret: registry_user
auto_tag: true
tag: ["${CI_COMMIT_BRANCH}", "${CI_COMMIT_BRANCH}-${CI_COMMIT_SHA:0:8}"]
when:
event: [push, manual]
build-docker-tag:
image: *buildx_image
pull: true
settings:
platforms: *platforms
dockerfile: *dockerfile
context: .
registry:
from_secret: registry_domain
repo:
from_secret: target_image_name
password:
from_secret: registry_token
username:
from_secret: registry_user
auto_tag: true
tag: [latest, "${CI_COMMIT_TAG}", "tag-${CI_COMMIT_SHA:0:8}"]
when:
event: [tag]

View File

@ -4,14 +4,12 @@ export default api => {
[
"@babel/preset-env",
{
"corejs": {"version": 3},
"corejs": {"version": '3.33', "proposals": false},
"useBuiltIns": "usage",
"targets": {
"edge": "17",
"firefox": "60",
"chrome": "67",
"safari": "11.1",
"ie": "11"
"edge": "111",
"firefox": "100",
"chrome": "109"
}
}
]

0
client/generate_packed.sh Normal file → Executable file
View File

17
docker/Dockerfile.base Normal file
View File

@ -0,0 +1,17 @@
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;"]

19
docker/Dockerfile.ci Normal file
View File

@ -0,0 +1,19 @@
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;"]
COPY ./dist/ /var/www/TeaWeb/

36
docker/default.conf Normal file
View File

@ -0,0 +1,36 @@
server {
listen 80;
server_name _;
return 301 https://$host$request_uri;
}
server {
listen 443 default_server ssl http2;
server_name _;
ssl_ciphers EECDH+AESGCM:EDH+AESGCM:AES256+EECDH:AES256+EDH:ECDHE-ECDSA-CHACHA20-POLY1305:ECDHE-ECDSA-AES256-GCM-SHA384:ECDHE-ECDSA-AES128-GCM-SHA256:TLS-CHACHA20-POLY1305-SHA256:TLS-AES-256-GCM-SHA384:TLS-AES-128-GCM-SHA256;
ssl_protocols TLSv1.2 TLSv1.3;
ssl_dhparam /etc/ssl/certs/dhparam.pem;
ssl_ecdh_curve secp384r1;
ssl_certificate /etc/ssl/certs/tea_bundle.crt;
ssl_certificate_key /etc/ssl/certs/tea.key;
ssl_session_cache shared:MozSSL:10m;
ssl_session_timeout 1d;
ssl_prefer_server_ciphers on;
location / {
root /var/www/TeaWeb;
index index.html;
}
#error_page 404 /404.html;
# redirect server error pages to the static page /50x.html
#
error_page 500 502 503 504 /50x.html;
location = /50x.html {
root /usr/share/nginx/html;
}
gzip off;
}

29
docker/entrypoint.sh Executable file
View File

@ -0,0 +1,29 @@
#!/usr/bin/env sh
set -e
gen_self_signed() {
echo "[WRN] No certificates found, generating self signed cert with key"
openssl req -x509 -nodes -days 1780 -newkey rsa:4096 \
-keyout /etc/ssl/certs/tea.key \
-out /etc/ssl/certs/tea_bundle.crt \
-subj "/C=DE/ST=Berlin/L=Germany/O=TeaSpeak/OU=TeaWeb/CN=localhost/emailAddress=noreply@teaspeak.de"
}
gen_diffie_hellman() {
echo "[INF] No Diffie-Hellman pem found, generating new with 2048 byte"
openssl dhparam -out /etc/ssl/certs/dhparam.pem 2048
}
if [ "$1" = "nginx" ]; then
if [ ! -f /etc/ssl/certs/tea.key ] && [ ! -f /etc/ssl/certs/tea_bundle.crt ]; then
gen_self_signed
elif [ ! -f /etc/ssl/certs/tea.key ] || [ ! -f /etc/ssl/certs/tea_bundle.crt ]; then
echo "[ERR] Only found a key or crt-bundle file but both files are REQUIRED!"
exit 1
fi
if [ ! -f /etc/ssl/certs/dhparam.pem ]; then
gen_diffie_hellman
fi
fi
exec "$@"

32
docker/nginx.conf Normal file
View File

@ -0,0 +1,32 @@
user nginx;
worker_processes auto;
error_log /var/log/nginx/error.log warn;
pid /var/run/nginx.pid;
events {
worker_connections 1024;
}
http {
include /etc/nginx/mime.types;
default_type application/octet-stream;
log_format main '$remote_addr - $remote_user [$time_local] "$request" '
'$status $body_bytes_sent "$http_referer" '
'"$http_user_agent" "$http_x_forwarded_for"';
access_log /var/log/nginx/access.log main;
sendfile on;
#tcp_nopush on;
server_tokens off;
keepalive_timeout 75;
#gzip on;
include /etc/nginx/conf.d/*.conf;
}

View File

@ -24,7 +24,7 @@ export {};
if (__build.target === "client") {
/* do this so we don't get a react dev tools warning within the client */
if (!('__REACT_DEVTOOLS_GLOBAL_HOOK__' in window)) {
window.__REACT_DEVTOOLS_GLOBAL_HOOK__ = {};
(window as Window).__REACT_DEVTOOLS_GLOBAL_HOOK__ = {};
}
window.__REACT_DEVTOOLS_GLOBAL_HOOK__.inject = function () { };

View File

@ -9,7 +9,6 @@
<meta name="og:description" content="The TeaSpeak Web client is a in the browser running client for the VoIP communication software TeaSpeak." />
<meta name="og:url" content="https://web.teaspeak.de/">
<% /* TODO: Put in an appropriate image <meta name="og:image" content="https://www.whatsapp.com/img/whatsapp-promo.png"> */ %>
<% /* Using an absolute path here since the manifest.json works only with such. */ %>
<% /* <link rel="manifest" href="/manifest.json"> */ %>
@ -27,19 +26,6 @@
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
<meta name="format-detection" content="telephone=no">
<!-- Global site tag (gtag.js) - Google Analytics -->
<script defer async src="https://www.googletagmanager.com/gtag/js?id=UA-113151733-4"></script>
<script>
window.dataLayer = window.dataLayer || [];
function gtag() {
dataLayer.push(arguments);
}
gtag('js', new Date());
gtag('config', 'UA-113151733-4');
</script>
<link rel="preload" as="image" href="<%= require("./images/initial-sequence.gif") %>">
<link rel="preload" as="image" href="<%= require("./images/bowl.png") %>">
<% /* We don't preload the bowl since it's only a div background */ %>

7020
package-lock.json generated

File diff suppressed because it is too large Load Diff

View File

@ -17,74 +17,74 @@
"author": "TeaSpeak (WolverinDEV)",
"license": "ISC",
"devDependencies": {
"@babel/core": "^7.10.4",
"@babel/plugin-transform-runtime": "^7.10.4",
"@babel/preset-env": "^7.10.4",
"@babel/core": "^7.23.3",
"@babel/plugin-transform-runtime": "^7.23.3",
"@babel/preset-env": "^7.23.3",
"@google-cloud/translate": "^5.3.0",
"@svgr/webpack": "^5.5.0",
"@types/dompurify": "^2.0.1",
"@types/ejs": "^3.0.2",
"@types/emoji-mart": "^3.0.2",
"@types/emscripten": "^1.38.0",
"@types/fs-extra": "^8.0.1",
"@types/dompurify": "^2.4.0",
"@types/ejs": "^3.1.5",
"@types/emscripten": "^1.39.10",
"@types/fs-extra": "^8.1.5",
"@types/html-minifier": "^3.5.3",
"@types/jquery": "^3.3.34",
"@types/jquery": "^3.5.27",
"@types/jsrender": "^1.0.5",
"@types/lodash": "^4.14.149",
"@types/lodash": "^4.14.201",
"@types/moment": "^2.13.0",
"@types/node": "^12.7.2",
"@types/react-color": "^3.0.4",
"@types/react-dom": "^16.9.5",
"@types/react-grid-layout": "^1.1.1",
"@types/remarkable": "^1.7.4",
"@types/sdp-transform": "^2.4.4",
"@types/sha256": "^0.2.0",
"@types/twemoji": "^12.1.1",
"@types/node": "^12.20.55",
"@types/react": "^16.14.51",
"@types/react-color": "^3.0.10",
"@types/react-dom": "^16.9.22",
"@types/react-grid-layout": "^1.3.5",
"@types/remarkable": "^1.7.6",
"@types/sdp-transform": "^2.4.9",
"@types/sha256": "^0.2.2",
"@types/twemoji": "^12.1.2",
"@types/websocket": "0.0.40",
"@types/xml-parser": "^1.2.29",
"@wasm-tool/wasm-pack-plugin": "^1.3.1",
"autoprefixer": "^10.2.5",
"babel-loader": "^8.1.0",
"circular-dependency-plugin": "^5.2.0",
"clean-css": "^4.2.1",
"@types/xml-parser": "^1.2.33",
"@wasm-tool/wasm-pack-plugin": "^1.7.0",
"autoprefixer": "^10.4.16",
"babel-loader": "^8.3.0",
"circular-dependency-plugin": "^5.2.2",
"clean-css": "^4.2.4",
"clean-webpack-plugin": "^3.0.0",
"copy-webpack-plugin": "^8.0.0",
"copy-webpack-plugin": "^8.1.1",
"css-loader": "^3.6.0",
"css-minimizer-webpack-plugin": "^1.3.0",
"exports-loader": "^0.7.0",
"fast-xml-parser": "^3.17.4",
"file-loader": "^6.0.0",
"fast-xml-parser": "^3.21.1",
"file-loader": "^6.2.0",
"fs-extra": "latest",
"gulp": "^4.0.2",
"html-loader": "^1.0.0",
"html-loader": "^1.3.2",
"html-minifier": "^4.0.0",
"html-webpack-inline-source-plugin": "0.0.10",
"html-webpack-plugin": "^5.3.1",
"html-webpack-plugin": "^5.5.3",
"inline-chunks-html-webpack-plugin": "^1.3.1",
"mime-types": "^2.1.24",
"mini-css-extract-plugin": "^1.3.9",
"mkdirp": "^0.5.1",
"mime-types": "^2.1.35",
"mini-css-extract-plugin": "^1.6.2",
"mkdirp": "^0.5.6",
"node-sass": "^4.14.1",
"postcss": "^8.3.0",
"postcss-loader": "^5.2.0",
"potpack": "^1.0.1",
"raw-loader": "^4.0.0",
"postcss": "^8.4.31",
"postcss-loader": "^5.3.0",
"potpack": "^1.0.2",
"raw-loader": "^4.0.2",
"sass": "1.22.10",
"sass-loader": "^8.0.2",
"sha256": "^0.2.0",
"style-loader": "^1.1.3",
"style-loader": "^1.3.0",
"svg-inline-loader": "^0.8.2",
"terser": "^4.2.1",
"terser": "^4.8.1",
"terser-webpack-plugin": "4.2.3",
"ts-loader": "^6.2.2",
"ts-loader": "^8.4.0",
"tsd": "^0.13.1",
"typescript": "^4.2",
"typescript": "^4.9.5",
"url-loader": "^4.1.1",
"wabt": "^1.0.13",
"webpack": "^5.26.1",
"webpack-bundle-analyzer": "^3.6.1",
"webpack-cli": "^4.5.0",
"webpack-dev-server": "^3.11.2",
"wabt": "1.0.13",
"webpack": "^5.89.0",
"webpack-bundle-analyzer": "^3.9.0",
"webpack-cli": "^4.10.0",
"webpack-dev-server": "^3.11.3",
"webpack-svg-sprite-generator": "^5.0.4",
"zip-webpack-plugin": "^4.0.1"
},
@ -97,33 +97,35 @@
},
"homepage": "https://www.teaspeak.de",
"dependencies": {
"@types/crypto-js": "^4.0.1",
"@emoji-mart/data": "^1.1.2",
"@emoji-mart/react": "^1.1.1",
"@types/crypto-js": "^4.2.1",
"broadcastchannel-polyfill": "^1.0.1",
"buffer": "^6.0.3",
"crypto-browserify": "^3.12.0",
"crypto-js": "^4.0.0",
"detect-browser": "^5.2.0",
"dompurify": "^2.2.8",
"emoji-mart": "git+https://github.com/WolverinDEV/emoji-mart.git",
"emoji-regex": "^9.0.0",
"highlight.js": "^10.1.1",
"ip-regex": "^4.2.0",
"jquery": "^3.5.1",
"jsrender": "^1.0.7",
"moment": "^2.24.0",
"react": "^16.13.1",
"react-dom": "^16.13.1",
"react-grid-layout": "^1.2.2",
"react-player": "^2.5.0",
"crypto-js": "^4.2.0",
"detect-browser": "^5.3.0",
"dompurify": "^2.4.7",
"emoji-mart": "^5.5.2",
"emoji-regex": "^9.2.2",
"highlight.js": "^10.7.3",
"ip-regex": "^4.3.0",
"jquery": "^3.7.1",
"jsrender": "^1.0.13",
"moment": "^2.29.4",
"react": "^16.14.0",
"react-dom": "^16.14.0",
"react-grid-layout": "^1.4.3",
"react-player": "^2.13.0",
"remarkable": "^2.0.1",
"resize-observer-polyfill": "git+https://github.com/albancreton/resize-observer-polyfill.git#patch-1",
"sdp-transform": "^2.14.0",
"sdp-transform": "^2.14.1",
"simple-jsonp-promise": "^1.1.0",
"stream-browserify": "^3.0.0",
"twemoji": "^13.0.0",
"twemoji": "^13.1.1",
"url-knife": "^3.1.3",
"webcrypto-liner": "^1.2.4",
"webpack-manifest-plugin": "^3.1.0",
"webcrypto-liner": "^1.4.2",
"webpack-manifest-plugin": "^3.2.0",
"webrtc-adapter": "^7.5.1"
}
}

0
scripts/build.sh Normal file → Executable file
View File

0
scripts/build_declarations.sh Normal file → Executable file
View File

45
scripts/build_in_docker.sh Executable file
View File

@ -0,0 +1,45 @@
#!/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 [[ "${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'
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
echo "running chmods"
find "${BASEPATH}" -iname "*.sh" -exec chmod +x {} +
echo "Cleaning up old files"
"${BASEPATH}/scripts/cleanup.sh" full >/dev/null 2>&1 || exit 1
echo "Installing npm packages"
npm i || exit 1
echo "Updating browser list"
npx browserslist@latest --update-db || exit 1
echo "running build"
"${BASEPATH}/scripts/build.sh" web rel
echo "fixing perms"
chown -R 1000:1000 /work

0
scripts/cleanup.sh Normal file → Executable file
View File

0
scripts/deploy_ui_files.sh Normal file → Executable file
View File

0
scripts/helper.sh Normal file → Executable file
View File

0
scripts/install_dependencies.sh Normal file → Executable file
View File

0
scripts/travis/build.sh Normal file → Executable file
View File

0
scripts/travis/deploy_docker.sh Normal file → Executable file
View File

0
scripts/travis/deploy_github.sh Normal file → Executable file
View File

0
scripts/travis/deploy_server.sh Normal file → Executable file
View File

0
scripts/travis/properties.sh Normal file → Executable file
View File

0
shared/generate_declarations.sh Normal file → Executable file
View File

BIN
shared/img/smiley.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 17 KiB

View File

@ -107,12 +107,12 @@ export class BookmarkManager {
connectOnStartup: false,
connectProfile: "default",
displayName: "Official TeaSpeak - Test server",
displayName: "Our LanPart<",
parentEntry: undefined,
previousEntry: undefined,
serverAddress: "ts.teaspeak.de",
serverAddress: "tea.lp.kle.li",
serverPasswordHash: undefined,
defaultChannel: undefined,

View File

@ -89,7 +89,7 @@ export class AbstractKeyBoard implements KeyBoardBackend {
return;
}
this.registeredKeyHooks.remove(hook);
this.registeredKeyHooks.remove(hook as RegisteredKeyHook);
}
registerListener(listener: (event: KeyEvent) => void) {

View File

@ -16,10 +16,10 @@ import {getAudioBackend} from "tc-shared/audio/Player";
const kSdpCompressionMode = 1;
declare global {
interface RTCIceCandidate {
/* Firefox has this */
address: string | undefined;
}
// interface RTCIceCandidate {
// /* Firefox has this */
// address: string;
// }
interface HTMLCanvasElement {
captureStream(framed: number): MediaStream;
@ -583,7 +583,6 @@ export class RTCConnection {
this.peer.onicegatheringstatechange = undefined;
this.peer.onnegotiationneeded = undefined;
this.peer.onsignalingstatechange = undefined;
this.peer.onstatsended = undefined;
this.peer.ontrack = undefined;
this.peer.close();
@ -896,7 +895,7 @@ export class RTCConnection {
this.peer = new RTCPeerConnection({
bundlePolicy: "max-bundle",
rtcpMuxPolicy: "require",
iceServers: [{ urls: ["stun:stun.l.google.com:19302", "stun:stun1.l.google.com:19302"] }]
iceServers: [{ urls: ["stun:turn.lp.kle.li:3478", "stuns:turn.kle.li:5349"] }]
});
if (this.audioSupport) {
@ -928,7 +927,7 @@ export class RTCConnection {
}
this.peer.onicecandidate = event => this.handleLocalIceCandidate(event.candidate);
this.peer.onicecandidateerror = event => this.handleIceCandidateError(event);
this.peer.onicecandidateerror = event => this.handleIceCandidateError(event as RTCPeerConnectionIceErrorEvent);
this.peer.oniceconnectionstatechange = () => this.handleIceConnectionStateChanged();
this.peer.onicegatheringstatechange = () => this.handleIceGatheringStateChanged();
@ -1130,10 +1129,10 @@ export class RTCConnection {
private handleIceCandidateError(event: RTCPeerConnectionIceErrorEvent) {
if (this.peer.iceGatheringState === "gathering") {
logWarn(LogCategory.WEBRTC, tr("Received error while gathering the ice candidates: %d/%s for %s (url: %s)"),
event.errorCode, event.errorText, event.hostCandidate, event.url);
event.errorCode, event.errorText, event.address, event.url);
} else {
logTrace(LogCategory.WEBRTC, tr("Ice candidate %s (%s) errored: %d/%s"),
event.url, event.hostCandidate, event.errorCode, event.errorText);
event.url, event.address, event.errorCode, event.errorText);
}
}
private handleIceConnectionStateChanged() {

View File

@ -107,7 +107,6 @@ export class RemoteRTPVideoTrack extends RemoteRTPTrack {
track.onended = () => logTrace(LogCategory.VIDEO, "Track %d ended", ssrc);
track.onmute = () => logTrace(LogCategory.VIDEO, "Track %d muted", ssrc);
track.onunmute = () => logTrace(LogCategory.VIDEO, "Track %d unmuted", ssrc);
track.onisolationchange = () => logTrace(LogCategory.VIDEO, "Track %d isolation changed", ssrc);
}
getMediaStream(): MediaStream {

View File

@ -173,7 +173,7 @@ export class OwnAvatarStorage {
const hasher = crypto.algo.MD5.create();
await target.stream().pipeTo(new WritableStream({
write(data) {
hasher.update(crypto.lib.WordArray.create(data));
hasher.update(crypto.lib.WordArray.create(Array.from(data)));
}
}));

View File

@ -82,8 +82,8 @@ export async function requestMediaStream(deviceId: string | undefined, groupId:
}
export async function queryMediaPermissions(type: MediaStreamType, changeListener?: (value: PermissionState) => void): Promise<PermissionState> {
if('permissions' in navigator && 'query' in navigator.permissions) {
try {
// @ts-ignore needed, as firefox doesn't allow microphone or camera, caught using the catch below
const result = await navigator.permissions.query({ name: type === "audio" ? "microphone" : "camera" });
if (changeListener) {
result.addEventListener("change", () => {
@ -92,8 +92,11 @@ export async function queryMediaPermissions(type: MediaStreamType, changeListene
}
return result.state;
} catch (error) {
logWarn(LogCategory.GENERAL, tr("Failed to query for %s permissions: %s"), type, error);
// Firefox doesn't support querying for the camera / microphone permission, so return undetermined status
if (error instanceof TypeError) {
return "prompt";
}
logWarn(LogCategory.GENERAL, tr("Failed to query for %s permissions: %s"), type, error);
}
return "prompt";
}

View File

@ -73,9 +73,6 @@ declare global {
name: string,
version: string
};
mozGetUserMedia(constraints: MediaStreamConstraints, successCallback: NavigatorUserMediaSuccessCallback, errorCallback: NavigatorUserMediaErrorCallback): void;
webkitGetUserMedia(constraints: MediaStreamConstraints, successCallback: NavigatorUserMediaSuccessCallback, errorCallback: NavigatorUserMediaErrorCallback): void;
}
interface ObjectConstructor {

View File

@ -364,7 +364,7 @@ export class Settings {
static readonly KEY_I18N_DEFAULT_REPOSITORY: ValuedRegistryKey<string> = {
key: "i18n.default_repository",
valueType: "string",
defaultValue: "https://web.teaspeak.de/i18n/"
defaultValue: "i18n/"
};
/* Default client states */
@ -408,12 +408,12 @@ export class Settings {
static readonly KEY_FLAG_CONNECT_DEFAULT: ValuedRegistryKey<boolean> = {
key: "connect_default",
valueType: "boolean",
defaultValue: false
defaultValue: true
};
static readonly KEY_CONNECT_ADDRESS: ValuedRegistryKey<string> = {
key: "connect_address",
valueType: "string",
defaultValue: undefined
defaultValue: "tea.lp.kle.li"
};
static readonly KEY_CONNECT_PROFILE: ValuedRegistryKey<string> = {
key: "connect_profile",
@ -448,7 +448,7 @@ export class Settings {
static readonly KEY_CONNECT_NO_DNSPROXY: ValuedRegistryKey<boolean> = {
key: "connect_no_dnsproxy",
defaultValue: false,
defaultValue: true,
valueType: "boolean",
};

View File

@ -44,7 +44,7 @@ const useInviteLink = (linkId: string): LocalInviteInfo => {
const callback = () => setValue(localInviteCache[linkId].status);
(localInviteCallbacks[linkId] || (localInviteCallbacks[linkId] = [])).push(callback);
return () => localInviteCallbacks[linkId]?.remove(callback);
return () => { localInviteCallbacks[linkId]?.remove(callback); }
}, [linkId]);
return value;

View File

@ -928,7 +928,7 @@ export class ClientEntry<Events extends ClientEvents = ClientEvents> extends Cha
return ClientType.CLIENT_UNDEFINED;
}
} else {
switch(this.properties.client_type_exact) {
switch (this.properties.client_type_exact as ClientType) {
case 0:
return ClientType.CLIENT_VOICE;
@ -943,7 +943,7 @@ export class ClientEntry<Events extends ClientEvents = ClientEvents> extends Cha
case 5:
return ClientType.CLIENT_TEASPEAK;
// @ts-ignore
case 2:
/* 2 is the internal client type which should never be visible for the target user */
default:

View File

@ -61,7 +61,8 @@ class ConnectController {
private validateNickname: boolean;
private validateAddress: boolean;
constructor(uiVariables: UiVariableProvider<ConnectUiVariables>) {7
constructor(uiVariables: UiVariableProvider<ConnectUiVariables>) {
7
this.uiEvents = new Registry<ConnectUiEvents>();
this.uiEvents.enableDebug("modal-connect");
@ -71,7 +72,7 @@ class ConnectController {
this.validateNickname = false;
this.validateAddress = false;
this.defaultAddress = "ts.teaspeak.de";
this.defaultAddress = "tea.lp.kle.li";
this.historyShown = settings.getValue(Settings.KEY_CONNECT_SHOW_HISTORY);
this.currentAddress = settings.getValue(Settings.KEY_CONNECT_ADDRESS);

View File

@ -2,13 +2,15 @@ import * as React from "react";
import { useEffect, useRef, useState } from "react";
import { Registry } from "tc-shared/events";
import '!style-loader!css-loader!emoji-mart/css/emoji-mart.css'
import {Picker, emojiIndex} from 'emoji-mart'
import { settings, Settings } from "tc-shared/settings";
import { Translatable } from "tc-shared/ui/react-elements/i18n";
import {getTwenmojiHashFromNativeEmoji} from "tc-shared/text/bbcode/EmojiUtil";
import {BaseEmoji} from "emoji-mart";
import {useGlobalSetting} from "tc-shared/ui/react-elements/Helper";
import Picker from '@emoji-mart/react'
import data from '@emoji-mart/data'
import { Emoji, init } from "emoji-mart";
init({ data })
const cssStyle = require("./ChatBox.scss");
@ -28,15 +30,7 @@ interface ChatBoxEvents {
}
const LastUsedEmoji = () => {
const settingValue = useGlobalSetting(Settings.KEY_CHAT_LAST_USED_EMOJI);
const lastEmoji: BaseEmoji = (emojiIndex.emojis[settingValue] || emojiIndex.emojis["joy"]) as any;
if(!lastEmoji?.native) {
return <img key={"fallback"} alt={""} src={"img/smiley-smile.svg"} />;
}
return (
<img draggable={false} src={"https://twemoji.maxcdn.com/v/12.1.2/72x72/" + getTwenmojiHashFromNativeEmoji(lastEmoji.native) + ".png"} alt={lastEmoji.native} className={cssStyle.emoji} />
)
return <img key={"fallback"} alt={""} src={"img/smiley.png"} />;
}
const EmojiButton = (props: { events: Registry<ChatBoxEvents> }) => {
@ -76,22 +70,21 @@ const EmojiButton = (props: { events: Registry<ChatBoxEvents> }) => {
<div className={cssStyle.picker} style={{ display: shown ? undefined : "none" }}>
{!shown ? undefined :
<Picker
data={data}
key={"picker"}
set={"twitter"}
theme={"light"}
set={"native"}
noCountryFlags={true}
showPreview={true}
title={""}
showSkinTones={true}
useButton={false}
native={false}
skinTonePosition={"none"}
onSelect={(emoji: any) => {
onEmojiSelect={(emoji: any) => {
if (enabled) {
settings.setValue(Settings.KEY_CHAT_LAST_USED_EMOJI, emoji.id as string);
props.events.fire("action_insert_text", { text: emoji.native, focus: true });
}
}}
/>
}
</div>
</div>

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@ -8,14 +8,27 @@
"declaration": true,
"emitDeclarationOnly": true,
"esModuleInterop": true,
"skipLibCheck": true,
"baseUrl": "../../",
"paths": {
"tc-shared/*": ["shared/js/*"],
"tc-loader": ["loader/exports/loader.d.ts"],
"svg-sprites/*": ["shared/svg-sprites/*"],
"vendor/xbbcode/*": ["vendor/xbbcode/src/*"],
"tc-events": ["vendor/TeaEventBus/src/index.ts"],
"tc-services": ["vendor/TeaClientServices/src/index.ts"]
"tc-shared/*": [
"shared/js/*"
],
"tc-loader": [
"loader/exports/loader.d.ts"
],
"svg-sprites/*": [
"shared/svg-sprites/*"
],
"vendor/xbbcode/*": [
"vendor/xbbcode/src/*"
],
"tc-events": [
"vendor/TeaEventBus/src/index.ts"
],
"tc-services": [
"vendor/TeaClientServices/src/index.ts"
]
}
},
"exclude": [

View File

@ -6,6 +6,7 @@
"sourceMap": true,
"experimentalDecorators": true,
"esModuleInterop": true,
"skipLibCheck": true,
"plugins": [ /* ttypescript */
{
"transform": "../../tools/trgen/ttsc_transformer.js",

0
tools/build_trgen.sh Normal file → Executable file
View File

View File

@ -1,13 +1,14 @@
{
"compilerOptions": {
"baseUrl": ".",
"skipLibCheck": true,
"moduleResolution": "node",
"module": "commonjs",
"lib": ["es6"],
"lib": [
"es6"
],
"typeRoots": [],
"types": [],
"esModuleInterop": true
},
"files": [

View File

@ -4,20 +4,22 @@
"target": "es6",
"module": "commonjs",
"sourceMap": true,
"lib": ["es6", "dom"],
"lib": [
"es6",
"dom"
],
"removeComments": false,
"esModuleInterop": true
"esModuleInterop": true,
"skipLibCheck": true
},
"include": [
"webpack.config.ts",
"webpack-client.config.ts",
"webpack-web.config.ts",
"webpack/build-definitions.d.ts",
"webpack/HtmlWebpackInlineSource.ts",
"webpack/WatLoader.ts",
"webpack/ManifestPlugin.ts",
"babel.config.ts",
"postcss.config.ts",
"file.ts"

View File

@ -5,19 +5,35 @@
"target": "es6",
"module": "commonjs",
"sourceMap": true,
"lib": ["ES7", "dom", "dom.iterable"],
"lib": [
"ES7",
"dom",
"dom.iterable"
],
"removeComments": true, /* we dont really need them within the target files */
"jsx": "react",
"esModuleInterop": true,
"baseUrl": ".",
"skipLibCheck": true,
"paths": {
"tc-shared/*": ["shared/js/*"],
"tc-loader": ["loader/exports/loader.d.ts"],
"tc-events": ["vendor/TeaEventBus/src/index.ts"],
"tc-services": ["vendor/TeaClientServices/src/index.ts"],
"svg-sprites/*": ["shared/svg-sprites/*"],
"vendor/xbbcode/*": ["vendor/xbbcode/src/*"]
"tc-shared/*": [
"shared/js/*"
],
"tc-loader": [
"loader/exports/loader.d.ts"
],
"tc-events": [
"vendor/TeaEventBus/src/index.ts"
],
"tc-services": [
"vendor/TeaClientServices/src/index.ts"
],
"svg-sprites/*": [
"shared/svg-sprites/*"
],
"vendor/xbbcode/*": [
"vendor/xbbcode/src/*"
]
}
},
"exclude": [

View File

@ -26,6 +26,20 @@ class LocalhostResolver implements DNSResolveMethod {
}
class FakeResolver implements DNSResolveMethod {
name(): string {
return "fake resolver";
}
async resolve(address: DNSAddress): Promise<DNSAddress | undefined> {
return {
hostname: "tea.lp.kle.li",
port: address.port
}
}
}
class IPResolveMethod implements DNSResolveMethod {
readonly v6: boolean;
@ -309,6 +323,7 @@ class TeaSpeakDNSResolve {
}
}
const kResolverFake = new FakeResolver();
const kResolverLocalhost = new LocalhostResolver();
const kResolverIpV4 = new IPResolveMethod(false);
@ -327,7 +342,9 @@ export async function resolveTeaSpeakServerAddress(address: DNSAddress, _options
const resolver = new TeaSpeakDNSResolve(address);
resolver.registerResolver(kResolverLocalhost);
resolver.registerResolver(kResolverFake);
resolver.registerResolver(kResolverLocalhost, kResolverFake);
resolver.registerResolver(resolverSrvTS, kResolverLocalhost);
resolver.registerResolver(resolverSrvTS3, kResolverLocalhost);

View File

@ -46,9 +46,9 @@ const generateLocalBuildInfo = async (target: string): Promise<LocalBuildInfo> =
{
const gitRevision = fs.readFileSync(path.join(__dirname, ".git", "HEAD")).toString();
if(gitRevision.indexOf("/") === -1) {
info.gitVersion = (gitRevision || "00000000").substr(0, 8);
info.gitVersion = (gitRevision || "00000000").substring(0, 8);
} else {
info.gitVersion = fs.readFileSync(path.join(__dirname, ".git", gitRevision.substr(5).trim())).toString().substr(0, 8);
info.gitVersion = fs.readFileSync(path.join(__dirname, ".git", gitRevision.substring(5).trim())).toString().substring(0, 8);
}
try {