Skip to content

Commit

Permalink
Merge branch 'development' into translation-system
Browse files Browse the repository at this point in the history
  • Loading branch information
untari authored Jul 19, 2024
2 parents cad57a4 + b55ddb7 commit 68b1813
Show file tree
Hide file tree
Showing 11 changed files with 117 additions and 30 deletions.
1 change: 0 additions & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,5 @@ ENV VENUELESS_COMMIT_SHA=${COMMIT}
USER venueless
VOLUME ["/etc/venueless", "/data"]
EXPOSE 80
ENTRYPOINT ["venueless"]
CMD ["all"]

1 change: 0 additions & 1 deletion docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -77,4 +77,3 @@ networks:
ipam:
config:
- subnet: 172.177.0.0/16

65 changes: 65 additions & 0 deletions prod/docker-compose.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,65 @@
version: '3.4'

services:
venueless:
image: eventyay/eventyay-video:development
container_name: venueless
ports:
- "8375:80"
environment:
- DJANGO_SETTINGS_MODULE=venueless.settings
- LC_ALL=C.UTF-8
- IPYTHONDIR=/data/.ipython
- VENUELESS_COMMIT_SHA=${COMMIT}
- VENUELESS_DB_TYPE=postgresql
- VENUELESS_DB_NAME=eventyay_db
- VENUELESS_DB_USER=postgres_db_user_changeme
- VENUELESS_DB_PASS=postgres_db_pwd_changeme
- VENUELESS_DB_HOST=venueless-db
- VENUELESS_REDIS_URLS=redis://venueless-redis:6379/0,redis://venueless-redis1:6379/0
- VENUELESS_DATA_DIR=/data
- VENUELESS_MEDIA_URL=http://localhost:8375/media/
- VENUELESS_REDIS_USE_PUBSUB=true
depends_on:
- venueless-db
- venueless-redis
- venueless-redis1
volumes:
- /etc/venueless:/etc/venueless
- /data:/data
entrypoint: ["/usr/local/bin/venueless"]
command: ["all"]

venueless-webapp:
image: eventyay/eventyay-video:development
container_name: venueless-webapp
ports:
- "8002:8880"
environment:
- NODE_OPTIONS=--openssl-legacy-provider
entrypoint: [""]
command: ["npm", "start", "--", "--host", "0.0.0.0"]
working_dir: /venueless/webapp

venueless-redis:
image: redis:latest
container_name: venueless-redis

venueless-redis1:
image: redis:latest
container_name: venueless-redis1

venueless-db:
image: postgres:15
container_name: venueless-db
volumes:
- postgres_data:/var/lib/postgresql/data/
environment:
- POSTGRES_INITDB_ARGS=--auth-host=md5
- POSTGRES_HOST_AUTH_METHOD=md5
- POSTGRES_DB=eventyay_db
- POSTGRES_USER=postgres_db_user_changeme
- POSTGRES_PASSWORD=postgres_db_pwd_changeme

volumes:
postgres_data:
6 changes: 3 additions & 3 deletions server/venueless/core/services/world.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,7 @@
from venueless.core.models.auth import ShortToken
from venueless.core.models.room import (
RoomConfigSerializer,
RoomView,
approximate_view_number,
RoomView
)
from venueless.core.permissions import Permission

Expand Down Expand Up @@ -168,7 +167,8 @@ def get_room_config(room, permissions):
}

if hasattr(room, "current_roomviews"):
room_config["users"] = approximate_view_number(room.current_roomviews)
# set actual viewer count instead of approximate text
room_config["users"] = room.current_roomviews

for module in room.module_config:
module_config = copy.deepcopy(module)
Expand Down
11 changes: 4 additions & 7 deletions server/venueless/live/modules/room.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@
from venueless.core.models.room import (
AnonymousInvite,
RoomConfigSerializer,
approximate_view_number,
)
from venueless.core.permissions import Permission
from venueless.core.services.poll import get_polls, get_voted_polls
Expand Down Expand Up @@ -184,20 +183,18 @@ async def _leave_room(self, room):

async def _update_view_count(self, room, actual_view_count):
async with aredis(f"room:approxcount:known:{room.pk}") as redis:
next_value = approximate_view_number(actual_view_count)
prev_value = await redis.getset(
f"room:approxcount:known:{room.pk}", next_value
f"room:approxcount:known:{room.pk}", actual_view_count
)
if prev_value:
prev_value = prev_value.decode()
if prev_value != next_value:
if prev_value != actual_view_count:
await redis.expire(f"room:approxcount:known:{room.pk}", 900)
# broadcast actual viewer count instead of approximate text
await self.consumer.channel_layer.group_send(
GROUP_WORLD.format(id=self.consumer.world.pk),
{
"type": "world.user_count_change",
"room": str(room.pk),
"users": next_value,
"users": actual_view_count,
},
)

Expand Down
5 changes: 5 additions & 0 deletions server/venueless/settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -299,6 +299,11 @@

ROOT_URLCONF = "venueless.urls"

CORS_ORIGIN_REGEX_WHITELIST = [
r"^https?://(\w+\.)?eventyay\.com$", # Allow any subdomain of eventyay.com
r"^https?://video\.eventyay\.com(:\d+)?$", # Allow video.eventyay.com with any port
r"^https?://video-dev\.eventyay\.com(:\d+)?$", # Allow video-dev.eventyay.com with any port
]
if DEBUG:
CORS_ORIGIN_REGEX_WHITELIST = [
r"^http://localhost$",
Expand Down
12 changes: 7 additions & 5 deletions webapp/config.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,15 @@ import cloneDeep from 'lodash/cloneDeep'
let config
if (ENV_DEVELOPMENT || !window.venueless) {
const hostname = window.location.hostname
const wsProtocol = window.location.protocol === 'https:' ? 'wss' : 'ws';
const httpProtocol = window.location.protocol;
config = {
api: {
base: `http://${hostname}:8375/api/v1/worlds/sample/`,
socket: `ws://${hostname}:8375/ws/world/sample/`,
upload: `http://${hostname}:8375/storage/upload/`,
scheduleImport: `http://${hostname}:8375/storage/schedule_import/`,
feedback: `http://${hostname}:8375/_feedback/`,
base: `${httpProtocol}//${hostname}:8443/api/v1/worlds/sample/`,
socket: `${wsProtocol}://${hostname}:8443/ws/world/sample/`,
upload: `${httpProtocol}//${hostname}:8443/storage/upload/`,
scheduleImport: `${httpProtocol}//${hostname}:8443/storage/schedule_import/`,
feedback: `${httpProtocol}//${hostname}:8443/_feedback/`,
},
defaultLocale: 'en',
locales: ['en', 'de', 'pt_BR'],
Expand Down
8 changes: 8 additions & 0 deletions webapp/package-lock.json

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

17 changes: 8 additions & 9 deletions webapp/src/components/AudioTranslationDropdown.vue
Original file line number Diff line number Diff line change
Expand Up @@ -12,14 +12,14 @@ div.c-audio-translation
<script>
export default {
name: 'AudioTranslationDropdown',
props: {
languages: {
type: Array,
required: true
}
},
data() {
return {
props: {
languages: {
type: Array,
required: true
}
},
data() {
return {
selectedLanguage: null, // Selected language for audio translation
languageOptions: [] // Options for the dropdown
};
Expand Down Expand Up @@ -56,4 +56,3 @@ export default {
width: 100%;
}
</style>

10 changes: 8 additions & 2 deletions webapp/src/components/RoomsSidebar.vue
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,10 @@ transition(name="sidebar")
template(v-else)
.room-icon(aria-hidden="true")
.name(v-html="$emojify(stage.room.name)")
.buffer
template(v-if="stage.room.users")
i.mdi.mdi-account-group.icon-viewer
.name(v-html="stage.room.users")
.group-title#chats-title(v-if="roomsByType.videoChat.length || roomsByType.textChat.length || hasPermission('world:rooms.create.chat') || hasPermission('world:rooms.create.bbb')")
span {{ $t('RoomsSidebar:channels-headline:text') }}
.buffer
Expand Down Expand Up @@ -293,7 +297,7 @@ export default {
&.router-link-exact-active, &.active
.room-icon::before
color: var(--clr-sidebar-text-secondary)
.room-icon
.room-icon, .icon-viewer
width: 22px
&::before
font-family: "Material Design Icons"
Expand All @@ -303,7 +307,9 @@ export default {
margin: 0 auto
display: block
width: 20px
.icon-viewer
&::before
line-height: 32px
&.starts-with-emoji
padding: 0 18px
// .room-icon
Expand Down
11 changes: 9 additions & 2 deletions webapp/vue.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,15 @@ const NODE_PATH = process.env.NODE_PATH

module.exports = {
devServer: {
host: 'localhost',
port: 8880
host: '0.0.0.0',
port: 8880,
public: 'video-dev.eventyay.com',
allowedHosts: [
'.localhost',
'.eventyay.com',
'video-dev.eventyay.com',
'video.eventyay.com'
],
},
pwa: {
name: 'eventyay',
Expand Down

0 comments on commit 68b1813

Please sign in to comment.