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

Relay - auto add subnode/collection from configuration? #15

Open
1 task done
beforan opened this issue Jan 28, 2025 · 1 comment
Open
1 task done

Relay - auto add subnode/collection from configuration? #15

beforan opened this issue Jan 28, 2025 · 1 comment

Comments

@beforan
Copy link
Member

beforan commented Jan 28, 2025

Is there an existing issue for this?

  • I have searched the existing issues

Is your proposal related to a problem or functionality gap?

So I'm not sure if this is a great idea or not, but it could simplify setup for development and cases where Relay is used as a direct proxy (1 Relay -> 1 Bunny) at a minimum

While the CLI is a fine management interface for Relay configuration, it can be frustrating a) when running Relay in docker and b) when ytou just want to quickly setup Relay with a single Bunny (e.g. for development or testing)

It also should be quick to develop (famous last words)

Describe your proposal

I propose the addition of environment variables / configuration values for ensuring a subnode is present on app startup.

e.g.

EnsureSubNode:
  User: my-bunny
  Password: fdsaf2432frf
  CollectionId: my-collection # or a UUID maybe

Then when Relay is run, if these configuration values are present, it would check that this user existed.

If it doesn't exist, it will create it with the provided password. and create the associated subnode with the provided collection id.

If it already exists:

Well, here are some questions:

  • Does it leave everything alone?
  • Does it ensure the subnode with that collection id also exists?
    • this could result in multiple subnodes undesirably, forcing the user to delete them via the CLI or database directly.
    • Unless it ensures ONLY that subnode exists for that user? A truly declarative "desired state" configuration?
  • Does it set the password to the value provided?
  • Does it (again in a "desired state" fashion) remove entries from the db if not in the config? That could be its own config value tbh

Maybe we could use arrays again to be fully declarative and support multiples users with multiple collecitons via this approach.

Then you'd have the option of either declarative (via config) or imperative (via CLI) setup.

Potential problems

  • Sorting out the design questions above
  • Could be confusing if there are two ways to do the setup - especially as mixing and matching declarative vs imperative would be a bad ide; changes made via CLI could be undone or reset by the config when the app is restarted if not careful.
    • Maybe this is just a docs or training issue though: only use one or the other

Describe alternatives you've considered

  • just use the CLI
  • add a GUI

I'm part of a Project Team

UoN Health Informatics

Anything else?

No response

Are you willing to contribute to developing this feature?

✅ Yes, me or my team intend to do the development.

@beforan beforan added 🚦 triage This newly added item needs triaging and removed 🚦 triage This newly added item needs triaging labels Jan 28, 2025
@AndyRae AndyRae removed the 🚦 triage This newly added item needs triaging label Feb 3, 2025
@AndyRae
Copy link
Member

AndyRae commented Feb 3, 2025

Sometimes with Helm charts, its nice to allow the user to set this up through config through a Kubernetes secret.

Feels like this would be useful then!

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

No branches or pull requests

2 participants