diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index b700e5c3..e282b8b3 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -28,7 +28,7 @@ You can use [GitHub issue tracker](https://github.com/thecodingmachine/workadven - File bug reports - Ask for feature requests -If you have more general questions, a good place to ask is [our Discord server](https://discord.gg/YGtngdh9gt). +If you have more general questions, a good place to ask is [our Discord server](https://discord.gg/G6Xh9ZM9aR). Finally, you can come and talk to the WorkAdventure core team... on WorkAdventure, of course! [Our offices are here](https://play.staging.workadventu.re/@/tcm/workadventure/wa-village). @@ -41,7 +41,7 @@ Please ask first before embarking on any significant pull request (e.g. implemen otherwise you risk spending a lot of time working on something that the project's developers might not want to merge into the project. -You can ask us on [Discord](https://discord.gg/YGtngdh9gt) or in the [GitHub issues](https://github.com/thecodingmachine/workadventure/issues). +You can ask us on [Discord](https://discord.gg/G6Xh9ZM9aR) or in the [GitHub issues](https://github.com/thecodingmachine/workadventure/issues). ### Linting your code diff --git a/README.md b/README.md index 21871991..db4670b2 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,4 @@ -![](https://github.com/thecodingmachine/workadventure/workflows/Continuous%20Integration/badge.svg) [![Discord](https://img.shields.io/discord/821338762134290432?label=Discord)](https://discord.gg/YGtngdh9gt) +![](https://github.com/thecodingmachine/workadventure/workflows/Continuous%20Integration/badge.svg) [![Discord](https://img.shields.io/discord/821338762134290432?label=Discord)](https://discord.gg/G6Xh9ZM9aR) ![WorkAdventure logo](README-LOGO.svg) ![WorkAdventure office image](README-MAP.png) diff --git a/back/Dockerfile b/back/Dockerfile index a8ce3c1c..084ac52a 100644 --- a/back/Dockerfile +++ b/back/Dockerfile @@ -1,8 +1,10 @@ # protobuf build FROM node:14.18.2-buster-slim@sha256:20bedf0c09de887379e59a41c04284974f5fb529cf0e13aab613473ce298da3d as builder WORKDIR /usr/src +COPY messages/yarn.lock messages/package.json ./ +RUN yarn install COPY messages . -RUN yarn install && yarn proto +RUN yarn proto # typescript build FROM node:14.18.2-buster-slim@sha256:20bedf0c09de887379e59a41c04284974f5fb529cf0e13aab613473ce298da3d as builder2 @@ -18,9 +20,9 @@ RUN yarn run tsc FROM node:14.18.2-buster-slim@sha256:20bedf0c09de887379e59a41c04284974f5fb529cf0e13aab613473ce298da3d WORKDIR /usr/src COPY back/yarn.lock back/package.json ./ -COPY --from=builder2 /usr/src/dist /usr/src/dist ENV NODE_ENV=production RUN yarn install --production +COPY --from=builder2 /usr/src/dist /usr/src/dist USER node CMD ["yarn", "run", "runprod"] diff --git a/docker-compose.e2e.yml b/docker-compose.e2e.yml index 3330202a..52e312b5 100644 --- a/docker-compose.e2e.yml +++ b/docker-compose.e2e.yml @@ -9,10 +9,7 @@ services: build: context: ./ dockerfile: front/Dockerfile - environment: - STARTUP_COMMAND_1: 'envsubst < dist/env-config.template.js > dist/env-config.js' - STARTUP_COMMAND_2: '' - command: apache2-foreground + command: /bin/sh -c "/templater.sh && envsubst < /usr/share/nginx/html/env-config.template.js > /usr/share/nginx/html/env-config.js && exec nginx -g 'daemon off;'" volumes: [] labels: - "traefik.enable=true" @@ -29,9 +26,6 @@ services: build: context: ./ dockerfile: pusher/Dockerfile - environment: - STARTUP_COMMAND_1: '' - STARTUP_COMMAND_2: '' command: yarn run runprod volumes: [] @@ -40,8 +34,5 @@ services: build: context: ./ dockerfile: back/Dockerfile - environment: - STARTUP_COMMAND_1: '' - STARTUP_COMMAND_2: '' command: yarn run runprod volumes: [] diff --git a/docker-compose.single-domain.yaml b/docker-compose.single-domain.yaml index 1612e396..b9149ba0 100644 --- a/docker-compose.single-domain.yaml +++ b/docker-compose.single-domain.yaml @@ -76,6 +76,9 @@ services: OPID_CLIENT_ISSUER: $OPID_CLIENT_ISSUER OPID_CLIENT_REDIRECT_URL: $OPID_CLIENT_REDIRECT_URL OPID_PROFILE_SCREEN_PROVIDER: $OPID_PROFILE_SCREEN_PROVIDER + OPID_SCOPE: $OPID_SCOPE + OPID_USERNAME_CLAIM: $OPID_USERNAME_CLAIM + OPID_LOCALE_CLAIM: $OPID_LOCALE_CLAIM DISABLE_ANONYMOUS: $DISABLE_ANONYMOUS volumes: - ./pusher:/usr/src/app diff --git a/docker-compose.yaml b/docker-compose.yaml index 2bbc6c0a..3c16ce00 100644 --- a/docker-compose.yaml +++ b/docker-compose.yaml @@ -85,6 +85,9 @@ services: OPID_CLIENT_ISSUER: $OPID_CLIENT_ISSUER OPID_CLIENT_REDIRECT_URL: $OPID_CLIENT_REDIRECT_URL OPID_PROFILE_SCREEN_PROVIDER: $OPID_PROFILE_SCREEN_PROVIDER + OPID_SCOPE: $OPID_SCOPE + OPID_USERNAME_CLAIM: $OPID_USERNAME_CLAIM + OPID_LOCALE_CLAIM: $OPID_LOCALE_CLAIM DISABLE_ANONYMOUS: $DISABLE_ANONYMOUS volumes: - ./pusher:/usr/src/app diff --git a/docs/maps/meeting-rooms.md b/docs/maps/meeting-rooms.md index 88db1621..9c3963ed 100644 --- a/docs/maps/meeting-rooms.md +++ b/docs/maps/meeting-rooms.md @@ -9,9 +9,11 @@ On your map, you can define special zones (meeting rooms) that will trigger the In order to create Jitsi meet zones: -* You must create a specific layer. -* In layer properties, you MUST add a "`jitsiRoom`" property (of type "`string`"). The value of the property is the name of the room in Jitsi. Note: the name of the room will be "slugified" and prepended with the name of the instance of the map (so that different instances of the map have different rooms) -* You may also use "jitsiWidth" property (of type "number" between 0 and 100) to control the width of the iframe containing the meeting room. +* You must create a specific layer. +* In layer properties, you MUST add a "`jitsiRoom`" property (of type "`string`"). The value of the property is the name of the room in Jitsi. Note: the name of the room will be "slugified" and prepended with the name of the instance of the map (so that different instances of the map have different rooms) +* You may also use "jitsiWidth" property (of type "number" between 0 and 100) to control the width of the iframe containing the meeting room. + +You can have this layer (i.e. your meeting area) to be selectable as the precise location for your meeting using the [Google Calendar integration for Work Adventure](/integrations/google-calendar). To do so, you must set the `meetingRoomLabel` property. You can provide any name that you would like your meeting room to have (as a string). ## Triggering of the "Jitsi meet" action diff --git a/front/Dockerfile b/front/Dockerfile index 7db1e02d..bc437e64 100644 --- a/front/Dockerfile +++ b/front/Dockerfile @@ -1,31 +1,28 @@ +# protobuf build FROM node:14.18.2-buster-slim@sha256:20bedf0c09de887379e59a41c04284974f5fb529cf0e13aab613473ce298da3d as builder - -WORKDIR /usr/src/messages +WORKDIR /usr/src +COPY messages/yarn.lock messages/package.json ./ +RUN yarn install COPY messages . -RUN yarn install && yarn ts-proto +RUN yarn ts-proto -WORKDIR /usr/src/front +# typescript build +FROM node:14.18.2-buster-slim@sha256:20bedf0c09de887379e59a41c04284974f5fb529cf0e13aab613473ce298da3d as builder2 +WORKDIR /usr/src +COPY front/yarn.lock front/package.json ./ +RUN yarn install COPY front . - -# move messages to front -RUN cp -r ../messages/ts-proto-generated/protos/* src/Messages/ts-proto-generated +COPY --from=builder /usr/src/ts-proto-generated/protos src/Messages/ts-proto-generated RUN sed -i 's/import { Observable } from "rxjs";/import type { Observable } from "rxjs";/g' src/Messages/ts-proto-generated/messages.ts -RUN cp -r ../messages/JsonMessages/* src/Messages/JsonMessages +COPY --from=builder /usr/src/JsonMessages src/Messages/JsonMessages +RUN yarn run typesafe-i18n && yarn run build-iframe-api && yarn build -RUN yarn install && yarn run typesafe-i18n && yarn run build-iframe-api && yarn build +# final production image +FROM nginx:1.21.6-alpine -FROM thecodingmachine/nodejs:14-apache +COPY front/nginx.conf /etc/nginx/conf.d/default.conf +COPY front/templater.sh / +COPY --from=builder2 /usr/src/dist /usr/share/nginx/html -COPY --from=builder --chown=docker:docker /usr/src/front/dist dist -COPY front/templater.sh . - -USER root -RUN DEBIAN_FRONTEND=noninteractive apt-get update \ - && apt-get install -y \ - gettext-base \ - && rm -rf /var/lib/apt/lists/* -USER docker - -ENV STARTUP_COMMAND_0="./templater.sh" -ENV STARTUP_COMMAND_1="envsubst < dist/env-config.template.js > dist/env-config.js" -ENV APACHE_DOCUMENT_ROOT=dist/ +EXPOSE 80 +CMD ["/bin/sh", "-c", "/templater.sh && envsubst < /usr/share/nginx/html/env-config.template.js > /usr/share/nginx/html/env-config.js && exec nginx -g 'daemon off;'"] diff --git a/front/nginx.conf b/front/nginx.conf new file mode 100644 index 00000000..9521137c --- /dev/null +++ b/front/nginx.conf @@ -0,0 +1,51 @@ +server { + listen 80; + listen [::]:80; + server_name localhost; + access_log off; + + gzip on; + gzip_comp_level 6; + gzip_min_length 1000; + gzip_proxied any; + gzip_disable "msie6"; + gzip_types + application/atom+xml + application/geo+json + application/javascript + application/x-javascript + application/json + application/ld+json + application/manifest+json + application/rdf+xml + application/rss+xml + application/xhtml+xml + application/xml + font/eot + font/otf + font/ttf + image/svg+xml + text/css + text/javascript + text/plain + text/xml; + + # serve static assets (that have a cache busting hash) with an efficient cache policy + location /assets { + root /usr/share/nginx/html; + expires 1y; + add_header Cache-Control "public"; + } + + location / { + root /usr/share/nginx/html; + index index.html; + rewrite ^/register/ /index.html break; + rewrite ^/login /index.html break; + rewrite ^/jwt /index.html break; + } + + location ~ ^/[@_]/ { + try_files $uri $uri/ /index.html; + } +} diff --git a/front/public/resources/logos/jitsi.png b/front/public/resources/logos/jitsi.png new file mode 100644 index 00000000..65c3ebf2 Binary files /dev/null and b/front/public/resources/logos/jitsi.png differ diff --git a/front/public/resources/logos/meet.svg b/front/public/resources/logos/meet.svg deleted file mode 100644 index 787134e1..00000000 --- a/front/public/resources/logos/meet.svg +++ /dev/null @@ -1,49 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/front/src/Components/EmbedScreens/CoWebsiteThumbnailSlot.svelte b/front/src/Components/EmbedScreens/CoWebsiteThumbnailSlot.svelte index cf938ad1..146b3100 100644 --- a/front/src/Components/EmbedScreens/CoWebsiteThumbnailSlot.svelte +++ b/front/src/Components/EmbedScreens/CoWebsiteThumbnailSlot.svelte @@ -21,7 +21,7 @@ onMount(() => { icon.src = isJitsi - ? "/resources/logos/meet.svg" + ? "/resources/logos/jitsi.png" : `${ICON_URL}/icon?url=${coWebsite.getUrl().hostname}&size=64..96..256&fallback_icon_color=14304c`; icon.alt = coWebsite.getUrl().hostname; icon.onload = () => { @@ -188,10 +188,16 @@ /> + + +
+

Open / Close Jitsi meeting!

+
diff --git a/front/src/Components/EmbedScreens/CoWebsitesContainer.svelte b/front/src/Components/EmbedScreens/CoWebsitesContainer.svelte index ad0fcd44..75db5436 100644 --- a/front/src/Components/EmbedScreens/CoWebsitesContainer.svelte +++ b/front/src/Components/EmbedScreens/CoWebsitesContainer.svelte @@ -24,6 +24,7 @@ left: 2%; overflow-x: auto; overflow-y: hidden; + overflow: visible; &.vertical { height: auto !important; @@ -31,8 +32,6 @@ bottom: auto !important; left: auto !important; position: relative; - overflow-x: hidden; - overflow-y: auto; flex-direction: column; align-items: center; padding-top: 4px; diff --git a/front/src/Components/Menu/MenuIcon.svelte b/front/src/Components/Menu/MenuIcon.svelte index 5f017aaa..4184a008 100644 --- a/front/src/Components/Menu/MenuIcon.svelte +++ b/front/src/Components/Menu/MenuIcon.svelte @@ -61,15 +61,15 @@ on:dragstart|preventDefault={noDrag} on:click|preventDefault={showMenu} /> - {$LL.menu.icon.open.chat()} {/if} + {$LL.menu.icon.open.chat()}