keks-meet
- A web conferencing application using webrtc
+
A web conferencing application using webrtc
+
keks-meet is free software! It is licenced under the terms of
the third version of the GNU Affero General Public Licence only.
--
cgit v1.2.3-70-g09d2
From a9ad28ffc17c07b18d6d559b698e9f09247a4879 Mon Sep 17 00:00:00 2001
From: tpart
Date: Thu, 19 Jan 2023 19:30:41 +0000
Subject: fix css on mobile (#4)
Co-authored-by: tpart <10518520-tpart@users.noreply.gitlab.com>
Reviewed-on: https://codeberg.org/metamuffin/keks-meet/pulls/4
Co-authored-by: tpart
Co-committed-by: tpart
---
client-web/public/assets/style/master.css | 41 ++++++++++++++++++++++++++++++-
1 file changed, 40 insertions(+), 1 deletion(-)
(limited to 'client-web')
diff --git a/client-web/public/assets/style/master.css b/client-web/public/assets/style/master.css
index f30b085..c928e97 100644
--- a/client-web/public/assets/style/master.css
+++ b/client-web/public/assets/style/master.css
@@ -105,7 +105,6 @@ button:disabled {
.start-box .description {
margin-bottom: 1.5em;
- font-size: xx-large;
text-align: center;
}
@@ -113,4 +112,44 @@ button:disabled {
padding: 0.5em;
font-size: x-large;
width: calc(100% - 1em);
+}
+
+@media (max-width : 800px) {
+ 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 .description {
+ margin-bottom: 0.5em;
+ font-size: large;
+ }
+
+ .start-box p {
+ margin-bottom: 0.5em;
+ font-size: large;
+ }
+
+ .start-box input[type="text"] {
+ margin: 1em 0 0.5em 0;
+ font-size: large;
+ }
+
+ .start-box input[type="button"] {
+ margin: 0.5em 0 0.5em 0;
+ font-size: large;
+ }
+
+ #room-id-input {
+ font-size: large;
+ }
}
\ No newline at end of file
--
cgit v1.2.3-70-g09d2
From aff0ed3c6e2ecf32abd10bf8c2deee31adb2919a Mon Sep 17 00:00:00 2001
From: tpart
Date: Thu, 19 Jan 2023 19:57:56 +0000
Subject: make background repeat & fix start page on small screens (#6)
Co-authored-by: tpart
Reviewed-on: https://codeberg.org/metamuffin/keks-meet/pulls/6
Co-authored-by: tpart
Co-committed-by: tpart
---
client-web/public/assets/style/master.css | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
(limited to 'client-web')
diff --git a/client-web/public/assets/style/master.css b/client-web/public/assets/style/master.css
index c928e97..a1bc8e1 100644
--- a/client-web/public/assets/style/master.css
+++ b/client-web/public/assets/style/master.css
@@ -28,6 +28,7 @@
body.start {
background-image: linear-gradient(var(--ac-dark-transparent), black 150%), url("./tile-backdrop.svg");
+ background-attachment: fixed;
background-size: 40vw;
background-color: var(--ac-dark);
}
@@ -114,7 +115,7 @@ button:disabled {
width: calc(100% - 1em);
}
-@media (max-width : 800px) {
+@media (max-width : 800px), (max-height: 700px) {
h1 {
font-size: xxx-large;
}
--
cgit v1.2.3-70-g09d2
From c4c1d721582d6f14edef37bc4e2b86d679a2c459 Mon Sep 17 00:00:00 2001
From: tpart
Date: Sat, 21 Jan 2023 11:35:11 +0100
Subject: Fix gradient on webkit
---
client-web/public/assets/style/master.css | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
(limited to 'client-web')
diff --git a/client-web/public/assets/style/master.css b/client-web/public/assets/style/master.css
index a1bc8e1..c6527b8 100644
--- a/client-web/public/assets/style/master.css
+++ b/client-web/public/assets/style/master.css
@@ -29,7 +29,7 @@
body.start {
background-image: linear-gradient(var(--ac-dark-transparent), black 150%), url("./tile-backdrop.svg");
background-attachment: fixed;
- background-size: 40vw;
+ background-size: cover, 40vw;
background-color: var(--ac-dark);
}
--
cgit v1.2.3-70-g09d2
From 01b9d4a647d515672f9e4260e1cc70fe1cda910f Mon Sep 17 00:00:00 2001
From: tpart
Date: Sat, 21 Jan 2023 11:52:46 +0100
Subject: Fix logger container
---
client-web/source/index.ts | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
(limited to 'client-web')
diff --git a/client-web/source/index.ts b/client-web/source/index.ts
index cc3492f..4772f94 100644
--- a/client-web/source/index.ts
+++ b/client-web/source/index.ts
@@ -50,6 +50,7 @@ window.onbeforeunload = ev => {
let r: Room;
export async function main() {
+ document.body.append(LOGGER_CONTAINER)
log("*", "starting up")
document.body.querySelectorAll("p").forEach(e => e.remove())
const room_secret = load_params().rsecret
@@ -70,7 +71,7 @@ export async function main() {
new BottomMenu(r).shown = true
new MenuBr().shown = true
}
- document.body.append(ROOM_CONTAINER, OVERLAYS, LOGGER_CONTAINER)
+ document.body.prepend(ROOM_CONTAINER, OVERLAYS)
if (globalThis.navigator.serviceWorker) init_serviceworker()
}
--
cgit v1.2.3-70-g09d2
From 70e1090e7c5e5aa6ed0a621ad71924b7931ef05d Mon Sep 17 00:00:00 2001
From: metamuffin
Date: Thu, 16 Feb 2023 15:11:11 +0100
Subject: add description
---
client-web/public/app.html | 1 +
client-web/public/start.html | 3 ++-
server/src/main.rs | 7 ++++++-
3 files changed, 9 insertions(+), 2 deletions(-)
(limited to 'client-web')
diff --git a/client-web/public/app.html b/client-web/public/app.html
index 665a7d2..d121be2 100644
--- a/client-web/public/app.html
+++ b/client-web/public/app.html
@@ -3,6 +3,7 @@
+
keks-meet
diff --git a/client-web/public/start.html b/client-web/public/start.html
index 27b45f5..7a1885c 100644
--- a/client-web/public/start.html
+++ b/client-web/public/start.html
@@ -3,13 +3,14 @@
+
keks-meet
keks-meet
- A web conferencing application using webrtc
+
A simple secure conferencing application using webrtc
keks-meet is free software! It is licenced under the terms of
diff --git a/server/src/main.rs b/server/src/main.rs
index c818eb5..61c9ad1 100644
--- a/server/src/main.rs
+++ b/server/src/main.rs
@@ -42,10 +42,15 @@ async fn run() {
.and(warp::ws())
.map(signaling_connect);
+ // TODO add cache policy headers
+
let index: _ = warp::path!().and(s_file!("client-web/public/start.html", "text/html"));
let room: _ = warp::path!("room").and(s_file!("client-web/public/app.html", "text/html"));
let assets: _ = warp::path("assets").and(s_asset_dir!());
- let sw_script: _ = warp::path("sw.js").and(s_file!("client-web/public/assets/sw.js", "application/javascript"));
+ let sw_script: _ = warp::path("sw.js").and(s_file!(
+ "client-web/public/assets/sw.js",
+ "application/javascript"
+ ));
let favicon: _ = warp::path!("favicon.ico").map(|| "");
let old_format_redirect: _ = warp::path!("room" / String).map(|rsecret| {
reply::with_header(
--
cgit v1.2.3-70-g09d2
From 630cd2b82887da49cacb2deb032c6a51b3c2faf7 Mon Sep 17 00:00:00 2001
From: metamuffin
Date: Tue, 21 Feb 2023 15:12:38 +0100
Subject: server-side client configuration
---
.gitignore | 2 ++
Cargo.lock | 48 +++++++++++++++++++++++++++++++++--
client-web/source/index.ts | 38 +++++++++++++++++----------
client-web/source/preferences/decl.ts | 6 +++++
client-web/source/preferences/mod.ts | 1 +
client-web/source/room.ts | 2 +-
client-web/source/user/remote.ts | 4 +--
server/Cargo.toml | 3 ++-
server/src/assets.rs | 4 +--
server/src/config.rs | 20 +++++++++++++++
server/src/main.rs | 14 ++++++++++
11 files changed, 120 insertions(+), 22 deletions(-)
create mode 100644 server/src/config.rs
(limited to 'client-web')
diff --git a/.gitignore b/.gitignore
index ea8c4bf..a37f649 100644
--- a/.gitignore
+++ b/.gitignore
@@ -1 +1,3 @@
/target
+/config/client.toml
+
diff --git a/Cargo.lock b/Cargo.lock
index 036d078..5f13e86 100644
--- a/Cargo.lock
+++ b/Cargo.lock
@@ -2275,6 +2275,7 @@ dependencies = [
"serde",
"serde_json",
"tokio",
+ "toml",
"warp",
]
@@ -2964,7 +2965,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "66618389e4ec1c7afe67d51a9bf34ff9236480f8d51e7489b7d5ab0303c13f34"
dependencies = [
"once_cell",
- "toml_edit",
+ "toml_edit 0.18.1",
]
[[package]]
@@ -3421,6 +3422,15 @@ dependencies = [
"syn",
]
+[[package]]
+name = "serde_spanned"
+version = "0.6.1"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "0efd8caf556a6cebd3b285caf480045fcc1ac04f6bd786b09a6f11af30c4fcf4"
+dependencies = [
+ "serde",
+]
+
[[package]]
name = "serde_urlencoded"
version = "0.7.1"
@@ -3887,12 +3897,33 @@ dependencies = [
"tracing",
]
+[[package]]
+name = "toml"
+version = "0.7.2"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "f7afcae9e3f0fe2c370fd4657108972cbb2fa9db1b9f84849cefd80741b01cb6"
+dependencies = [
+ "serde",
+ "serde_spanned",
+ "toml_datetime 0.6.1",
+ "toml_edit 0.19.3",
+]
+
[[package]]
name = "toml_datetime"
version = "0.5.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "4553f467ac8e3d374bc9a177a26801e5d0f9b211aa1673fb137a403afd1c9cf5"
+[[package]]
+name = "toml_datetime"
+version = "0.6.1"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "3ab8ed2edee10b50132aed5f331333428b011c99402b5a534154ed15746f9622"
+dependencies = [
+ "serde",
+]
+
[[package]]
name = "toml_edit"
version = "0.18.1"
@@ -3901,7 +3932,20 @@ checksum = "56c59d8dd7d0dcbc6428bf7aa2f0e823e26e43b3c9aca15bbc9475d23e5fa12b"
dependencies = [
"indexmap",
"nom8",
- "toml_datetime",
+ "toml_datetime 0.5.1",
+]
+
+[[package]]
+name = "toml_edit"
+version = "0.19.3"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "5e6a7712b49e1775fb9a7b998de6635b299237f48b404dde71704f2e0e7f37e5"
+dependencies = [
+ "indexmap",
+ "nom8",
+ "serde",
+ "serde_spanned",
+ "toml_datetime 0.6.1",
]
[[package]]
diff --git a/client-web/source/index.ts b/client-web/source/index.ts
index 4772f94..4590625 100644
--- a/client-web/source/index.ts
+++ b/client-web/source/index.ts
@@ -17,18 +17,14 @@ 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 }
+ webrtc: {
+ stun: string,
+ turn?: string,
+ turn_user?: string,
+ turn_cred?: string
+ }
}
export interface User {
@@ -51,7 +47,12 @@ window.onbeforeunload = ev => {
let r: Room;
export async function main() {
document.body.append(LOGGER_CONTAINER)
- log("*", "starting up")
+ 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
@@ -64,7 +65,16 @@ export async function main() {
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))
- r = new Room(conn)
+ 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,
+ }]
+ }
+
+ r = new Room(conn, rtc_config)
setup_keybinds(r)
r.on_ready = () => {
diff --git a/client-web/source/preferences/decl.ts b/client-web/source/preferences/decl.ts
index f3f8e84..68cb9ee 100644
--- a/client-web/source/preferences/decl.ts
+++ b/client-web/source/preferences/decl.ts
@@ -18,7 +18,13 @@ export const PREF_DECLS = {
username: { type: string, default: "guest-" + hex_id(), description: "Username", allow_url: true },
warn_redirect: { type: bool, hidden: true, default: false, description: "Internal option that is set by a server redirect.", allow_url: true },
image_view_popup: { type: bool, default: true, description: "Open image in popup instead of new tab" },
+
+ // TODO!
+ /* WEBRTC */
webrtc_debug: { type: bool, default: false, description: "Show additional information for WebRTC related stuff" },
+ webrtc_stun: { type: string, default: "stun:meet.metamuffin.org:16900", description: "Custom STUN server (all participants must use the same server)" },
+ webrtc_turn: { type: optional(string), default: "turn:meet.metamuffin.org:16900", description: "Custom TURN server (all participants must use the same server)" },
+ webrtc_turn_cred: { type: optional(string), description: "TURN server credentials" },
/* MEDIA */
microphone_enabled: { type: bool, default: false, description: "Add one microphone track on startup" },
diff --git a/client-web/source/preferences/mod.ts b/client-web/source/preferences/mod.ts
index 04fae2c..8aefb0f 100644
--- a/client-web/source/preferences/mod.ts
+++ b/client-web/source/preferences/mod.ts
@@ -15,6 +15,7 @@ export interface PrefDecl {
optional?: boolean,
hidden?: boolean
allow_url?: boolean
+ require_reload?: boolean,
}
type Type = "string" | "number" | "bigint" | "boolean" | "symbol" | "undefined" | "object" | "function";
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/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)
diff --git a/server/Cargo.toml b/server/Cargo.toml
index 4a61294..22413a2 100644
--- a/server/Cargo.toml
+++ b/server/Cargo.toml
@@ -4,7 +4,7 @@ version = "0.1.0"
edition = "2021"
[dependencies]
-warp = "0.3"
+warp = "0.3.3"
tokio = { version = "1.25", features = ["full"] }
log = "0.4"
env_logger = "0.10"
@@ -14,6 +14,7 @@ hyper = "0.14.24"
serde = { version = "1.0.152", features = ["derive"] }
serde_json = "1.0.93"
include_dir = "0.7.3"
+toml = "0.7.2"
[features]
default = []
diff --git a/server/src/assets.rs b/server/src/assets.rs
index 320a4e4..51b0025 100644
--- a/server/src/assets.rs
+++ b/server/src/assets.rs
@@ -2,7 +2,7 @@
#[macro_export]
macro_rules! s_file {
($path: literal, $content_type: literal) => {
- warp::fs::file($path)
+ warp::fs::file(concat!("../", $path))
};
}
@@ -10,7 +10,7 @@ macro_rules! s_file {
#[macro_export]
macro_rules! s_asset_dir {
() => {
- warp::fs::dir("client-web/public/assets")
+ warp::fs::dir("../client-web/public/assets")
};
}
diff --git a/server/src/config.rs b/server/src/config.rs
new file mode 100644
index 0000000..9d6213c
--- /dev/null
+++ b/server/src/config.rs
@@ -0,0 +1,20 @@
+use serde::{Deserialize, Serialize};
+
+#[derive(Debug, Clone, Serialize, Deserialize)]
+pub struct ClientConfig {
+ webrtc: ClientWebrtcConfig,
+ appearance: ClientAppearanceConfig,
+}
+
+#[derive(Debug, Clone, Serialize, Deserialize)]
+pub struct ClientWebrtcConfig {
+ stun: String,
+ turn: Option,
+ turn_user: Option,
+ turn_cred: Option,
+}
+
+#[derive(Debug, Clone, Serialize, Deserialize)]
+pub struct ClientAppearanceConfig {
+ accent: Option,
+}
diff --git a/server/src/main.rs b/server/src/main.rs
index 61c9ad1..8a0e342 100644
--- a/server/src/main.rs
+++ b/server/src/main.rs
@@ -4,9 +4,11 @@
Copyright (C) 2022 metamuffin
*/
pub mod assets;
+pub mod config;
pub mod protocol;
pub mod room;
+use config::ClientConfig;
use hyper::{header, StatusCode};
use listenfd::ListenFd;
use log::{debug, error};
@@ -34,6 +36,10 @@ fn main() {
async fn run() {
env_logger::init_from_env("LOG");
+ let client_config: ClientConfig = toml::from_str(include_str!("../../config/client.toml"))
+ .expect("client configuration invalid");
+ let client_config_json = serde_json::to_string(&client_config).unwrap();
+
let rooms: _ = Rooms::default();
let rooms: _ = warp::any().map(move || rooms.clone());
@@ -51,6 +57,13 @@ async fn run() {
"client-web/public/assets/sw.js",
"application/javascript"
));
+ let client_config: _ = warp::path!("config.json").map(move || {
+ warp::reply::with_header(
+ client_config_json.clone(),
+ "content-type",
+ "application/json",
+ )
+ });
let favicon: _ = warp::path!("favicon.ico").map(|| "");
let old_format_redirect: _ = warp::path!("room" / String).map(|rsecret| {
reply::with_header(
@@ -65,6 +78,7 @@ async fn run() {
.or(room)
.or(index)
.or(signaling)
+ .or(client_config)
.or(favicon)
.or(sw_script)
.or(old_format_redirect)
--
cgit v1.2.3-70-g09d2
From e31c48f5a9cfe6fd8988b83b17e00538fa69d6d3 Mon Sep 17 00:00:00 2001
From: metamuffin
Date: Tue, 21 Feb 2023 15:52:06 +0100
Subject: server-side appearance config
---
client-web/source/index.ts | 16 +++++++++++++++-
client-web/source/preferences/decl.ts | 6 ------
client-web/source/protocol/mod.ts | 1 -
config/client.example.toml | 16 ++++++++++++++++
server/src/config.rs | 8 ++++++--
5 files changed, 37 insertions(+), 10 deletions(-)
create mode 100644 config/client.example.toml
(limited to 'client-web')
diff --git a/client-web/source/index.ts b/client-web/source/index.ts
index 4590625..83f1dfc 100644
--- a/client-web/source/index.ts
+++ b/client-web/source/index.ts
@@ -18,7 +18,13 @@ export const VERSION = "0.1.12"
export const ROOM_CONTAINER = esection({ class: "room", aria_label: "user list" })
export interface ClientConfig {
- appearance: { accent: string }
+ appearance?: {
+ accent: string
+ accent_dark: string
+ accent_light: string
+ background: string
+ background_dark: string
+ }
webrtc: {
stun: string,
turn?: string,
@@ -73,6 +79,14 @@ export async function main() {
username: config.webrtc.turn_user,
}]
}
+ if (config.appearance) {
+ document.body.style.setProperty("--ac", config.appearance.accent)
+ document.body.style.setProperty("--ac-dark", config.appearance.accent_dark)
+ document.body.style.setProperty("--ac-light", config.appearance.accent_light)
+ document.body.style.setProperty("--bg", config.appearance.background)
+ document.body.style.setProperty("--bg-dark", config.appearance.background_dark)
+
+ }
r = new Room(conn, rtc_config)
diff --git a/client-web/source/preferences/decl.ts b/client-web/source/preferences/decl.ts
index 68cb9ee..f3f8e84 100644
--- a/client-web/source/preferences/decl.ts
+++ b/client-web/source/preferences/decl.ts
@@ -18,13 +18,7 @@ export const PREF_DECLS = {
username: { type: string, default: "guest-" + hex_id(), description: "Username", allow_url: true },
warn_redirect: { type: bool, hidden: true, default: false, description: "Internal option that is set by a server redirect.", allow_url: true },
image_view_popup: { type: bool, default: true, description: "Open image in popup instead of new tab" },
-
- // TODO!
- /* WEBRTC */
webrtc_debug: { type: bool, default: false, description: "Show additional information for WebRTC related stuff" },
- webrtc_stun: { type: string, default: "stun:meet.metamuffin.org:16900", description: "Custom STUN server (all participants must use the same server)" },
- webrtc_turn: { type: optional(string), default: "turn:meet.metamuffin.org:16900", description: "Custom TURN server (all participants must use the same server)" },
- webrtc_turn_cred: { type: optional(string), description: "TURN server credentials" },
/* MEDIA */
microphone_enabled: { type: bool, default: false, description: "Add one microphone track on startup" },
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/config/client.example.toml b/config/client.example.toml
new file mode 100644
index 0000000..39e942a
--- /dev/null
+++ b/config/client.example.toml
@@ -0,0 +1,16 @@
+
+[appearance]
+accent = "#5e3f84"
+accent_dark = "#2d0d52"
+accent_light = "#7c43bd"
+background = "#151315"
+background_dark = "#070707"
+
+# If you decide to host your own TURN server, adjust this.
+[webrtc]
+stun = "stun:meet.metamuffin.org:16900"
+# turn = "turn:meet.metamuffin.org:16900"
+## Set the default turn credentials.
+## If not provided, TURN is disabled by default and requires manual activation via password (TODO).
+# turn_user = "keksmeet"
+# turn_cred = "thatsmypassword"
diff --git a/server/src/config.rs b/server/src/config.rs
index 9d6213c..6dd380f 100644
--- a/server/src/config.rs
+++ b/server/src/config.rs
@@ -3,7 +3,7 @@ use serde::{Deserialize, Serialize};
#[derive(Debug, Clone, Serialize, Deserialize)]
pub struct ClientConfig {
webrtc: ClientWebrtcConfig,
- appearance: ClientAppearanceConfig,
+ appearance: Option,
}
#[derive(Debug, Clone, Serialize, Deserialize)]
@@ -16,5 +16,9 @@ pub struct ClientWebrtcConfig {
#[derive(Debug, Clone, Serialize, Deserialize)]
pub struct ClientAppearanceConfig {
- accent: Option,
+ accent: String,
+ accent_light: String,
+ accent_dark: String,
+ background: String,
+ background_dark: String,
}
--
cgit v1.2.3-70-g09d2
From 14feff1f92149d18767e58db16f0d2eebc88b757 Mon Sep 17 00:00:00 2001
From: metamuffin
Date: Mon, 27 Feb 2023 17:25:06 +0100
Subject: embed fonts
---
client-web/.gitignore | 1 +
client-web/makefile | 5 ++++-
client-web/public/assets/style/master.css | 2 +-
3 files changed, 6 insertions(+), 2 deletions(-)
(limited to 'client-web')
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/assets/style/master.css b/client-web/public/assets/style/master.css
index c6527b8..13f8f2f 100644
--- a/client-web/public/assets/style/master.css
+++ b/client-web/public/assets/style/master.css
@@ -3,7 +3,7 @@
which is licensed under the GNU Affero General Public License (version 3); see /COPYING.
Copyright (C) 2022 metamuffin
*/
-@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");
--
cgit v1.2.3-70-g09d2
From 0cc79a94471d4b12caad8e29dfbedba0149aae02 Mon Sep 17 00:00:00 2001
From: metamuffin
Date: Mon, 27 Feb 2023 18:19:50 +0100
Subject: properly apply configured theme everywheere
---
client-web/source/index.ts | 8 --------
server/src/config.rs | 22 +++++++++++-----------
server/src/main.rs | 29 ++++++++++++++++++++++++++++-
3 files changed, 39 insertions(+), 20 deletions(-)
(limited to 'client-web')
diff --git a/client-web/source/index.ts b/client-web/source/index.ts
index 83f1dfc..c92ca2b 100644
--- a/client-web/source/index.ts
+++ b/client-web/source/index.ts
@@ -79,14 +79,6 @@ export async function main() {
username: config.webrtc.turn_user,
}]
}
- if (config.appearance) {
- document.body.style.setProperty("--ac", config.appearance.accent)
- document.body.style.setProperty("--ac-dark", config.appearance.accent_dark)
- document.body.style.setProperty("--ac-light", config.appearance.accent_light)
- document.body.style.setProperty("--bg", config.appearance.background)
- document.body.style.setProperty("--bg-dark", config.appearance.background_dark)
-
- }
r = new Room(conn, rtc_config)
diff --git a/server/src/config.rs b/server/src/config.rs
index 6dd380f..870315e 100644
--- a/server/src/config.rs
+++ b/server/src/config.rs
@@ -2,23 +2,23 @@ use serde::{Deserialize, Serialize};
#[derive(Debug, Clone, Serialize, Deserialize)]
pub struct ClientConfig {
- webrtc: ClientWebrtcConfig,
- appearance: Option,
+ pub webrtc: ClientWebrtcConfig,
+ pub appearance: ClientAppearanceConfig,
}
#[derive(Debug, Clone, Serialize, Deserialize)]
pub struct ClientWebrtcConfig {
- stun: String,
- turn: Option,
- turn_user: Option,
- turn_cred: Option,
+ pub stun: String,
+ pub turn: Option,
+ pub turn_user: Option,
+ pub turn_cred: Option,
}
#[derive(Debug, Clone, Serialize, Deserialize)]
pub struct ClientAppearanceConfig {
- accent: String,
- accent_light: String,
- accent_dark: String,
- background: String,
- background_dark: String,
+ pub accent: String,
+ pub accent_light: String,
+ pub accent_dark: String,
+ pub background: String,
+ pub background_dark: String,
}
diff --git a/server/src/main.rs b/server/src/main.rs
index 8a0e342..78f236a 100644
--- a/server/src/main.rs
+++ b/server/src/main.rs
@@ -8,7 +8,7 @@ pub mod config;
pub mod protocol;
pub mod room;
-use config::ClientConfig;
+use config::{ClientAppearanceConfig, ClientConfig};
use hyper::{header, StatusCode};
use listenfd::ListenFd;
use log::{debug, error};
@@ -39,6 +39,7 @@ async fn run() {
let client_config: ClientConfig = toml::from_str(include_str!("../../config/client.toml"))
.expect("client configuration invalid");
let client_config_json = serde_json::to_string(&client_config).unwrap();
+ let client_config_css = css_overrides(&client_config.appearance);
let rooms: _ = Rooms::default();
let rooms: _ = warp::any().map(move || rooms.clone());
@@ -64,6 +65,9 @@ async fn run() {
"application/json",
)
});
+ let client_config_css: _ = warp::path!("overrides.css").map(move || {
+ warp::reply::with_header(client_config_css.clone(), "content-type", "text/css")
+ });
let favicon: _ = warp::path!("favicon.ico").map(|| "");
let old_format_redirect: _ = warp::path!("room" / String).map(|rsecret| {
reply::with_header(
@@ -82,6 +86,7 @@ async fn run() {
.or(favicon)
.or(sw_script)
.or(old_format_redirect)
+ .or(client_config_css)
.recover(handle_rejection)
.with(warp::log("stuff"));
@@ -140,3 +145,25 @@ fn signaling_connect(rsecret: String, rooms: Rooms, ws: warp::ws::Ws) -> impl Re
}
ws.on_upgrade(move |sock| inner(sock, rsecret, rooms))
}
+
+fn css_overrides(
+ ClientAppearanceConfig {
+ accent,
+ accent_light,
+ accent_dark,
+ background,
+ background_dark,
+ }: &ClientAppearanceConfig,
+) -> String {
+ format!(
+ r#":root {{
+ --bg: {background};
+ --bg-dark: {background_dark};
+ --ac: {accent};
+ --ac-dark: {accent_dark};
+ --ac-dark-transparent: {accent_dark}c9;
+ --ac-light: {accent_light};
+}}
+"#
+ )
+}
--
cgit v1.2.3-70-g09d2
From fe36a0640f2e36baad1f08033f09b49bdd0f1062 Mon Sep 17 00:00:00 2001
From: metamuffin
Date: Mon, 27 Feb 2023 18:20:19 +0100
Subject: part 2 + fix css for small screens
---
client-web/public/assets/style/master.css | 39 +++++++------------------------
1 file changed, 9 insertions(+), 30 deletions(-)
(limited to 'client-web')
diff --git a/client-web/public/assets/style/master.css b/client-web/public/assets/style/master.css
index 13f8f2f..8d77ca1 100644
--- a/client-web/public/assets/style/master.css
+++ b/client-web/public/assets/style/master.css
@@ -9,6 +9,7 @@
@import url("./room.css");
@import url("./prefs.css");
@import url("./menu.css");
+@import url("/overrides.css");
* {
font-family: "Ubuntu", sans-serif;
@@ -17,17 +18,9 @@
padding: 0px;
}
-:root {
- --bg: #151315;
- --bg-dark: #070707;
- --ac: #5e3f84;
- --ac-dark: #2d0d52;
- --ac-light: #7c43bd;
- --ac-dark-transparent: #2d0d52c9;
-}
-
body.start {
- background-image: linear-gradient(var(--ac-dark-transparent), black 150%), url("./tile-backdrop.svg");
+ 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);
@@ -42,14 +35,13 @@ body {
}
h1 {
- text-shadow: 0px 0px 20px rgba(0,0,0,0.75);
+ text-shadow: 0px 0px 20px rgba(0, 0, 0, 0.75);
font-size: 5em;
font-weight: 700;
text-align: center;
margin-bottom: 0.1em;
}
-
input[type="button"],
button {
padding: 0.5em;
@@ -115,11 +107,10 @@ button:disabled {
width: calc(100% - 1em);
}
-@media (max-width : 800px), (max-height: 700px) {
+@media (max-width: 800px), (max-height: 700px) {
h1 {
font-size: xxx-large;
}
-
.start-box {
position: relative;
top: 0;
@@ -129,28 +120,16 @@ button:disabled {
margin: 0 auto;
margin-top: 1em;
}
-
- .start-box .description {
- margin-bottom: 0.5em;
- font-size: large;
- }
-
.start-box p {
margin-bottom: 0.5em;
- font-size: large;
+ font-size: large !important;
}
-
.start-box input[type="text"] {
margin: 1em 0 0.5em 0;
- font-size: large;
+ font-size: large !important;
}
-
.start-box input[type="button"] {
margin: 0.5em 0 0.5em 0;
- font-size: large;
+ font-size: large !important;
}
-
- #room-id-input {
- font-size: large;
- }
-}
\ No newline at end of file
+}
--
cgit v1.2.3-70-g09d2