Compare commits

..

No commits in common. "b01b637a2220b8aaef6d658ede34258001f0a7d9" and "a1cb1a30d9ab2acd13bba5272f3a6c8b4c0a1714" have entirely different histories.

16 changed files with 43 additions and 166 deletions

1
backend/.gitignore vendored
View File

@ -1,4 +1,3 @@
.stack-work/
*~
dist-newstyle
result

View File

@ -1,55 +0,0 @@
{ mkDerivation
, aeson
, base
, bytestring
, classy-prelude
, http-types
, lib
, lifted-base
, mtl
, text
, uuid
, wai
, warp
, websockets
}:
mkDerivation {
pname = "jitsi-rooms";
version = "0.1.0.0";
src = ./.;
isLibrary = true;
isExecutable = true;
libraryHaskellDepends = [
aeson
base
bytestring
classy-prelude
http-types
lifted-base
mtl
text
uuid
wai
warp
websockets
];
executableHaskellDepends = [
aeson
base
bytestring
classy-prelude
http-types
lifted-base
mtl
text
uuid
wai
warp
websockets
];
homepage = "https://github.com/githubuser/jitsi-rooms#readme";
license = lib.licenses.bsd3;
mainProgram = "jitsi-rooms-exe";
enableSharedExecutables = false;
postFixup = "rm -rf $out/lib $out/nix-support $out/share/doc";
}

View File

@ -1,34 +0,0 @@
let
config = {
packageOverrides = pkgs: rec {
haskellPackages = pkgs.haskellPackages.override {
overrides = haskellPackagesNew: haskellPackagesOld: rec {
jitsi-rooms =
haskellPackagesNew.callPackage ./converted.nix { };
};
};
};
};
pkgs = import <nixpkgs> { inherit config; };
in
pkgs.dockerTools.buildImage {
name = "jitsi-rooms";
tag = "latest";
copyToRoot = pkgs.buildEnv {
name = "image-root";
paths = [
pkgs.bash
pkgs.coreutils
];
pathsToLink = [ "/bin" ];
};
config = {
Cmd = [ "${pkgs.haskellPackages.jitsi-rooms}/bin/jitsi-rooms-exe" ];
ExposedPorts = {
"9160/tcp" = { };
"8081/tcp" = { };
};
};
}

View File

@ -1,5 +0,0 @@
#!/usr/bin/env bash
nix-build
scp ./result ffs:/home/ffsys/jitsi-rooms-docker-image

View File

@ -91,3 +91,28 @@ executable jitsi-rooms-exe
, websockets
default-language: Haskell2010
test-suite jitsi-rooms-test
type: exitcode-stdio-1.0
main-is: Spec.hs
other-modules:
Paths_jitsi_rooms
hs-source-dirs:
test
default-extensions:
NoImplicitPrelude,OverloadedStrings,ImportQualifiedPost
ghc-options: -Wall -Wcompat -Widentities -Wincomplete-record-updates -Wincomplete-uni-patterns -Wmissing-export-lists -Wmissing-home-modules -Wpartial-fields -Wredundant-constraints -threaded -rtsopts -with-rtsopts=-N
build-depends:
aeson
, base >=4.7 && <5
, bytestring
, classy-prelude
, http-types
, jitsi-rooms
, lifted-base
, mtl
, text
, uuid
, wai
, warp
, websockets
default-language: Haskell2010

View File

@ -6,7 +6,6 @@ module WebSocket.MonadWebSocketSession
)
where
import BroadcastUserData (MonadBroadcast, broadcastUserData)
import ClassyPrelude
import Data.Aeson
( FromJSON,
@ -17,7 +16,6 @@ import State.ConnectedClientsState
( MonadConnectedClientsModify,
removeWSClient,
)
import State.RoomDataState (MonadRoomDataStateRead)
import Types.ConnectionState (Client (..))
import Types.WebSocketMessages.WebSocketMessages (SetClientInfo (..))
import WebSocket.Messages
@ -58,12 +56,9 @@ newClientGeneric clientInfo = do
disconnectWsClient ::
( MonadConnectedClientsModify m,
MonadRoomDataStateRead m,
MonadBroadcast m,
MonadWebSocketSession m
) =>
m ()
disconnectWsClient = do
clientId <- getSesssionId
removeWSClient clientId
broadcastUserData

View File

@ -18,9 +18,9 @@ runWebSocketServer ::
) =>
m ()
runWebSocketServer = do
putStrLn "Websocket up at 0.0.0.0:9160"
putStrLn "Websocket up at 127.0.0.1:9160"
wsApp' <- runWSApp
liftIO $ WS.runServer "0.0.0.0" 9160 wsApp'
liftIO $ WS.runServer "127.0.0.1" 9160 wsApp'
runWSApp ::
( MonadIO m,

View File

@ -1,5 +0,0 @@
#!/usr/bin/env sh
yarn build
scp -r dist/* ffs:/home/ffsys/apps/static/jitsi-rooms

View File

@ -1,4 +0,0 @@
#!/usr/bin/env sh
ssh -L 9160:localhost:9160 ffs

View File

@ -1,42 +1,28 @@
import { useState } from "react";
import "./App.css";
import Meeting from "./components/meeting/Meeting";
import Sidebar from "./components/sidebar/Sidebar";
import useBackendData from "./hooks/useBackendData";
import useConferenceData from "./hooks/useConferenceData";
import useLocalUser from "./hooks/useLocalUser";
import { useRoomName } from "./hooks/useRoomName";
function App() {
const { userInfo, setUserInfo } = useLocalUser();
const { roomName, updateRoomName, updateAndSubmitRoomName, submitRoomName } = useRoomName();
const { roomData, sendMessage } = useBackendData(userInfo);
const { conferenceData, setConferenceData } = useConferenceData(
sendMessage,
setUserInfo
);
const [meetingStarted, setMeetingStarted] = useState(false);
console.log(roomData);
if (roomData && userInfo) {
return (
<div className="App">
<Sidebar usersData={roomData}
updateAndSubmitRoomName={(roomName: string) => {
updateAndSubmitRoomName(roomName)
setMeetingStarted(true)
}}
/>
<Sidebar usersData={roomData} />
<Meeting
conferenceData={conferenceData}
setConferenceData={setConferenceData}
userInfo={userInfo}
roomName={roomName}
updateRoomName={updateRoomName}
submitRoomName={submitRoomName}
meetingStarted={meetingStarted}
setMeetingStarted={setMeetingStarted}
/>
</div>
);

View File

@ -1,5 +1,7 @@
const ISPROD = window.location.protocol == "https:";
const JITSI_DOMAIN = "thisisnotajitsi.filefighter.de";
const JITSI_DOMAIN = ISPROD
? "thisisnotajitsi.filefighter.de"
: "localhost:8443";
const WEBSOCKET_URL =
"ws" +
(ISPROD ? "s" : "") +

View File

@ -9,12 +9,11 @@ interface Props {
conferenceData: ConferenceData | undefined;
setConferenceData: (newData: ConferenceData) => void;
userInfo: UserInfo;
//@ts-ignore
roomName, updateRoomName, submitRoomName
meetingStarted: Boolean, setMeetingStarted: Function
}
function Meeting({ conferenceData, setConferenceData, userInfo, roomName, updateRoomName, submitRoomName, meetingStarted, setMeetingStarted }: Props) {
function Meeting({ conferenceData, setConferenceData, userInfo }: Props) {
const { roomName, updateRoomName, submitRoomName } = useRoomName();
const [meetingStarted, setMeetingStarted] = useState(false);
const startMeeting = useCallback(() => {
submitRoomName();

View File

@ -5,7 +5,6 @@ import { UsersData } from "../../background/types/roomData";
interface Props {
usersData: UsersData;
updateAndSubmitRoomName: Function
}
function Sidebar(props: Props) {
@ -15,17 +14,17 @@ function Sidebar(props: Props) {
return (
<div className={`sidebar sidebar-${sidebarVisibility}`}>
<SidebarHeader sidebarVisibility={sidebarVisibility} />
<div>
<h3> No room</h3>
{props.usersData.usersWithOutRoom.map((username) => (
<div>{username}</div>
))}
</div>
<div>
{props.usersData.roomsData.map((roomData) => {
return (
<>
<h3>
<a href="#" onClick={() => {
props.updateAndSubmitRoomName(roomData.roomName)
}}>
{roomData.roomName}
</a>
</h3>
<h3> {roomData.roomName} </h3>
{roomData.participants.map((participant) => (
<div> {participant.displayName} </div>
))}
@ -33,12 +32,6 @@ function Sidebar(props: Props) {
);
})}
</div>
<div>
<h3> No room</h3>
{props.usersData.usersWithOutRoom.map((username) => (
<div>{username}</div>
))}
</div>
<div className="sidebar-footer">
<button onClick={toggleSidebarVisibility}>{sidebarToggleText}</button>
</div>

View File

@ -11,22 +11,12 @@ function useRoomName() {
[setRoomName]
);
const updateAndSubmitRoomName = useCallback(
(newName: string) => {
setRoomName(newName);
setRoomNameInUrl(newName);
setRoomNameInTitle(newName);
console.log("[Rooms] update and submit room name", newName);
},
[setRoomName]
)
const submitRoomName = useCallback(() => {
setRoomNameInUrl(roomName);
setRoomNameInTitle(roomName);
}, [roomName]);
return { roomName, updateRoomName, updateAndSubmitRoomName, submitRoomName };
return { roomName, updateRoomName, submitRoomName };
}
function getRoomNameFromUrl(): string {

View File

@ -211,7 +211,7 @@ JIBRI_XMPP_PASSWORD=662f13288a07ca64afb4b9b97b4feed6
#
# Container restart policy
RESTART_POLICY=no
#RESTART_POLICY=unless-stopped
# Jitsi image version (useful for local development)
#JITSI_IMAGE_VERSION=latest

View File

@ -346,15 +346,6 @@ services:
networks:
meet.jitsi:
jitsi-rooms:
image: jitsi-rooms:67y5d9y2zbi7wkqm2jpcjj1k2614qwx2
restart: ${RESTART_POLICY:-unless-stopped}
ports:
- '9160:9160'
networks:
meet.jitsi:
# Custom network so all services can communicate using a FQDN
networks:
meet.jitsi: