Commit Graph

1365 Commits

Author SHA1 Message Date
lebaudantoine
88a5717022 ♻️(backend) simplify queryset while listing rooms
Recent refactoring simplified the DB models.
Thus, filtering rooms is now way simpler,
I updated the subsequent queryset.
2024-07-22 14:15:49 +02:00
lebaudantoine
e17d42ebe3 🔥(backend) remove todo items
The Pylint job was failing due to those TODO items. In our make lint
command sequence, Pylint runs first. If it fails, Ruff won't run,
which is quite inconvenient.

I've extracted those TODOs into an issue for further review.
2024-07-22 14:15:49 +02:00
lebaudantoine
ae95a00301 (backend) add 'username' query param when retrieving a room
Quick and dirty approach. It works, that's essential.
Frontend can pass a desired username for the user. This would
be the name displayed in the room to other participants.
Usernames don't need to be unique, but user identities do

If no username is passed, API will fall back to a default username.
Why? This serves as a security mechanism. If the API is called
incorrectly by a client, it maintains the previous behavior.
2024-07-22 14:15:49 +02:00
Emmanuel Pelletier
faff1c1228 ♻️(frontend) make the Conference component not know about routing
Makes more sense that way: only the Room _route_ knows about route
params, not the internal component used.
2024-07-21 17:42:53 +02:00
Emmanuel Pelletier
e04b8d081f 🐛(frontend) have a suspense fallback
the app crashed on screen changes, I don't quite get why right now… but
at least this goes around the issue…
2024-07-21 17:39:08 +02:00
Emmanuel Pelletier
efb5ac5834 🌐(frontend) sort extrated locales to help prevent conflicts
when adding keys by hand, we didn't really know where to add them so
that the i18n:extract command would not move them afterwards. Feels like
this will help.
I guess a CI thing checking if the locales file dont change after a push
would be helpful
2024-07-21 17:26:26 +02:00
Emmanuel Pelletier
0cf4960969 ♻️(rooms) room id gen: write more es6-like code
- this feels a bit less boilerplaty to read
- puting the characters whitelist outside the function to prevent
creating the var each time (yes, this of super great importance)
2024-07-21 17:18:29 +02:00
Emmanuel Pelletier
f11bcea3a2 🔒️(frontend) valide ':roomId' path using a regex
Enhanced security by ensuring users are redirected to a 404 error page
if they
pass an incorrect roomId path, either intentionally or unintentionally.
This is
a critical security mechanism that should be included in our MVP.

Let's discuss extracting hardcoded elements, such as lengths or
the separator, into proper constants to improve code maintainability.
I was concerned that this might make the code harder to read, it could
enhance
clarity and reusability in the long term.

I prefer exposing the roomIdRegex from the same location where we
generate IDs.
However, this increases the responsibility of that file. Lmk if you have
any
suggestion for a better organization.

Additionally, the current 404 error page displays a 'Page not found'
message for
invalid room IDs. Should we update this message to 'Invalid room name'
to
provide more context to the user?
2024-07-21 17:18:29 +02:00
lebaudantoine
d8c8ac0811 🚸(frontend) generate shorter room IDs making URLs easier to share
UUID-v4 room IDs are long and uninviting. Shorter, custom room IDs
can enhance UX by making URLs easier to share and remember.

While UUID-v4s are typically used in database systems for their low
collision probability, for ephemeral room IDs, the collision risk of e+14
combinations is acceptable.

This aligns room IDs with Google Meet format.

Even if the 'slugify' function is not used anymore, I kept it.
Lmk if you prefer removing it @manuhabitela
2024-07-21 17:18:29 +02:00
Emmanuel Pelletier
9fd1af2302 💄(keyboard) better handling of focus ring
some focus rings were shown even when we only used the mouse. this
globally fixes that
2024-07-21 16:48:27 +02:00
Emmanuel Pelletier
e6c292ecd7 🌐(frontend) add a language selector in the header
this will be better in an options page later i think, as we don't pass
our life changing language and we already have a language detector at
load.

this adds a PopoverList primitive to easily create buttons triggering
popovers containing list of actionable items.
2024-07-21 16:48:27 +02:00
Emmanuel Pelletier
d6b5e9a50c (frontend) add a Popover primitive
easily use buttons toggling styled RAC popovers
2024-07-21 16:48:27 +02:00
Emmanuel Pelletier
789bce5092 ♻️(frontend) put homepage in its own feature
makes more sense i guess, maybe
2024-07-20 20:23:57 +02:00
Emmanuel Pelletier
f888fc1717 🌐(crowdin) make crowdin work with frontend translations
- upload local translation files on push
- make crowdin create a pull request when new translations are made
through the crowdin website (webhook configured on crowdin-end)
2024-07-20 20:23:57 +02:00
Emmanuel Pelletier
d2dba511e2 🌐(frontend) init i18next
- dynamically load locale files for smaller footprint
- have a namespace for each feature. At first I'd figured I'd put each
namespace in its correct feature folder but it's kinda cumbersome to
manage if we want to link that to i18n management services like crowdin…
2024-07-20 20:23:57 +02:00
Jacques ROUSSEL
7510d0fc2b 🔧(helm) configuration
Change configuration to use livekit-preprod.beta.numerique.gouv.fr
instead of the docker test vm
2024-07-19 15:35:55 +02:00
Jacques ROUSSEL
f50426b11a 🔧(helm) fix helm chart
Fix helm secret to be abble to use titl on dev
2024-07-18 16:11:56 +02:00
lebaudantoine
6e20d5385f ♻️(frontend) introduce a logoutUrl function
Wrap the logout URL in a function for consistency with '/authenticate'.
2024-07-17 16:51:24 +02:00
lebaudantoine
1c046abf5f ✏️(frontend) minor typo detected on webstorm
No big deal, just a little nit-pick. Nothing personal!
My IDE is THE nit-picker.
2024-07-17 16:51:24 +02:00
lebaudantoine
3718851435 ♻️(frontend) refactor hardcoded '/authenticate' API calls
Use the function introduce by @manuhabitela, authUrl.
It reduces code duplication.
2024-07-17 16:51:24 +02:00
Jacques ROUSSEL
c390499394 🔧(helm) fix helm chart
Add md5sum on secret in order to automatically deploy new pods when
secret change
2024-07-17 15:50:18 +02:00
lebaudantoine
1134909774 🔖(frontend) align frontend version to v0.1.0
Align frontend version with other project's parts (e.g. backend, mail, etc.)
2024-07-16 21:48:20 +02:00
lebaudantoine
6d16bb3403 🗃️(backend) squash migrations before going to production
While refactoring 'Impress' to introduce features from 'Magnify',
few unnecessary changes were traced in the database migrations.
Do some clean up before releasing a first version in production.
2024-07-16 21:47:40 +02:00
lebaudantoine
da6c5746d5 🔧(livekit) use server instance deployed on a VM
Deploying LiveKit on Kubernetes is quite challenging when using a private cloud provider.
@rouja faced some issues while configuring the exposed port necessary for the
STUN and TURN servers to work when the user is connected to a network behind a firewall.

@rouja deployed quickly a temporary LiveKit instance on a VM with its own STUN and
TURN servers to avoid using the Google infrastructure.
2024-07-16 21:47:40 +02:00
Emmanuel Pelletier
31ea621e44 ♻️(frontend) reorganize starting frontend code
- we now have "features" to try to organize code by intent instead of
code type. everything at the root of frontend, not in feature/, is
global
- customized the panda config a bunch to try to begin to have an actual
design system. The idea is to prevent using arbitrary values here and
there in the code, but rather semantic tokens
- changed the userAuth code logic to handle the fact that a 401 on the
users/me call is not really an error per say, but rather an indication
the user is not logged in
2024-07-16 15:29:36 +02:00
antoine lebaud
0a9e077f04 ️(frontend) add caching headers for static assets in Nginx config
Configured Nginx to set caching headers for static assets by adding
a location block to match common static file extensions and set
an expiration time of 30 days.

It should result in faster loading times, reduced bandwidth usage,
and a more efficient and responsive user experience.

Wdyt @manuhabitela?
2024-07-15 17:56:03 +02:00
antoine lebaud
eac107aac6 🐛(frontend) fix Nginx configuration for SPA routing with Vite
Configured Nginx to serve index.html for all requests, allowing
the client-side router (Wouter) to manage the routing.

Added a try_files directive to attempt to serve static files first,
falling back to index.html if the requested file is not found.

Added an error_page directive to handle 404 errors by internally
redirecting to index.html without modifying the URL path.

Wouter should make the rest.
2024-07-15 17:56:03 +02:00
Jacques ROUSSEL
6e3bf3b5f4 🔧(helm) upgrade sops secrets
Add manuu key
2024-07-12 10:49:30 +02:00
antoine lebaud
d9166e489d 🗑️(backend) remove useless cold storage config
No S3 bucket or cold storage are required yet in the project.
As the charts related to these pieces were removed, clean
Dajngo configuration.
2024-07-10 23:33:05 +02:00
antoine lebaud
d9bcbcd002 🔧(helm) set IndieHoster LiveKit server URL for remote environments
Based on @rouja recommendations, use IndieHoster LiveKit instances for
our preliminary tests.

Several issues are already known on this instance.
2024-07-10 23:33:05 +02:00
antoine lebaud
937c4c4b2f 🔧(frontend) pass dynamically the LiveKit url
It seems appropriate that backend owns the responsability of knowing any
information/configurations of the LiveKit server. Then, it shares those
with the frontend.

Please see my previous commit to understand why environment variables are
not appropriate for deployment in several remove environments.

As of today, the LiveKit server URL is the only configuration exposed
dynamically to the frontend. Thus, it doesn't justify adding a new route
to the API, responsible for exposing configurations (e.g. /configuration).

As the frontend needs to call the backend when it wants to initiate a new
webconference room, let's pass the server URL when retrieving the room's token.
It is relevant, to get both the room location and the keys to open the room in
the same call.

I prefered to be pragmatic, if the need appears any soon, I would refactor
these parts.
2024-07-10 23:33:05 +02:00
antoine lebaud
a480c50221 🔧(frontend) refactor API URl to work for remote environments
Discussed IRL with @manuhabitela. In developpement, we build locally the
Docker image. Thus, we can pass values to the frontend before the npm build
command was called.

Environment variables are great for configuration, and work perfectly in dev
mode, building Docker image on the fly.

However, in other environment (e.g. staging, pre-prod, prod) we'll pull a common
Docker image published in a remote registry. All cited environments should use
the same Docker image to make tests/deployment reproducible between envs.

As the Docker image is not rebuilt on the fly, we cannot easily configure
customized environment variables for each environment.

The API base URL would have a different value for each environment, and would
require a different environment variable.

Inspired by Impress works, if no environment variable is passed for the API URL,
the window origin will be used, and then the API path will be appended.

Frontend and backend are always deployed on the same URL, usually frontend
is at the '/' route, and backend at the '/api/vXX/' route.

If any configuration are required for each remote environment, they would be
retrieved from the API at runtime.

Voila! Don't hesitate to challenge this commit.
2024-07-10 23:33:05 +02:00
antoine lebaud
076107dd87 🚨(frontend) ignore styled-system source while linting
@manuhabitela configured panda css to manage project styling.
Panda codegen generates a new folder, 'styled-system' which was not
ingored by Eslint, resulting in ~40 Eslint errors.

Adapted Eslint configurations to ignore this path.
2024-07-10 23:33:05 +02:00
antoine lebaud
d7b87ef6c1 🔧(helm) read LiveKit-related secrets for remote environments
Values for staging, pre-prod, prod environments were adapted to read
the newly introduced LiveKit secrets.

The extra/template/secrets.yaml should be moved to a proper location.
2024-07-10 23:33:05 +02:00
Jacques ROUSSEL
d93e262069 🔐(helm) update secrets
Made by @rouja. Structure is inspired from Impress, values are adapted
to Meet.
2024-07-10 23:33:05 +02:00
antoine lebaud
84792a7b81 🎨(backend) remove duplicated line of configuration
Uncommenting the line left the original commented line in place,
which was misleading because the comment indicated to comment
the next line, which was already commented.

Fixed!
2024-07-10 23:33:05 +02:00
antoine lebaud
4fe3333eea 🚚(helm) update values for remote environments
I have updated the staging, pre-prod and production environments.

Done:
- Remove silenced security checks, as SECURE_PROXY_SSL_HEADER is set in prod.
- Rename "impress" to "meet"
- Rename "docs" to "meet"
- Remove unused values (webrtc, ingressWS)

I haven't yet received the definitive DNS configuration from Florian or Olivier.
The hosts meet.numerique.gouv.fr and all meet-*.beta.numerique.gouv.fr are
only hypothetical at this point.
2024-07-10 23:33:05 +02:00
Emmanuel Pelletier
bb6f111381 📌(frontend) pin wouter dep that was forgotten
following this project's choice of pinning everything,
missed this one
2024-07-03 11:16:00 +02:00
Emmanuel Pelletier
33dbaedf2f 💚(frontend) do not run panda codegen on npm install/npm ci
panda needs to generate types to work. We used to generate those after
deps install but it's not that necessary, since we generate them before
running the dev env, and before building the prod build.

This fixes the `npm ci` error in the frontend docker build
2024-07-03 11:10:16 +02:00
Emmanuel Pelletier
e3eb3e240a ♻️(frontend) starting a bit more structured frontend app
the idea is to use react aria, panda-css, react query and wouter as a
base, in addition to livekit react components

this is still mostly wip but it's usable:

- homepage shows a login link to create a room
- before joining a room you are asked to configure your audio/video/user
name
- note that if you directly go to a a conference url it creates it even
if you are not logged in… very secured!
2024-07-02 20:31:42 +02:00
antoine lebaud
af3ab37b53 🔧(helm) adapt helm chart
Done:
- Rename all occurrences of "impress" to "meet".
- Update Agent Connect secrets credentials for the dev environment.
- Add new development secrets for LiveKit.
- Remove Minio from the dev stack (no cold storage required).
- Add LiveKit chart to the stack.
- Remove templates and values related to the WebSocket server.

The integration of LiveKit was inspired by an example from the "numerique-gouve/infrastructure" repo.
However, a notable issue persists with LiveKit's default chart: we are unable to override
the namespace, resulting in all LiveKit components running in the default namespace.

thx to @rouja for his help.
2024-07-02 19:36:09 +02:00
antoine lebaud
5efbafa436 🎨(frontend) reorganize package.json dependencies
Sort the frontend dependencies, to avoid any undesired diff while
running npm install.
2024-07-02 17:09:43 +02:00
antoine lebaud
35ebc5a608 🔧(frontend) pass host and port through environment vars
Configured the frontend to use environment variables (prefixed with "VITE_") for frontend
port and host configuration, which will be overridden in the Helm chart values
to ensure correct values are used in different environments.

Helm requires the frontend port to be 8081 and use the public host,
not the default "localhost" value.
2024-07-02 17:07:17 +02:00
antoine lebaud
f85a1efa29 🔧(frontend) pass API and LiveKit server URLs through environment vars
Configured the frontend to use environment variables (prefixed with "VITE_") for API
and LiveKit server URLs, which will be overridden in the Helm chart values
to ensure correct URLs are used in different environments.
2024-07-02 16:22:36 +02:00
antoine lebaud
f051938ace (frontend) introduce frontend Docker image
Inspired by the Docker images from numerique-gouv/people and numerique-gouv/impress
(see commit 1a3b396 in the "people" repository).

Due to the lack of a certified cold storage solution (e.g., S3) for serving static files,
we've containerized the frontend as a temporary deployment solution.

Vite.js static output is served using an Nginx reverse proxy.

I am not quite sure of this commit, please @manuhabitela could you review how I exposed
the static build from vite in my Nginx server? and do the appriopriate fix if necessary.
2024-07-01 20:35:47 +02:00
antoine lebaud
847ad709c5 🚨(frontend) fix TypeScript errors to enable successful build
Resolved minor TypeScript errors in the Proof of Concept (PoC)
that were causing the "npm run build" command to fail.

These fixes were necessary to prepare the frontend for
containerization with Docker.

ASAP, a CI step will prevent these kind of errors.
2024-07-01 20:34:08 +02:00
lebaudantoine
03c6a6734e 🚚(tsclient) rename Impress to Meet
I have updated all references of "Impress" to "Meet" in the tsclient.
Also, I forgot to rename the repository link in the mail package.json,
my bad, it's fixed.
2024-07-01 20:34:08 +02:00
lebaudantoine
890a58b133 🚚(DockerHub) rename DockerHub images
I have created two new repositories on DockerHub, one for the currently
existing backend image, and one for the future frontend image.

I searched-replaced all occurences of "lasuite/impress-frontend" or "lasuite/impress-backend".

One image won't exist anymore, "impress-y-webrtc-signaling", I have
removed the steps building and pushing its image to the DockerHub account.
2024-07-01 19:46:55 +02:00
lebaudantoine
64efcc1623 🚚(backend) rename Impress to Meet
I have updated all references of "Impress" to "Meet".
Migrations were manually updated and not regenerated. Never-mind,
they all will be squashed before the first release.

I have also searched for reference to "Magnify", and replaced them
by "Meet".

While updating the backend sources, I have also fixed other parts of
the project, namely:
- Compose file
- Github documentation and CI
- Makefile commands
2024-07-01 19:46:55 +02:00
lebaudantoine
78e6f26383 📝(backend) update pyproject URLs to meet repository
I have renamed the Github project's name, from "Impress" to "Meet".
Updated the pyproject urls section, which provides essential metadata
about the project. This updates ensure all links point to the right
github repository.
2024-07-01 19:46:55 +02:00