Skip to content
This repository has been archived by the owner on Jul 17, 2024. It is now read-only.

Commit

Permalink
Fishjam rebranding - update to 0.6.0 (#78)
Browse files Browse the repository at this point in the history
  • Loading branch information
kamil-stasiak authored May 24, 2024
1 parent ff0c13d commit c326ae2
Show file tree
Hide file tree
Showing 71 changed files with 669 additions and 1,597 deletions.
4 changes: 2 additions & 2 deletions .env.example
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
#JELLYFISH
#FISHJAM
# TURN default configuration
# note: loopback address as EXTERNAL_IP cannot be used inside a Docker container
# EXTERNAL_IP=<your_public_ip_address>
JF_SERVER_API_TOKEN="development"

# SSL
DOMAIN=localhost
# BE_JF_ADDRESSES=<jellyfish_domain_address1> <jellyfish_domain_address2>
# BE_JF_ADDRESSES=<fishjam_domain_address1> <fishjam_domain_address2>
# BE_HOST=<backend_domain_address>
# BE_JF_SECURE_CONNECTION=false
# JF_CHECK_ORIGIN=false
Expand Down
26 changes: 26 additions & 0 deletions .github/workflows/debug_build_and_deploy.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
name: Staging Build and Deploy
on:
push:
branches:
- "debug-staging"
paths:
- "**"

env:
DOMAIN: room.fishjam.work
BE_HOST: server.room.fishjam.work
PROJECT: staging
COMPOSE_FILE_NAME: docker-compose-deploy.yaml

jobs:
deploy1:
runs-on: ubuntu-latest
steps:
- name: Debug staging
uses: JimCronqvist/action-ssh@master
with:
hosts: ${{ secrets.STAGING_HOST }}
privateKey: ${{ secrets.SSH_PRIV_KEY }}
command: |
cat test.txt
8 changes: 4 additions & 4 deletions .github/workflows/production_build_and_deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,16 +20,16 @@ jobs:
id: versions
run: |
cat << EOF >> $GITHUB_OUTPUT
jellyroom=${GITHUB_REF#refs/*/}
jellyfish=$(cat .jellyfish-version)
fishjam_room=${GITHUB_REF#refs/*/}
fishjam=$(cat .fishjam-version)
EOF
- name: Prepare .env file for the deployment
id: variables_population
run: |
echo "DOMAIN=${{env.DOMAIN}}
JELLYROOM_VERSION=${{ steps.versions.outputs.jellyroom }}
JELLYFISH_VERSION=${{ steps.versions.outputs.jellyfish }}
FISHJAM_ROOM_VERSION=${{ steps.versions.outputs.fishjam_room }}
FISHJAM_VERSION=${{ steps.versions.outputs.fishjam }}
JF_SERVER_API_TOKEN=${{secrets.SERVER_API_TOKEN_CLOUD_PRODUCTION}}
BE_HOST=${{env.BE_HOST}}
BE_JF_SECURE_CONNECTION=true
Expand Down
8 changes: 4 additions & 4 deletions .github/workflows/sandbox_build_and_deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,16 +22,16 @@ jobs:
id: versions
run: |
cat << EOF >> $GITHUB_OUTPUT
jellyroom=${GITHUB_SHA:0:7}
jellyfish=$(cat .jellyfish-version)
fishjam_room=${GITHUB_SHA:0:7}
fishjam=$(cat .fishjam-version)
EOF
- name: Prepare .env file for the deployment
id: variables_population
run: |
echo "DOMAIN=${{env.DOMAIN}}
JELLYROOM_VERSION=${{ steps.versions.outputs.jellyroom }}
JELLYFISH_VERSION=${{ steps.versions.outputs.jellyfish }}
FISHJAM_ROOM_VERSION=${{ steps.versions.outputs.fishjam_room }}
FISHJAM_VERSION=${{ steps.versions.outputs.fishjam }}
JF_SERVER_API_TOKEN=${{secrets.SERVER_API_TOKEN_CLOUD_SANDBOX}}
BE_HOST=${{env.BE_HOST}}
BE_JF_SECURE_CONNECTION=true
Expand Down
8 changes: 4 additions & 4 deletions .github/workflows/staging_build_and_deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,16 +20,16 @@ jobs:
id: versions
run: |
cat << EOF >> $GITHUB_OUTPUT
jellyroom=${GITHUB_SHA:0:7}
jellyfish=$(cat .jellyfish-version)
fishjam_room=${GITHUB_SHA:0:7}
fishjam=$(cat .fishjam-version)
EOF
- name: Prepare .env file for the deployment
id: variables_population
run: |
echo "DOMAIN=${{env.DOMAIN}}
JELLYROOM_VERSION=${{ steps.versions.outputs.jellyroom }}
JELLYFISH_VERSION=${{ steps.versions.outputs.jellyfish }}
FISHJAM_ROOM_VERSION=${{ steps.versions.outputs.fishjam_room }}
FISHJAM_VERSION=${{ steps.versions.outputs.fishjam }}
JF_SERVER_API_TOKEN=${{secrets.SERVER_API_TOKEN_CLOUD_STAGING}}
BE_HOST=${{env.BE_HOST}}
BE_JF_SECURE_CONNECTION=true
Expand Down
2 changes: 1 addition & 1 deletion .gitmodules
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
[submodule "protos"]
path = protos
url = https://github.com/jellyfish-dev/protos.git
url = https://github.com/fishjam-dev/protos.git
40 changes: 20 additions & 20 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
# Videoroom

Videoroom is an open-source, basic video conferencing platform using WebRTC.
It is based on [jellyfish](https://github.com/jellyfish-dev/jellyfish), a general-purpose media server.
Videoroom may be a good starting point for building your own real-time communication solution using Elixir and Jellyfish.
It is based on [fishjam](https://github.com/fishjam-dev/fishjam), a general-purpose media server.
Videoroom may be a good starting point for building your own real-time communication solution using Elixir and Fishjam.

## Running with Docker
The simplest way to run videoroom is with use of Docker.
Expand All @@ -15,9 +15,9 @@ docker compose --env-file .env.example up

Make sure to have installed [Elixir](https://elixir-lang.org/install.html) and [npm](https://docs.npmjs.com/downloading-and-installing-node-js-and-npm) first.

Running the Videoroom requires connecting to an instance of [Jellyfish Server](https://github.com/jellyfish-dev/jellyfish).
Running the Videoroom requires connecting to an instance of [Fishjam Server](https://github.com/fishjam-dev/fishjam).

When running locally, you can start an instance of Jellyfish inside docker using docker compose.
When running locally, you can start an instance of Fishjam inside docker using docker compose.

```sh
EXTERNAL_IP=<your ip in local network> docker compose -f docker-compose-dev.yaml up
Expand All @@ -27,26 +27,26 @@ Now you can start the Videoroom backend:
- Run `mix setup` to install and setup dependencies
- Start Phoenix server with `mix phx.server`

When running the build version of the Phoenix app, you must specify the addresses of the Jellyfish and backend service.
When running the build version of the Phoenix app, you must specify the addresses of the Fishjam and backend service.
As well as the authentication token via the environment variables:

```sh
BE_JF_ADDRESSES=<IP_ADDRESS1>:<PORT1> OR <DOMAIN1> <IP_ADDRESS2>:<PORT2> OR <DOMAIN2> #Example of using two jellyfishes: `127.0.0.1:5002 room.fishjam.ovh`, if not provided in dev environment `localhost:5002 localhost:5003` is used.
BE_JF_SERVER_API_TOKEN=<TOKEN> #This must be the same token that was setup in jellyfish. In `docker-compose-dev.yaml` we setup `development` and this variable is used by default in `dev` environment
BE_JF_ADDRESSES=<IP_ADDRESS1>:<PORT1> OR <DOMAIN1> <IP_ADDRESS2>:<PORT2> OR <DOMAIN2> #Example of using two fishjams: `127.0.0.1:5002 room.fishjam.ovh`, if not provided in dev environment `localhost:5002 localhost:5003` is used.
BE_JF_SERVER_API_TOKEN=<TOKEN> #This must be the same token that was setup in fishjam. In `docker-compose-dev.yaml` we setup `development` and this variable is used by default in `dev` environment
```

Optionally, in production, these variables can be set:
* `BE_PEER_JOIN_TIMEOUT` - can be used to limit the period in which a new peer must join the meeting,
* `BE_JF_SECURE_CONNECTION` - enforces connecting the backend to jellyfish through `wss` protocol,
* `BE_JF_SECURE_CONNECTION` - enforces connecting the backend to fishjam through `wss` protocol,
* `BE_HOST` - address of backend
* `JF_CHECK_ORIGIN` - define whether jellyfish should check origin of incoming requests
* `JF_CHECK_ORIGIN` - define whether fishjam should check origin of incoming requests


Next you have to start a Videoroom frontend:
- Run `npm ci --prefix=assets` to install and setup dependencies
- Start vite server with `npm run dev --prefix=assets`

Now you have all needed components to use jellyfish videoroom.
Now you have all needed components to use fishjam videoroom.

## Production

Expand All @@ -56,21 +56,21 @@ You can copy the `.env.example` file to `.env` and adjust it to your needs.

## Deployment with load-balancing

`docker-compose.yaml` allows to run a jellyfish videoroom with multiple jellyfishes but all of that runs on the same machine.
`docker-compose.yaml` allows to run a fishjam videoroom with multiple fishjams but all of that runs on the same machine.
For properly using load-balancing two machines will be needed and `docker-compose-deploy.yaml` will be used.
You can see our deployment workflow [here](.github/workflows/test_build_and_deploy.yml).
This deployment is pretty simple.
All containers besides `jellyfish2` are started on node1 and `jellyfish2` is started on node2.
All containers besides `fishjam2` are started on node1 and `fishjam2` is started on node2.
All environment variables used in our deployment are presented below:

```sh
DOMAIN=<FRONTEND_DOMAIN>
JF1_IP=<NODE1_IP> # IP address of first node on which jellyfish will be run
JF2_IP=<NODE2_IP> # IP address of second node on which jellyfish will be run
JF_SERVER_API_TOKEN=<API_TOKEN> #The same API token is used for all jellyfishes
JF1_HOST=<DOMAIN_JELLYFISH1> OR <JF1_IP>:<JELLYFISH1_PORT> # Value passed to jellyfish and returns by it when creating a room on this speicific jellyfish
JF2_HOST=<DOMAIN_JELLYFISH2> OR <JF2_IP>:<JELLYFISH2_PORT>
BE_JF_ADDRESSES=<JF1_HOST> <JF2_HOST> #Used by backend to create a notifier to one of jellyfishes
JF1_IP=<NODE1_IP> # IP address of first node on which fishjam will be run
JF2_IP=<NODE2_IP> # IP address of second node on which fishjam will be run
JF_SERVER_API_TOKEN=<API_TOKEN> #The same API token is used for all fishjams
JF1_HOST=<DOMAIN_FISHJAM1> OR <JF1_IP>:<FISHJAM1_PORT> # Value passed to fishjam and returns by it when creating a room on this speicific fishjam
JF2_HOST=<DOMAIN_FISHJAM2> OR <JF2_IP>:<FISHJAM2_PORT>
BE_JF_ADDRESSES=<JF1_HOST> <JF2_HOST> #Used by backend to create a notifier to one of fishjams
PROMETHEUS_TARGETS=<JF1_IP>:9568,<JF2_IP>:9568 #Addresses on which prometheus will query for data
BE_HOST=<BACKEND_DOMAIN>
GF_SECURITY_ADMIN_PASSWORD=<GRAFANA_PASSWORD>
Expand All @@ -83,9 +83,9 @@ JF_CHECK_ORIGIN=false

We use [Divo](https://hexdocs.pm/divo/readme.html) in tests, which is responsible for starting docker containers.

When running locally run tests using `mix test`, which starts Jellyfish in a container.
When running locally run tests using `mix test`, which starts Fishjam in a container.

On CI both Jellyfish and the tests are run inside docker. If needed, e.g. when the tests are failing on the CI, but not locally you can simulate those conditions with `mix integration_test`.
On CI both Fishjam and the tests are run inside docker. If needed, e.g. when the tests are failing on the CI, but not locally you can simulate those conditions with `mix integration_test`.

## Copyright and License

Expand Down
12 changes: 6 additions & 6 deletions assets/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,11 @@ FROM alpine:3.18 as builder
WORKDIR '/app'

ARG FE_BE_HOST
ARG JELLYROOM_VERSION
ARG JELLYFISH_VERSION
ARG FISHJAM_ROOM_VERSION
ARG FISHJAM_VERSION
ENV VITE_BE_HOST=$FE_BE_HOST
ENV VITE_JELLYROOM_VERSION=$JELLYROOM_VERSION
ENV VITE_JELLYFISH_VERSION=$JELLYFISH_VERSION
ENV VITE_FISHJAM_ROOM_VERSION=$FISHJAM_ROOM_VERSION
ENV VITE_FISHJAM_VERSION=$FISHJAM_VERSION

# Install nodejs and npm
RUN apk add --no-cache nodejs npm
Expand All @@ -19,7 +19,7 @@ RUN adduser --disabled-password --gecos "" node
# Own the app directory
RUN chown node:node ./

# It's adviced to run the container as non-root user
# It's adviced to run the container as non-root user
# for added security if the base image has the user
USER node

Expand All @@ -29,7 +29,7 @@ COPY package*.json ./
# Install dependencies
RUN npm ci

# Copy application files
# Copy application files
COPY . .

# Build the app
Expand Down
48 changes: 24 additions & 24 deletions assets/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions assets/package.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"name": "jellyfish-videoroom",
"name": "fishjam-videoroom",
"private": true,
"version": "0.0.0",
"type": "module",
Expand All @@ -11,7 +11,7 @@
"preview": "vite preview"
},
"dependencies": {
"@jellyfish-dev/react-client-sdk": "^0.3.1",
"@fishjam-dev/react-client": "^0.4.0",
"@mediapipe/tasks-vision": "^0.10.12",
"axios": "^1.6.8",
"chartist": "^1.3.0",
Expand Down
6 changes: 3 additions & 3 deletions assets/src/App.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ import ReactModal from "react-modal";
import "./index.css";

import { StreamingErrorBoundary } from "./features/streaming/StreamingErrorBoundary";
import { JellyfishContextProvider } from "./jellyfish.types";
import { FishjamContextProvider } from "./fishjam";

// When returning to the videoroom page from another domain using the 'Back' button on the Safari browser,
// the page is served from the cache, which prevents lifecycle events from being triggered.
Expand All @@ -24,7 +24,7 @@ const App: FC = () => {
return (
<UserProvider>
<DeveloperInfoProvider>
<JellyfishContextProvider>
<FishjamContextProvider>
<LocalPeerMediaProvider>
<ToastProvider>
<ModalProvider>
Expand All @@ -36,7 +36,7 @@ const App: FC = () => {
</ModalProvider>
</ToastProvider>
</LocalPeerMediaProvider>
</JellyfishContextProvider>
</FishjamContextProvider>
</DeveloperInfoProvider>
</UserProvider>
);
Expand Down
4 changes: 2 additions & 2 deletions assets/src/features/devices/LocalMediaMessagesBoundary.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@ import {
useCamera,
useClient,
useMicrophone
} from "../../jellyfish.types.ts";
import { ClientEvents } from "@jellyfish-dev/react-client-sdk";
} from "../../fishjam.ts";
import { ClientEvents } from "@fishjam-dev/react-client";

const prepareErrorMessage = (videoDeviceError: string | null, audioDeviceError: string | null): null | string => {
if (videoDeviceError && audioDeviceError) {
Expand Down
4 changes: 2 additions & 2 deletions assets/src/features/devices/LocalPeerMediaContext.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@ import {
SCREENSHARING_TRACK_CONSTRAINTS,
VIDEO_TRACK_CONSTRAINTS
} from "../../pages/room/consts";
import { PeerMetadata, TrackMetadata, useCamera, useClient, useMicrophone, useSetupMedia } from "../../jellyfish.types";
import { ClientEvents, UseCameraResult, SimulcastConfig } from "@jellyfish-dev/react-client-sdk";
import { PeerMetadata, TrackMetadata, useCamera, useClient, useMicrophone, useSetupMedia } from "../../fishjam";
import { ClientEvents, UseCameraResult, SimulcastConfig } from "@fishjam-dev/react-client";
import { BlurProcessor } from "./BlurProcessor";
import { selectBandwidthLimit } from "../../pages/room/bandwidth.tsx";
import { useDeveloperInfo } from "../../contexts/DeveloperInfoContext.tsx";
Expand Down
2 changes: 1 addition & 1 deletion assets/src/features/devices/MediaSettingsModal.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import { Modal } from "../shared/components/modal/Modal";
import { Checkbox } from "../shared/components/Checkbox";
import { useRecording } from "../recording/useRecording";
import Button from "../shared/components/Button";
import { useCamera, useMicrophone } from "../../jellyfish.types.ts";
import { useCamera, useMicrophone } from "../../fishjam.ts";

export const MediaSettingsModal: React.FC = () => {
const { setOpen, isOpen } = useModal();
Expand Down
Loading

0 comments on commit c326ae2

Please sign in to comment.