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

package defaults with gen-config -p #579

Closed
wants to merge 6 commits into from
Closed

package defaults with gen-config -p #579

wants to merge 6 commits into from

Conversation

0pcom
Copy link
Collaborator

@0pcom 0pcom commented Oct 26, 2020

Did you run make format && make check?
yes

Fixes #
#572

Changes:

  • add -p flag to config generation commands which generates correct default values for skybian and package-based installations.

How to test this PR:

recompile the binaries

./hypervisor gen-config -p
./skywire-cli visor gen-config -p

Notes:

I did not make extensive efforts to integrate it with the existing logic of the other flags, nor did I test combinations of these flags. It solves my immediate issue and can be improved upon in the future.

I request that this PR be revewed / approved as soon as possible as I wish to update to the VPN-containing version but as stated in #564 when I tested this on my machine, the visor failed to start after the update because of issues with the config. I have not tested or attempted to reproduce #564 on arm64, and no other user has complained of this to my knowledge, so perhaps it is some anomaly to do with the architecture or specifically that binary. I don't know.

However, I can say that the content of this pull request is critical for reliably automating configuration at the point of installation, eliminating the need for manual revision of the config file.

@CLAassistant
Copy link

CLAassistant commented Oct 28, 2020

CLA assistant check
All committers have signed the CLA.

Copy link
Member

@jdknives jdknives left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@0pcom thanks for this PR. Generally this is a good idea and we will go with it. We will use the -p flag to generate configs for package installations. Two points:

  1. We will only release official packages with the next release. Therefore, this should target develop instead of master. The config will change on that release (you can check the changes by testing develop) a bit. We got rid of the hypervisor binary and instead a visor can now expose the UI if config was generated with --hypervisor flag. That necessitates some changes to this PR.

  2. We have discussed with Synth to put package based installations to $HOME/skywire long term as it does not require root access. Change installation directory  #581
    In anticipation of that change, you can probably already change your PR here.

@@ -17,21 +17,24 @@ import (
var (
output string
replace bool
package1 bool
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could you please rename it to something like packageConfig?

@@ -68,6 +71,9 @@ var genConfigCmd = &cobra.Command{
log.Fatalln("Error retaining old keys", err)
}
}
if package1 {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What do you think of moving this condition before the switch statement and having switch inside an else?

sk cipher.SecKey
output string
replace bool
package1 bool
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could you please rename it to something like packageConfig?

@0pcom
Copy link
Collaborator Author

0pcom commented Oct 29, 2020

@0pcom thanks for this PR. Generally this is a good idea and we will go with it. We will use the -p flag to generate configs for package installations. Two points:

  1. We will only release official packages with the next release. Therefore, this should target develop instead of master. The config will change on that release (you can check the changes by testing develop) a bit. We got rid of the hypervisor binary and instead a visor can now expose the UI if config was generated with --hypervisor flag. That necessitates some changes to this PR.
  2. We have discussed with Synth to put package based installations to $HOME/skywire long term as it does not require root access. Change installation directory  #581
    In anticipation of that change, you can probably already change your PR here.

I suppose I should retarget this PR at develop but I am unfamiliar with how to do that at this stage without filing a new PR. Additionally it would appear that this would require some revision to work with the new setup that you have described. I will take your advice on where to go from here.

On the installation path, it would be OK to use the $HOME/skywire path except that by default the service is running as root. These paths should be created at /root/skywire by default when the config generation is preformed as root.

Is it possible at this stage to run skywire as an unprivlaged user? The last time I tried to I recall there was some issue.

@nkryuchkov i will be able to preform the requested changes tonight. Per the switch / else; I have no opposition but I will have to figure out how to implement that.

@jdknives jdknives changed the base branch from master to develop October 29, 2020 10:33
@jdknives
Copy link
Member

@0pcom I just redirected the PR at develop. The merge conflicts that popped up need to be fixed. If you have not worked before with go, we can tackle the content of the PR ourselves.

@0pcom
Copy link
Collaborator Author

0pcom commented Nov 3, 2020

re-pening from a different branch

@0pcom 0pcom closed this Nov 3, 2020
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.

4 participants