Compare commits
No commits in common. "b01b637a2220b8aaef6d658ede34258001f0a7d9" and "a1cb1a30d9ab2acd13bba5272f3a6c8b4c0a1714" have entirely different histories.
b01b637a22
...
a1cb1a30d9
|
@ -1,4 +1,3 @@
|
||||||
.stack-work/
|
.stack-work/
|
||||||
*~
|
*~
|
||||||
dist-newstyle
|
dist-newstyle
|
||||||
result
|
|
||||||
|
|
|
@ -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";
|
|
||||||
}
|
|
|
@ -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" = { };
|
|
||||||
};
|
|
||||||
};
|
|
||||||
}
|
|
|
@ -1,5 +0,0 @@
|
||||||
#!/usr/bin/env bash
|
|
||||||
|
|
||||||
nix-build
|
|
||||||
|
|
||||||
scp ./result ffs:/home/ffsys/jitsi-rooms-docker-image
|
|
|
@ -91,3 +91,28 @@ executable jitsi-rooms-exe
|
||||||
, websockets
|
, websockets
|
||||||
default-language: Haskell2010
|
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
|
||||||
|
|
|
@ -6,7 +6,6 @@ module WebSocket.MonadWebSocketSession
|
||||||
)
|
)
|
||||||
where
|
where
|
||||||
|
|
||||||
import BroadcastUserData (MonadBroadcast, broadcastUserData)
|
|
||||||
import ClassyPrelude
|
import ClassyPrelude
|
||||||
import Data.Aeson
|
import Data.Aeson
|
||||||
( FromJSON,
|
( FromJSON,
|
||||||
|
@ -17,7 +16,6 @@ import State.ConnectedClientsState
|
||||||
( MonadConnectedClientsModify,
|
( MonadConnectedClientsModify,
|
||||||
removeWSClient,
|
removeWSClient,
|
||||||
)
|
)
|
||||||
import State.RoomDataState (MonadRoomDataStateRead)
|
|
||||||
import Types.ConnectionState (Client (..))
|
import Types.ConnectionState (Client (..))
|
||||||
import Types.WebSocketMessages.WebSocketMessages (SetClientInfo (..))
|
import Types.WebSocketMessages.WebSocketMessages (SetClientInfo (..))
|
||||||
import WebSocket.Messages
|
import WebSocket.Messages
|
||||||
|
@ -58,12 +56,9 @@ newClientGeneric clientInfo = do
|
||||||
|
|
||||||
disconnectWsClient ::
|
disconnectWsClient ::
|
||||||
( MonadConnectedClientsModify m,
|
( MonadConnectedClientsModify m,
|
||||||
MonadRoomDataStateRead m,
|
|
||||||
MonadBroadcast m,
|
|
||||||
MonadWebSocketSession m
|
MonadWebSocketSession m
|
||||||
) =>
|
) =>
|
||||||
m ()
|
m ()
|
||||||
disconnectWsClient = do
|
disconnectWsClient = do
|
||||||
clientId <- getSesssionId
|
clientId <- getSesssionId
|
||||||
removeWSClient clientId
|
removeWSClient clientId
|
||||||
broadcastUserData
|
|
||||||
|
|
|
@ -18,9 +18,9 @@ runWebSocketServer ::
|
||||||
) =>
|
) =>
|
||||||
m ()
|
m ()
|
||||||
runWebSocketServer = do
|
runWebSocketServer = do
|
||||||
putStrLn "Websocket up at 0.0.0.0:9160"
|
putStrLn "Websocket up at 127.0.0.1:9160"
|
||||||
wsApp' <- runWSApp
|
wsApp' <- runWSApp
|
||||||
liftIO $ WS.runServer "0.0.0.0" 9160 wsApp'
|
liftIO $ WS.runServer "127.0.0.1" 9160 wsApp'
|
||||||
|
|
||||||
runWSApp ::
|
runWSApp ::
|
||||||
( MonadIO m,
|
( MonadIO m,
|
||||||
|
|
|
@ -1,5 +0,0 @@
|
||||||
#!/usr/bin/env sh
|
|
||||||
|
|
||||||
|
|
||||||
yarn build
|
|
||||||
scp -r dist/* ffs:/home/ffsys/apps/static/jitsi-rooms
|
|
|
@ -1,4 +0,0 @@
|
||||||
#!/usr/bin/env sh
|
|
||||||
|
|
||||||
|
|
||||||
ssh -L 9160:localhost:9160 ffs
|
|
|
@ -1,42 +1,28 @@
|
||||||
import { useState } from "react";
|
|
||||||
import "./App.css";
|
import "./App.css";
|
||||||
import Meeting from "./components/meeting/Meeting";
|
import Meeting from "./components/meeting/Meeting";
|
||||||
import Sidebar from "./components/sidebar/Sidebar";
|
import Sidebar from "./components/sidebar/Sidebar";
|
||||||
import useBackendData from "./hooks/useBackendData";
|
import useBackendData from "./hooks/useBackendData";
|
||||||
import useConferenceData from "./hooks/useConferenceData";
|
import useConferenceData from "./hooks/useConferenceData";
|
||||||
import useLocalUser from "./hooks/useLocalUser";
|
import useLocalUser from "./hooks/useLocalUser";
|
||||||
import { useRoomName } from "./hooks/useRoomName";
|
|
||||||
|
|
||||||
function App() {
|
function App() {
|
||||||
const { userInfo, setUserInfo } = useLocalUser();
|
const { userInfo, setUserInfo } = useLocalUser();
|
||||||
const { roomName, updateRoomName, updateAndSubmitRoomName, submitRoomName } = useRoomName();
|
|
||||||
const { roomData, sendMessage } = useBackendData(userInfo);
|
const { roomData, sendMessage } = useBackendData(userInfo);
|
||||||
const { conferenceData, setConferenceData } = useConferenceData(
|
const { conferenceData, setConferenceData } = useConferenceData(
|
||||||
sendMessage,
|
sendMessage,
|
||||||
setUserInfo
|
setUserInfo
|
||||||
);
|
);
|
||||||
const [meetingStarted, setMeetingStarted] = useState(false);
|
|
||||||
|
|
||||||
console.log(roomData);
|
console.log(roomData);
|
||||||
|
|
||||||
if (roomData && userInfo) {
|
if (roomData && userInfo) {
|
||||||
return (
|
return (
|
||||||
<div className="App">
|
<div className="App">
|
||||||
<Sidebar usersData={roomData}
|
<Sidebar usersData={roomData} />
|
||||||
updateAndSubmitRoomName={(roomName: string) => {
|
|
||||||
updateAndSubmitRoomName(roomName)
|
|
||||||
setMeetingStarted(true)
|
|
||||||
}}
|
|
||||||
/>
|
|
||||||
<Meeting
|
<Meeting
|
||||||
conferenceData={conferenceData}
|
conferenceData={conferenceData}
|
||||||
setConferenceData={setConferenceData}
|
setConferenceData={setConferenceData}
|
||||||
userInfo={userInfo}
|
userInfo={userInfo}
|
||||||
roomName={roomName}
|
|
||||||
updateRoomName={updateRoomName}
|
|
||||||
submitRoomName={submitRoomName}
|
|
||||||
meetingStarted={meetingStarted}
|
|
||||||
setMeetingStarted={setMeetingStarted}
|
|
||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
);
|
);
|
||||||
|
|
|
@ -1,5 +1,7 @@
|
||||||
const ISPROD = window.location.protocol == "https:";
|
const ISPROD = window.location.protocol == "https:";
|
||||||
const JITSI_DOMAIN = "thisisnotajitsi.filefighter.de";
|
const JITSI_DOMAIN = ISPROD
|
||||||
|
? "thisisnotajitsi.filefighter.de"
|
||||||
|
: "localhost:8443";
|
||||||
const WEBSOCKET_URL =
|
const WEBSOCKET_URL =
|
||||||
"ws" +
|
"ws" +
|
||||||
(ISPROD ? "s" : "") +
|
(ISPROD ? "s" : "") +
|
||||||
|
|
|
@ -9,12 +9,11 @@ interface Props {
|
||||||
conferenceData: ConferenceData | undefined;
|
conferenceData: ConferenceData | undefined;
|
||||||
setConferenceData: (newData: ConferenceData) => void;
|
setConferenceData: (newData: ConferenceData) => void;
|
||||||
userInfo: UserInfo;
|
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(() => {
|
const startMeeting = useCallback(() => {
|
||||||
submitRoomName();
|
submitRoomName();
|
||||||
|
|
|
@ -5,7 +5,6 @@ import { UsersData } from "../../background/types/roomData";
|
||||||
|
|
||||||
interface Props {
|
interface Props {
|
||||||
usersData: UsersData;
|
usersData: UsersData;
|
||||||
updateAndSubmitRoomName: Function
|
|
||||||
}
|
}
|
||||||
|
|
||||||
function Sidebar(props: Props) {
|
function Sidebar(props: Props) {
|
||||||
|
@ -15,17 +14,17 @@ function Sidebar(props: Props) {
|
||||||
return (
|
return (
|
||||||
<div className={`sidebar sidebar-${sidebarVisibility}`}>
|
<div className={`sidebar sidebar-${sidebarVisibility}`}>
|
||||||
<SidebarHeader sidebarVisibility={sidebarVisibility} />
|
<SidebarHeader sidebarVisibility={sidebarVisibility} />
|
||||||
|
<div>
|
||||||
|
<h3> No room</h3>
|
||||||
|
{props.usersData.usersWithOutRoom.map((username) => (
|
||||||
|
<div>{username}</div>
|
||||||
|
))}
|
||||||
|
</div>
|
||||||
<div>
|
<div>
|
||||||
{props.usersData.roomsData.map((roomData) => {
|
{props.usersData.roomsData.map((roomData) => {
|
||||||
return (
|
return (
|
||||||
<>
|
<>
|
||||||
<h3>
|
<h3> {roomData.roomName} </h3>
|
||||||
<a href="#" onClick={() => {
|
|
||||||
props.updateAndSubmitRoomName(roomData.roomName)
|
|
||||||
}}>
|
|
||||||
{roomData.roomName}
|
|
||||||
</a>
|
|
||||||
</h3>
|
|
||||||
{roomData.participants.map((participant) => (
|
{roomData.participants.map((participant) => (
|
||||||
<div> {participant.displayName} </div>
|
<div> {participant.displayName} </div>
|
||||||
))}
|
))}
|
||||||
|
@ -33,12 +32,6 @@ function Sidebar(props: Props) {
|
||||||
);
|
);
|
||||||
})}
|
})}
|
||||||
</div>
|
</div>
|
||||||
<div>
|
|
||||||
<h3> No room</h3>
|
|
||||||
{props.usersData.usersWithOutRoom.map((username) => (
|
|
||||||
<div>{username}</div>
|
|
||||||
))}
|
|
||||||
</div>
|
|
||||||
<div className="sidebar-footer">
|
<div className="sidebar-footer">
|
||||||
<button onClick={toggleSidebarVisibility}>{sidebarToggleText}</button>
|
<button onClick={toggleSidebarVisibility}>{sidebarToggleText}</button>
|
||||||
</div>
|
</div>
|
||||||
|
|
|
@ -11,22 +11,12 @@ function useRoomName() {
|
||||||
[setRoomName]
|
[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(() => {
|
const submitRoomName = useCallback(() => {
|
||||||
setRoomNameInUrl(roomName);
|
setRoomNameInUrl(roomName);
|
||||||
setRoomNameInTitle(roomName);
|
setRoomNameInTitle(roomName);
|
||||||
}, [roomName]);
|
}, [roomName]);
|
||||||
|
|
||||||
return { roomName, updateRoomName, updateAndSubmitRoomName, submitRoomName };
|
return { roomName, updateRoomName, submitRoomName };
|
||||||
}
|
}
|
||||||
|
|
||||||
function getRoomNameFromUrl(): string {
|
function getRoomNameFromUrl(): string {
|
||||||
|
|
|
@ -211,7 +211,7 @@ JIBRI_XMPP_PASSWORD=662f13288a07ca64afb4b9b97b4feed6
|
||||||
#
|
#
|
||||||
|
|
||||||
# Container restart policy
|
# Container restart policy
|
||||||
RESTART_POLICY=no
|
#RESTART_POLICY=unless-stopped
|
||||||
|
|
||||||
# Jitsi image version (useful for local development)
|
# Jitsi image version (useful for local development)
|
||||||
#JITSI_IMAGE_VERSION=latest
|
#JITSI_IMAGE_VERSION=latest
|
||||||
|
|
|
@ -346,15 +346,6 @@ services:
|
||||||
networks:
|
networks:
|
||||||
meet.jitsi:
|
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
|
# Custom network so all services can communicate using a FQDN
|
||||||
networks:
|
networks:
|
||||||
meet.jitsi:
|
meet.jitsi:
|
||||||
|
|
Loading…
Reference in New Issue