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

add a flag to generate a network configuration with defaults #7

Closed
wants to merge 3 commits into from

Conversation

clems4ever
Copy link
Contributor

@clems4ever clems4ever commented Aug 4, 2023

Description

In order to generate a configuration for self-hosted setups we would need to use the any-sync-network CLI in a non interactive manner.

However the CLI is using the survey library for generating the configurations and this library does not support stdin as IO as described in
https://github.com/go-survey/survey#what-kinds-of-io-are-supported-by-survey.

This is a problem for automating the generation of a configuration for creating a docker based setup. We would rather avoid using static keys as in https://github.com/SamBouwer/any-docker because if by any bad luck the local setup is broken and starts to sync data on the public backup node instead of the local one, this could lead to serious troubles for the data, since the keys are public.

To avoid that situation, the cli should rather have a way to generate the configuration with default network values mainly for generating the security keys and leave it to the user to then further update the configurations as necessary. This only works for one node but in the case of self-hosted I think it is good enough for now.

Also, an alternative solution would have been to replace the survey library to use something able to read from stdin but this would be more intrusive and would have more potential for bugs after the change hence my proposal to introduce a simple --defaults flag to the command.

What type of PR is this? (check all applicable)

  • 🍕 Feature
  • 🐛 Bug Fix
  • 📝 Documentation Update
  • 🎨 Style
  • 🧑‍💻 Code Refactor
  • 🔥 Performance Improvements
  • ✅ Test
  • 🤖 Build
  • 🔁 CI

Related Tickets & Documents

NA

Mobile & Desktop Screenshots/Recordings

NA

Added tests?

  • 👍 yes
  • 🙅 no, because they aren't needed
  • 🙋 no, because I need help

Added to documentation?

  • 📜 README.md
  • 📓 tech-docs
  • 🙅 no documentation needed

@fuksman fuksman self-requested a review August 4, 2023 10:08
@clems4ever clems4ever force-pushed the default-network-conf branch from 875b751 to b92681e Compare August 5, 2023 15:56
the cli for generating network configurations is using the survey
library for generating the configurations. However, this library does
not support stdin as IO as described in
https://github.com/go-survey/survey#what-kinds-of-io-are-supported-by-survey.

This is a problem for automating the generation of configuration for
creating a docker based setup. We would rather not use static keys as
done in https://github.com/SamBouwer/any-docker because if by any bad
luck the local setup is broken and starts to sync data on the public
backup node instead of the local one, this could lead to serious
troubles for the data, since the keys are public.

To avoid that situation, the cli should rather have a way to generate
the configuration with default network values mainly for generating the
security keys and leave it to the user to then further update the
configurations as necessary. This only works for one node but in the
case of self-hosted I think it is good enough for now.

Also, an alternative solution would have been to replace the survey
library to use something able to read from stdin but this would be more
intrusive and would have more potential for bugs after the change hence
my proposal to introduce a simple --defaults flag to the command.
@clems4ever clems4ever force-pushed the default-network-conf branch from b92681e to ba6a187 Compare August 5, 2023 16:02
@mighty-sponge mighty-sponge requested a review from a team as a code owner November 5, 2024 07:54
@mighty-sponge mighty-sponge requested review from mighty-sponge and removed request for a team and fuksman November 5, 2024 19:11
@mighty-sponge
Copy link
Contributor

Starting with v2.0.0, added flag for non-interactive generation and template with default parameters

@github-actions github-actions bot locked and limited conversation to collaborators Nov 5, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants