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

Commit

Permalink
Fishjam rebranding
Browse files Browse the repository at this point in the history
  • Loading branch information
kamil-stasiak committed May 20, 2024
1 parent ff0c13d commit ea3d906
Show file tree
Hide file tree
Showing 42 changed files with 599 additions and 1,404 deletions.
2 changes: 1 addition & 1 deletion .env.example
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ 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 }}
JELLYFISH_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 }}
JELLYFISH_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 }}
JELLYFISH_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
38 changes: 19 additions & 19 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
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_JELLYFISH1> OR <JF1_IP>:<JELLYFISH1_PORT> # Value passed to fishjam and returns by it when creating a room on this speicific fishjam
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
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
8 changes: 4 additions & 4 deletions assets/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,10 @@ FROM alpine:3.18 as builder
WORKDIR '/app'

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

# Install nodejs and 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
4 changes: 2 additions & 2 deletions assets/package-lock.json

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

2 changes: 1 addition & 1 deletion 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 Down
4 changes: 2 additions & 2 deletions assets/src/features/home-page/components/HomePageLayout.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import BlockingScreen from "../../shared/components/BlockingScreen";

import Navbar from "./Navbar";
import useSmartphoneViewport from "../../shared/hooks/useSmartphoneViewport";
import { JELLYFISH_VERSION, JELLYROOM_VERSION } from "../../../pages/room/consts";
import { JELLYFISH_VERSION, FISHJAM_ROOM_VERSION } from "../../../pages/room/consts";

const HomePageLayout: FC<PropsWithChildren> = ({ children }) => {
const { isSmartphone, isHorizontal } = useSmartphoneViewport();
Expand All @@ -25,7 +25,7 @@ const HomePageLayout: FC<PropsWithChildren> = ({ children }) => {
<div className="top-4 mb-4 self-start flex justify-between sm:absolute sm:inset-x-4 sm:mb-0">
<Navbar />
<div className="ml-4 text-right">
{`${JELLYROOM_VERSION} (jellyfish ${JELLYFISH_VERSION})`}
{`${FISHJAM_ROOM_VERSION} (jellyfish ${JELLYFISH_VERSION})`}
</div>
</div>

Expand Down
2 changes: 1 addition & 1 deletion assets/src/pages/room/consts.ts
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ export const BACKEND_URL = isDevEnv ?
// @ts-ignore
export const JELLYFISH_VERSION = import.meta.env.VITE_JELLYFISH_VERSION
// @ts-ignore
export const JELLYROOM_VERSION = import.meta.env.VITE_JELLYROOM_VERSION
export const FISHJAM_ROOM_VERSION = import.meta.env.VITE_FISHJAM_ROOM_VERSION

// videoroom_backend should return this address (host and port)
// @ts-ignore
Expand Down
6 changes: 3 additions & 3 deletions assets/src/room.api.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@ const API = new RoomApi(undefined, BACKEND_URL.origin, axios);

export const getTokenAndAddress = (roomId: string) =>
API.videoroomWebRoomControllerShow(roomId).then((resp) => {
// @ts-ignore
const address = resp?.data?.data?.jellyfish_address || "";
// @ts-ignore
const address = resp?.data?.data?.fishjam_address || "";

// eslint-disable-next-line @typescript-eslint/ban-ts-comment
// @ts-ignore
Expand All @@ -16,4 +16,4 @@ export const getTokenAndAddress = (roomId: string) =>
});

export const startRecording = (roomId: string) =>
API.videoroomWebRoomControllerStartRecording(roomId);
API.videoroomWebRoomControllerStartRecording(roomId);
2 changes: 1 addition & 1 deletion assets/src/server-sdk/.npmignore
Original file line number Diff line number Diff line change
@@ -1 +1 @@
# empty npmignore to ensure all required files (e.g., in the dist folder) are published by npm
# empty npmignore to ensure all required files (e.g., in the dist folder) are published by npm
2 changes: 1 addition & 1 deletion assets/src/server-sdk/.openapi-generator/VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
6.5.0
7.4.0
Loading

0 comments on commit ea3d906

Please sign in to comment.