Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support for Scalelite Tagged Servers #5790

Open
wants to merge 20 commits into
base: master
Choose a base branch
from

Conversation

Ithanil
Copy link
Contributor

@Ithanil Ithanil commented Apr 26, 2024

This PR adds frontend support for "Tagged Servers" in Scalelite, a feature which is described here: blindsidenetworks/scalelite#1049

Description

This PR allows user to configure two new options for each room:

  1. The server tags from a pre-defined list
  2. Whether the the server tag is hard required or fallback is allowed when no server is available

In terms of UI, it presents itself as seen in the following screenshots:
Screenshot from 2024-04-29 15-48-45
Screenshot from 2024-04-29 15-48-56

The list of available options is defined by the Greenlight administrator and certain tags can be restricted to certain role ids. In the current iteration of this feature, this is done via .env config file and is documented in sample.env:

## Support for Tagged Servers
# If your Greenlight instance is connected to Scalelite or another Loadbalancer with enabled support for the 'meta_server-tag'
# parameter on create calls, you can use the following variables to configure support for this feature via the Greenlight UI.
# Example (delimiters are , : and /):
# DEFAULT_TAG_NAME=Standard # friendly name for the untagged/default servers
# SERVER_TAG_NAMES=tag1:Name 1,tag2:Name2  # defines available tags and their friendly names
# SERVER_TAG_ROLES=tag2:xyz-123-321-aaaa-zyx/abc-321-123-zzzz-cba  # allow tag only for given role ids (see role ids in DB)

The required database migration is included and well tested. No RSpec tests have been added, but the feature is tested in deployment for multiple rooms, configuration combinations etc.

Notes

  • Currently, if a room has been configured with a tag and then later the tag is removed from the site-wide configuration or permission is revoked for the user's role, the room's configured tag will remain in the database and will still be used for create calls. However, the configuration field will show as empty in the UI and only allow changes to valid/allowed tags. Solved by commit 29c0c49
  • Currently, the role-based restriction of tags is only done by sending a list of allowed tags to the JavaScript code and not again validated on the backend side. This seems OK as long as the impact of potential malicious users abusing known "VIP" tags is tolerable.
  • The two server tag options have already been added as global room configuration options (for consistency and for not requiring any future migrations), but are neither available for configuration in the admin UI nor does their value override the individual room's configuration.

What is "missing" / Future Development

  • Add a sync task for the administrator to remove invalid tags from rooms after configuration file change Done (29c0c49)
  • Validate role-based tag restriction on backend side (I could use a hint on how and at which point this should be done ideally, would also be happy if someone else could contribute this)
  • Make the global server tag options configurable, via the global room setting UI, and make their values actually work as overrides. (I'm not going to contribute this)
  • Translate the current file/env-based configuration to UI-based configuration in the site and role setting menus. (I'm not going to contribute this)

@Ithanil Ithanil force-pushed the tagged_servers branch 3 times, most recently from ac857ee to beedc4b Compare April 29, 2024 10:54
@Ithanil Ithanil marked this pull request as ready for review April 29, 2024 12:21
@Ithanil Ithanil changed the title Support for Scalelite Tagged Servers [WIP] Support for Scalelite Tagged Servers Apr 29, 2024
@Ithanil Ithanil force-pushed the tagged_servers branch 3 times, most recently from 1ab2201 to 29c0c49 Compare May 6, 2024 15:37
Ithanil added 20 commits June 5, 2024 08:06
…s from the database (after changing the config)
Copy link

sonarcloud bot commented Jun 5, 2024

Quality Gate Passed Quality Gate passed

Issues
0 New issues
0 Accepted issues

Measures
0 Security Hotspots
No data about Coverage
0.0% Duplication on New Code

See analysis details on SonarCloud

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant