aboutsummaryrefslogtreecommitdiff
path: root/client-web
diff options
context:
space:
mode:
authormetamuffin <metamuffin@disroot.org>2023-04-04 11:15:03 +0200
committermetamuffin <metamuffin@disroot.org>2023-04-04 11:15:03 +0200
commit99d1ab55dfb1714d8f574060e618dc93c94f245c (patch)
treeb01f6ccb6b4060f120a71145fbbded0131c9430e /client-web
parent84587df365c61297e08d00f28317b452681a4b84 (diff)
parentfe36a0640f2e36baad1f08033f09b49bdd0f1062 (diff)
downloadkeks-meet-99d1ab55dfb1714d8f574060e618dc93c94f245c.tar
keks-meet-99d1ab55dfb1714d8f574060e618dc93c94f245c.tar.bz2
keks-meet-99d1ab55dfb1714d8f574060e618dc93c94f245c.tar.zst
Merge branch 'master' of codeberg.org:metamuffin/keks-meet
Diffstat (limited to 'client-web')
-rw-r--r--client-web/.gitignore1
-rw-r--r--client-web/makefile5
-rw-r--r--client-web/public/app.html1
-rw-r--r--client-web/public/assets/style/master.css67
-rw-r--r--client-web/public/assets/style/tile-backdrop.svg151
-rw-r--r--client-web/public/start.html12
-rw-r--r--client-web/source/index.ts59
-rw-r--r--client-web/source/preferences/mod.ts11
-rw-r--r--client-web/source/protocol/mod.ts1
-rw-r--r--client-web/source/room.ts2
-rw-r--r--client-web/source/sw/download_stream.ts6
-rw-r--r--client-web/source/user/remote.ts4
12 files changed, 272 insertions, 48 deletions
diff --git a/client-web/.gitignore b/client-web/.gitignore
index 55fe618..99be205 100644
--- a/client-web/.gitignore
+++ b/client-web/.gitignore
@@ -1,2 +1,3 @@
/public/assets/bundle.js
/public/assets/sw.js
+/public/assets/font
diff --git a/client-web/makefile b/client-web/makefile
index e81a09d..2623c6e 100644
--- a/client-web/makefile
+++ b/client-web/makefile
@@ -1,5 +1,5 @@
.PHONY: all watch
-all: public/assets/bundle.js public/assets/sw.js
+all: public/assets/bundle.js public/assets/sw.js public/assets/font/include.css
watch:
deno bundle --no-check --watch source/index.ts public/assets/bundle.js &
deno bundle --no-check --watch source/sw/worker.ts public/assets/sw.js
@@ -7,3 +7,6 @@ public/assets/bundle.js: $(shell find source -type f -name '*.ts')
deno bundle --no-check --unstable source/index.ts > $@
public/assets/sw.js: $(shell find source/sw -type f -name '*.ts')
deno bundle --no-check --unstable source/sw/worker.ts > $@
+public/assets/font/include.css:
+ mkdir -p public/assets/font
+ curl 'https://s.metamuffin.org/static/font-ubuntu.tar' | tar -xC public/assets/font
diff --git a/client-web/public/app.html b/client-web/public/app.html
index 8479a22..4c7d10d 100644
--- a/client-web/public/app.html
+++ b/client-web/public/app.html
@@ -3,6 +3,7 @@
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
+ <meta name="description" content="A simple secure web conferencing application using webrtc">
<script async type="module" src="/assets/bundle.js"></script>
<link rel="stylesheet" href="/assets/style/master.css" />
<title>keks-meet</title>
diff --git a/client-web/public/assets/style/master.css b/client-web/public/assets/style/master.css
index 7a59d78..8d77ca1 100644
--- a/client-web/public/assets/style/master.css
+++ b/client-web/public/assets/style/master.css
@@ -3,30 +3,31 @@
which is licensed under the GNU Affero General Public License (version 3); see /COPYING.
Copyright (C) 2022 metamuffin <metamuffin@disroot.org>
*/
-@import url("https://s.metamuffin.org/static/font-ubuntu/include.css");
+@import url("../font/include.css");
@import url("./logger.css");
@import url("./chat.css");
@import url("./room.css");
@import url("./prefs.css");
@import url("./menu.css");
+@import url("/overrides.css");
* {
font-family: "Ubuntu", sans-serif;
- font-weight: 300;
color: white;
margin: 0px;
padding: 0px;
}
-:root {
- --bg: #151315;
- --bg-dark: #070707;
- --ac: #5e3f84;
- --ac-light: #7c43bd;
- --ac-dark: #2d0d52;
+body.start {
+ background-image: linear-gradient(var(--ac-dark-transparent), black 150%),
+ url("./tile-backdrop.svg");
+ background-attachment: fixed;
+ background-size: cover, 40vw;
+ background-color: var(--ac-dark);
}
body {
+ font-weight: 300;
background-color: var(--bg-dark);
height: 100vh;
width: 100vw;
@@ -34,8 +35,11 @@ body {
}
h1 {
+ text-shadow: 0px 0px 20px rgba(0, 0, 0, 0.75);
+ font-size: 5em;
font-weight: 700;
- margin: 1em;
+ text-align: center;
+ margin-bottom: 0.1em;
}
input[type="button"],
@@ -78,15 +82,54 @@ button:disabled {
.start-box p {
margin-bottom: 0.5em;
+ font-size: x-large;
}
.start-box input[type="text"] {
- margin: 0.5em;
+ margin: 2em 0 1em 0;
font-size: xx-large;
}
.start-box input[type="button"] {
- margin: 0.5em;
+ margin: 1em 0 1em 0;
+ font-size: x-large;
+ width: 100%;
+}
+
+.start-box .description {
+ margin-bottom: 1.5em;
+ text-align: center;
+}
+
+#room-id-input {
+ padding: 0.5em;
font-size: x-large;
width: calc(100% - 1em);
-} \ No newline at end of file
+}
+
+@media (max-width: 800px), (max-height: 700px) {
+ h1 {
+ font-size: xxx-large;
+ }
+ .start-box {
+ position: relative;
+ top: 0;
+ left: 0;
+ transform: none;
+ width: 90%;
+ margin: 0 auto;
+ margin-top: 1em;
+ }
+ .start-box p {
+ margin-bottom: 0.5em;
+ font-size: large !important;
+ }
+ .start-box input[type="text"] {
+ margin: 1em 0 0.5em 0;
+ font-size: large !important;
+ }
+ .start-box input[type="button"] {
+ margin: 0.5em 0 0.5em 0;
+ font-size: large !important;
+ }
+}
diff --git a/client-web/public/assets/style/tile-backdrop.svg b/client-web/public/assets/style/tile-backdrop.svg
new file mode 100644
index 0000000..15ea791
--- /dev/null
+++ b/client-web/public/assets/style/tile-backdrop.svg
@@ -0,0 +1,151 @@
+<?xml version="1.0" standalone="no"?>
+<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 20010904//EN"
+ "http://www.w3.org/TR/2001/REC-SVG-20010904/DTD/svg10.dtd">
+<svg version="1.0" xmlns="http://www.w3.org/2000/svg"
+ width="1152.000000pt" height="1152.000000pt" viewBox="0 0 1152.000000 1152.000000"
+ preserveAspectRatio="xMidYMid meet">
+<metadata>
+Created by potrace 1.16, written by Peter Selinger 2001-2019
+</metadata>
+<g transform="translate(0.000000,1152.000000) scale(0.100000,-0.100000)"
+fill="#000000" stroke="none">
+<path d="M1675 10557 c-42 -42 -48 -78 -43 -283 3 -174 11 -199 69 -230 57
+-29 129 -11 165 43 16 24 19 51 22 187 5 205 -1 241 -43 283 -29 29 -39 33
+-85 33 -46 0 -56 -4 -85 -33z"/>
+<path d="M5515 10557 c-42 -42 -48 -78 -43 -283 3 -174 11 -199 69 -230 57
+-29 129 -11 165 43 16 24 19 51 22 187 5 205 -1 241 -43 283 -29 29 -39 33
+-85 33 -46 0 -56 -4 -85 -33z"/>
+<path d="M9355 10557 c-42 -42 -48 -78 -43 -283 3 -174 11 -199 69 -230 57
+-29 129 -11 165 43 16 24 19 51 22 187 5 205 -1 241 -43 283 -29 29 -39 33
+-85 33 -46 0 -56 -4 -85 -33z"/>
+<path d="M1492 10298 c-8 -8 -12 -48 -12 -112 0 -85 4 -109 24 -151 29 -62 86
+-117 149 -145 l47 -21 0 -64 0 -65 -43 0 c-75 0 -114 -50 -65 -84 18 -13 52
+-16 168 -16 116 0 150 3 168 16 49 34 10 84 -65 84 l-43 0 0 65 0 64 50 22
+c60 26 131 99 154 159 24 63 19 238 -6 254 -13 8 -23 8 -35 0 -14 -9 -19 -31
+-24 -108 -6 -83 -11 -104 -35 -143 -77 -124 -251 -124 -328 0 -24 40 -29 59
+-34 139 -2 51 -9 99 -15 106 -12 15 -39 16 -55 0z"/>
+<path d="M5332 10298 c-8 -8 -12 -48 -12 -112 0 -85 4 -109 24 -151 29 -62 86
+-117 149 -145 l47 -21 0 -64 0 -65 -43 0 c-48 0 -87 -22 -87 -50 0 -41 35 -50
+190 -50 116 0 150 3 168 16 49 34 10 84 -65 84 l-43 0 0 65 0 64 50 22 c60 26
+131 99 154 159 24 63 19 238 -6 254 -13 8 -23 8 -35 0 -14 -9 -19 -31 -24
+-108 -6 -83 -11 -104 -35 -143 -77 -124 -251 -124 -328 0 -24 40 -29 59 -34
+139 -2 51 -9 99 -15 106 -12 15 -39 16 -55 0z"/>
+<path d="M9172 10298 c-8 -8 -12 -48 -12 -112 0 -85 4 -109 24 -151 29 -62 86
+-117 149 -145 l47 -21 0 -64 0 -65 -43 0 c-48 0 -87 -22 -87 -50 0 -41 35 -50
+190 -50 116 0 150 3 168 16 49 34 10 84 -65 84 l-43 0 0 65 0 64 50 22 c60 26
+131 99 154 159 24 63 19 238 -6 254 -13 8 -23 8 -35 0 -14 -9 -19 -31 -24
+-108 -6 -83 -11 -104 -35 -143 -77 -124 -251 -124 -328 0 -24 40 -29 59 -34
+139 -2 51 -9 99 -15 106 -12 15 -39 16 -55 0z"/>
+<path d="M3556 8599 c-64 -16 -157 -71 -212 -126 -108 -108 -150 -248 -142
+-481 5 -162 30 -202 126 -202 82 0 112 53 112 197 0 116 -17 155 -80 181 -35
+15 -38 20 -33 47 17 96 102 203 201 252 50 25 68 28 152 28 84 0 102 -3 152
+-28 99 -49 184 -156 201 -252 5 -27 2 -32 -33 -47 -63 -26 -80 -65 -80 -181 0
+-145 30 -197 113 -197 49 0 90 21 107 57 19 39 25 243 10 349 -24 167 -117
+297 -265 370 -72 35 -82 38 -183 40 -59 2 -124 -1 -146 -7z"/>
+<path d="M7396 8599 c-64 -16 -157 -71 -212 -126 -108 -108 -150 -248 -142
+-481 5 -162 30 -202 126 -202 82 0 112 53 112 197 0 116 -17 155 -80 181 -35
+15 -38 20 -33 47 17 96 102 203 201 252 50 25 68 28 152 28 84 0 102 -3 152
+-28 99 -49 184 -156 201 -252 5 -27 2 -32 -33 -47 -63 -26 -80 -65 -80 -181 0
+-145 30 -197 113 -197 49 0 90 21 107 57 19 39 25 243 10 349 -24 167 -117
+297 -265 370 -72 35 -82 38 -183 40 -59 2 -124 -1 -146 -7z"/>
+<path d="M11236 8599 c-64 -16 -157 -71 -212 -126 -108 -108 -150 -248 -142
+-481 5 -162 30 -202 126 -202 82 0 112 53 112 197 0 116 -17 155 -80 181 -35
+15 -38 20 -33 47 16 95 102 203 196 250 82 40 210 44 300 10 15 -6 17 0 17 53
+0 48 -4 61 -17 67 -28 12 -224 15 -267 4z"/>
+<path d="M0 8528 l1 -63 49 -33 c60 -41 118 -124 136 -193 8 -29 13 -53 11
+-54 -103 -44 -117 -67 -117 -198 0 -144 30 -197 112 -197 51 0 86 18 106 54
+22 41 28 236 12 352 -23 159 -112 290 -248 362 l-62 33 0 -63z"/>
+<path d="M1675 6717 c-42 -42 -48 -78 -43 -283 3 -174 11 -199 69 -230 57 -29
+129 -11 165 43 16 24 19 51 22 187 5 205 -1 241 -43 283 -29 29 -39 33 -85 33
+-46 0 -56 -4 -85 -33z"/>
+<path d="M5515 6717 c-42 -42 -48 -78 -43 -283 3 -174 11 -199 69 -230 57 -29
+129 -11 165 43 16 24 19 51 22 187 5 205 -1 241 -43 283 -29 29 -39 33 -85 33
+-46 0 -56 -4 -85 -33z"/>
+<path d="M9355 6717 c-42 -42 -48 -78 -43 -283 3 -174 11 -199 69 -230 57 -29
+129 -11 165 43 16 24 19 51 22 187 5 205 -1 241 -43 283 -29 29 -39 33 -85 33
+-46 0 -56 -4 -85 -33z"/>
+<path d="M1492 6458 c-8 -8 -12 -48 -12 -112 0 -85 4 -109 24 -151 29 -62 86
+-117 149 -145 l47 -21 0 -64 0 -65 -43 0 c-75 0 -114 -50 -65 -84 18 -13 52
+-16 168 -16 116 0 150 3 168 16 49 34 10 84 -65 84 l-43 0 0 65 0 64 50 22
+c60 26 131 99 154 159 24 63 19 238 -6 254 -13 8 -23 8 -35 0 -14 -9 -19 -31
+-24 -108 -6 -83 -11 -104 -35 -143 -77 -124 -251 -124 -328 0 -24 40 -29 59
+-34 139 -2 51 -9 99 -15 106 -12 15 -39 16 -55 0z"/>
+<path d="M5332 6458 c-8 -8 -12 -48 -12 -112 0 -85 4 -109 24 -151 29 -62 86
+-117 149 -145 l47 -21 0 -64 0 -65 -43 0 c-48 0 -87 -22 -87 -50 0 -41 35 -50
+190 -50 116 0 150 3 168 16 49 34 10 84 -65 84 l-43 0 0 65 0 64 50 22 c60 26
+131 99 154 159 24 63 19 238 -6 254 -13 8 -23 8 -35 0 -14 -9 -19 -31 -24
+-108 -6 -83 -11 -104 -35 -143 -77 -124 -251 -124 -328 0 -24 40 -29 59 -34
+139 -2 51 -9 99 -15 106 -12 15 -39 16 -55 0z"/>
+<path d="M9172 6458 c-8 -8 -12 -48 -12 -112 0 -85 4 -109 24 -151 29 -62 86
+-117 149 -145 l47 -21 0 -64 0 -65 -43 0 c-48 0 -87 -22 -87 -50 0 -41 35 -50
+190 -50 116 0 150 3 168 16 49 34 10 84 -65 84 l-43 0 0 65 0 64 50 22 c60 26
+131 99 154 159 24 63 19 238 -6 254 -13 8 -23 8 -35 0 -14 -9 -19 -31 -24
+-108 -6 -83 -11 -104 -35 -143 -77 -124 -251 -124 -328 0 -24 40 -29 59 -34
+139 -2 51 -9 99 -15 106 -12 15 -39 16 -55 0z"/>
+<path d="M3556 4759 c-64 -16 -157 -71 -212 -126 -108 -108 -150 -248 -142
+-481 5 -162 30 -202 126 -202 82 0 112 53 112 197 0 116 -17 155 -80 181 -35
+15 -38 20 -33 47 17 96 102 203 201 252 50 25 68 28 152 28 84 0 102 -3 152
+-28 99 -49 184 -156 201 -252 5 -27 2 -32 -33 -47 -63 -26 -80 -65 -80 -181 0
+-145 30 -197 113 -197 49 0 90 21 107 57 19 39 25 243 10 349 -24 167 -117
+297 -265 370 -72 35 -82 38 -183 40 -59 2 -124 -1 -146 -7z"/>
+<path d="M7396 4759 c-64 -16 -157 -71 -212 -126 -108 -108 -150 -248 -142
+-481 5 -162 30 -202 126 -202 82 0 112 53 112 197 0 116 -17 155 -80 181 -35
+15 -38 20 -33 47 17 96 102 203 201 252 50 25 68 28 152 28 84 0 102 -3 152
+-28 99 -49 184 -156 201 -252 5 -27 2 -32 -33 -47 -63 -26 -80 -65 -80 -181 0
+-145 30 -197 113 -197 49 0 90 21 107 57 19 39 25 243 10 349 -24 167 -117
+297 -265 370 -72 35 -82 38 -183 40 -59 2 -124 -1 -146 -7z"/>
+<path d="M11236 4759 c-64 -16 -157 -71 -212 -126 -108 -108 -150 -248 -142
+-481 5 -162 30 -202 126 -202 82 0 112 53 112 197 0 116 -17 155 -80 181 -35
+15 -38 20 -33 47 16 95 102 203 196 250 82 40 210 44 300 10 15 -6 17 0 17 53
+0 48 -4 61 -17 67 -28 12 -224 15 -267 4z"/>
+<path d="M0 4688 l1 -63 49 -33 c60 -41 118 -124 136 -193 8 -29 13 -53 11
+-54 -103 -44 -117 -67 -117 -198 0 -144 30 -197 112 -197 51 0 86 18 106 54
+22 41 28 236 12 352 -23 159 -112 290 -248 362 l-62 33 0 -63z"/>
+<path d="M1675 2877 c-42 -42 -48 -78 -43 -283 3 -174 11 -199 69 -230 57 -29
+129 -11 165 43 16 24 19 51 22 187 5 205 -1 241 -43 283 -29 29 -39 33 -85 33
+-46 0 -56 -4 -85 -33z"/>
+<path d="M5515 2877 c-42 -42 -48 -78 -43 -283 3 -136 6 -163 22 -187 51 -75
+161 -75 212 0 16 24 19 51 22 187 5 205 -1 241 -43 283 -29 29 -39 33 -85 33
+-46 0 -56 -4 -85 -33z"/>
+<path d="M9355 2877 c-42 -42 -48 -78 -43 -283 3 -136 6 -163 22 -187 51 -75
+161 -75 212 0 16 24 19 51 22 187 5 205 -1 241 -43 283 -29 29 -39 33 -85 33
+-46 0 -56 -4 -85 -33z"/>
+<path d="M1492 2618 c-8 -8 -12 -48 -12 -112 0 -85 4 -109 24 -151 29 -62 86
+-117 149 -145 l47 -21 0 -64 0 -65 -43 0 c-75 0 -114 -50 -65 -84 18 -13 52
+-16 168 -16 116 0 150 3 168 16 49 34 10 84 -65 84 l-43 0 0 65 0 64 50 22
+c60 26 131 99 154 159 24 63 19 238 -6 254 -13 8 -23 8 -35 0 -14 -9 -19 -31
+-24 -108 -6 -83 -11 -104 -35 -143 -77 -124 -251 -124 -328 0 -24 40 -29 59
+-34 139 -2 51 -9 99 -15 106 -12 15 -39 16 -55 0z"/>
+<path d="M5332 2618 c-8 -8 -12 -48 -12 -112 0 -85 4 -109 24 -151 29 -62 86
+-117 149 -145 l47 -21 0 -64 0 -65 -43 0 c-48 0 -87 -22 -87 -50 0 -41 35 -50
+190 -50 116 0 150 3 168 16 49 34 10 84 -65 84 l-43 0 0 65 0 64 50 22 c60 26
+131 99 154 159 24 63 19 238 -6 254 -13 8 -23 8 -35 0 -14 -9 -19 -31 -24
+-108 -6 -83 -11 -104 -35 -143 -77 -124 -251 -124 -328 0 -24 40 -29 59 -34
+139 -2 51 -9 99 -15 106 -12 15 -39 16 -55 0z"/>
+<path d="M9172 2618 c-8 -8 -12 -48 -12 -112 0 -85 4 -109 24 -151 29 -62 86
+-117 149 -145 l47 -21 0 -64 0 -65 -43 0 c-48 0 -87 -22 -87 -50 0 -41 35 -50
+190 -50 116 0 150 3 168 16 49 34 10 84 -65 84 l-43 0 0 65 0 64 50 22 c60 26
+131 99 154 159 24 63 19 238 -6 254 -13 8 -23 8 -35 0 -14 -9 -19 -31 -24
+-108 -6 -83 -11 -104 -35 -143 -77 -124 -251 -124 -328 0 -24 40 -29 59 -34
+139 -2 51 -9 99 -15 106 -12 15 -39 16 -55 0z"/>
+<path d="M3556 919 c-64 -16 -157 -71 -212 -126 -108 -108 -150 -248 -142
+-481 5 -162 30 -202 126 -202 82 0 112 53 112 197 0 116 -17 155 -80 181 -35
+15 -38 20 -33 47 17 96 102 203 201 252 50 25 68 28 152 28 84 0 102 -3 152
+-28 99 -49 184 -156 201 -252 5 -27 2 -32 -33 -47 -63 -26 -80 -65 -80 -181 0
+-145 30 -197 113 -197 49 0 90 21 107 57 19 39 25 243 10 349 -24 167 -117
+297 -265 370 -72 35 -82 38 -183 40 -59 2 -124 -1 -146 -7z"/>
+<path d="M7396 919 c-64 -16 -157 -71 -212 -126 -108 -108 -150 -248 -142
+-481 5 -162 30 -202 126 -202 82 0 112 53 112 197 0 116 -17 155 -80 181 -35
+15 -38 20 -33 47 17 96 102 203 201 252 50 25 68 28 152 28 84 0 102 -3 152
+-28 99 -49 184 -156 201 -252 5 -27 2 -32 -33 -47 -63 -26 -80 -65 -80 -181 0
+-145 30 -197 113 -197 49 0 90 21 107 57 19 39 25 243 10 349 -24 167 -117
+297 -265 370 -72 35 -82 38 -183 40 -59 2 -124 -1 -146 -7z"/>
+<path d="M11236 919 c-64 -16 -157 -71 -212 -126 -108 -108 -150 -248 -142
+-481 5 -162 30 -202 126 -202 82 0 112 53 112 197 0 116 -17 155 -80 181 -35
+15 -38 20 -33 47 16 95 102 203 196 250 82 40 210 44 300 10 15 -6 17 0 17 53
+0 48 -4 61 -17 67 -28 12 -224 15 -267 4z"/>
+<path d="M0 848 l1 -63 49 -33 c60 -41 118 -124 136 -193 8 -29 13 -53 11 -54
+-103 -44 -117 -67 -117 -198 0 -144 30 -197 112 -197 51 0 86 18 106 54 22 41
+28 236 12 352 -23 159 -112 290 -248 362 l-62 33 0 -63z"/>
+</g>
+</svg>
diff --git a/client-web/public/start.html b/client-web/public/start.html
index efb9f22..7a1885c 100644
--- a/client-web/public/start.html
+++ b/client-web/public/start.html
@@ -3,20 +3,22 @@
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
+ <meta name="description" content="A simple secure web conferencing application using webrtc">
<link rel="stylesheet" href="/assets/style/master.css" />
<title>keks-meet</title>
</head>
- <body>
+ <body class="start">
<div class="start-box">
<h1>keks-meet</h2>
- <p>A web conferencing application using webrtc</p>
+ <p class="description">A simple secure conferencing application using webrtc</p>
+ <br>
<p>
keks-meet is free software! It is licenced under the terms of
the third version of the GNU Affero General Public Licence only.
</p>
<p>
To get started, click 'Join' and share the URL with your
- partner. You can also optionally customize the url by entering a
+ partner. You can also optionally customize the URL by entering a
<b>secure/unguessable(!!!)</b> identifier below.
</p>
<noscript>
@@ -28,8 +30,8 @@
const room_input = document.createElement("input");
room_input.type = "text";
room_input.id = "room-id-input";
- room_input.placeholder = "Room ID";
- room_input.ariaLabel = "Room ID"
+ room_input.placeholder = "Room Secret";
+ room_input.ariaLabel = "Room Secret"
const submit = document.createElement("input");
submit.type = "button";
diff --git a/client-web/source/index.ts b/client-web/source/index.ts
index 852e48f..3610ead 100644
--- a/client-web/source/index.ts
+++ b/client-web/source/index.ts
@@ -17,18 +17,20 @@ import { Room } from "./room.ts"
export const VERSION = "0.1.12"
export const ROOM_CONTAINER = esection({ class: "room", aria_label: "user list" })
-export const RTC_CONFIG: RTCConfiguration = {
- iceServers: [
- {
- urls: [
- "turn:meet.metamuffin.org:16900",
- "stun:meet.metamuffin.org:16900"
- ],
- username: "keksmeet",
- credential: "ujCmetg6bm0"
- },
- ],
- iceCandidatePoolSize: 10,
+export interface ClientConfig {
+ appearance?: {
+ accent: string
+ accent_dark: string
+ accent_light: string
+ background: string
+ background_dark: string
+ }
+ webrtc: {
+ stun: string,
+ turn?: string,
+ turn_user?: string,
+ turn_cred?: string
+ }
}
export interface User {
@@ -50,27 +52,42 @@ window.onbeforeunload = ev => {
let r: Room;
export async function main() {
- log("*", "starting up")
- document.body.innerHTML = "" // remove existing elements
- const room_name = load_params().rname
+ document.body.append(LOGGER_CONTAINER)
+ log("*", "loading client config")
+ const config_res = await fetch("/config.json")
+ if (!config_res.ok) return log({ scope: "*", error: true }, "cannot load config")
+ const config: ClientConfig = await config_res.json()
+ log("*", "config loaded. starting")
+
+ document.body.querySelectorAll("p").forEach(e => e.remove())
+ const room_secret = load_params().rsecret
if (!globalThis.RTCPeerConnection) return log({ scope: "webrtc", error: true }, "WebRTC not supported.")
if (!globalThis.isSecureContext) log({ scope: "*", warn: true }, "This page is not in a 'Secure Context'")
if (!globalThis.crypto.subtle) return log({ scope: "crypto", error: true }, "SubtleCrypto not availible")
if (!globalThis.navigator.serviceWorker) log({ scope: "*", warn: true }, "Your browser does not support the Service Worker API, some features dont work without it.")
- if (room_name.length < 8) log({ scope: "crypto", warn: true }, "Room name is very short. e2ee is insecure!")
- if (room_name.length == 0) return window.location.href = "/" // send them back to the start page
- if (PREFS.warn_redirect) log({ scope: "crypto", warn: true }, "You were redirected from the old URL format. The server knows the room name now - e2ee is insecure!")
+ if (room_secret.length < 8) log({ scope: "crypto", warn: true }, "Room name is very short. e2ee is insecure!")
+ if (room_secret.length == 0) return window.location.href = "/" // send them back to the start page
+ if (PREFS.warn_redirect) log({ scope: "crypto", warn: true }, "You were redirected from the old URL format. The server knows the room secret now - e2ee is insecure!")
+
+ const conn = await (new SignalingConnection().connect(room_secret))
+ const rtc_config: RTCConfiguration = {
+ iceCandidatePoolSize: 10,
+ iceServers: [{
+ urls: [config.webrtc.stun, ...(config.webrtc.turn ? [config.webrtc.turn] : [])],
+ credential: config.webrtc.turn_cred,
+ username: config.webrtc.turn_user,
+ }]
+ }
- const conn = await (new SignalingConnection().connect(room_name))
- r = new Room(conn)
+ r = new Room(conn, rtc_config)
setup_keybinds(r)
r.on_ready = () => {
new BottomMenu(r)
new MenuBr()
}
- document.body.append(ROOM_CONTAINER, OVERLAYS, LOGGER_CONTAINER)
+ document.body.prepend(ROOM_CONTAINER, OVERLAYS)
if (globalThis.navigator.serviceWorker) init_serviceworker()
}
diff --git a/client-web/source/preferences/mod.ts b/client-web/source/preferences/mod.ts
index 5de73eb..8aefb0f 100644
--- a/client-web/source/preferences/mod.ts
+++ b/client-web/source/preferences/mod.ts
@@ -15,6 +15,7 @@ export interface PrefDecl<T> {
optional?: boolean,
hidden?: boolean
allow_url?: boolean
+ require_reload?: boolean,
}
type Type = "string" | "number" | "bigint" | "boolean" | "symbol" | "undefined" | "object" | "function";
@@ -85,19 +86,19 @@ export function generate_section(): string {
PREFS_EXPLICIT[key as unknown as keyof typeof PREFS_EXPLICIT]
)))
}
- return load_params().rname + "?" + section.join("&")
+ return load_params().rsecret + "?" + section.join("&")
}
-export function load_params(): { raw_params: { [key: string]: string }, rname: string } {
+export function load_params(): { raw_params: { [key: string]: string }, rsecret: string } {
const raw_params: Record<string, string> = {}
- const [rname, param_str] = window.location.hash.substring(1).split("?")
- if (!param_str) return { rname, raw_params: {} }
+ const [rsecret, param_str] = window.location.hash.substring(1).split("?")
+ if (!param_str) return { rsecret, raw_params: {} }
for (const kv of param_str.split("&")) {
const [key, value] = kv.split("=")
if (key == "prototype") continue
raw_params[decodeURIComponent(key)] = decodeURIComponent(value)
}
- return { raw_params, rname }
+ return { raw_params, rsecret }
}
function get_param<T>(ty: string, key: string): T | undefined {
diff --git a/client-web/source/protocol/mod.ts b/client-web/source/protocol/mod.ts
index 3674c08..6d49a17 100644
--- a/client-web/source/protocol/mod.ts
+++ b/client-web/source/protocol/mod.ts
@@ -33,7 +33,6 @@ export class SignalingConnection {
this.on_open()
r()
})
- log("ws", "connection opened")
return this
}
diff --git a/client-web/source/room.ts b/client-web/source/room.ts
index a685f1d..27d2327 100644
--- a/client-web/source/room.ts
+++ b/client-web/source/room.ts
@@ -20,7 +20,7 @@ export class Room {
public on_ready = () => { };
- constructor(public signaling: SignalingConnection) {
+ constructor(public signaling: SignalingConnection, public rtc_config: RTCConfiguration) {
this.signaling.control_handler = (a) => this.control_handler(a)
this.signaling.relay_handler = (a, b) => this.relay_handler(a, b)
}
diff --git a/client-web/source/sw/download_stream.ts b/client-web/source/sw/download_stream.ts
index 52d9fad..35a3c7e 100644
--- a/client-web/source/sw/download_stream.ts
+++ b/client-web/source/sw/download_stream.ts
@@ -1,3 +1,9 @@
+/*
+ This file is part of keks-meet (https://codeberg.org/metamuffin/keks-meet)
+ which is licensed under the GNU Affero General Public License (version 3); see /COPYING.
+ Copyright (C) 2022 metamuffin <metamuffin@disroot.org>
+*/
+/// <reference lib="dom" />
import { log } from "../logger.ts"
import { SW } from "./init.ts"
diff --git a/client-web/source/user/remote.ts b/client-web/source/user/remote.ts
index bd89e0e..5e81cf7 100644
--- a/client-web/source/user/remote.ts
+++ b/client-web/source/user/remote.ts
@@ -7,7 +7,7 @@
import { RelayMessage } from "../../../common/packets.d.ts";
import { notify } from "../helper.ts";
-import { ROOM_CONTAINER, RTC_CONFIG } from "../index.ts"
+import { ROOM_CONTAINER } from "../index.ts"
import { log } from "../logger.ts"
import { PREFS } from "../preferences/mod.ts";
import { new_remote_resource, RemoteResource } from "../resource/mod.ts";
@@ -28,7 +28,7 @@ export class RemoteUser extends User {
room.remote_users.set(id, this)
log("usermodel", `added remote user: ${this.display_name}`)
- this.pc = new RTCPeerConnection(RTC_CONFIG)
+ this.pc = new RTCPeerConnection(room.rtc_config)
this.pc.onicecandidate = ev => {
if (!ev.candidate) return
room.signaling.send_relay({ ice_candidate: ev.candidate.toJSON() }, this.id)