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

feat: allow the selection of a release version with installer #262

Merged
merged 1 commit into from Jul 20, 2023

Conversation

XavierChanth
Copy link
Member

@XavierChanth XavierChanth commented Jul 20, 2023

- What I did

Added a --version flag and the string validation necessary in order to select a particular release when installing.

- How I did it

- How to verify it
See my comment below which provides the output of me switching versions.

- Description for the changelog
feat: allow the selection of a release version with installer

@XavierChanth
Copy link
Member Author

sshnoports on  install-version [$+] took 10s 
➜ ./packages/sshnoports/scripts/install_sshnp -c xavierchanth -d xchan -h am -v 3.3.0

Downloading sshnp from https://github.com/atsign-foundation/sshnoports/releases/download/v3.3.0/sshnp-macos-arm64.zip
Installed binaries: sshnp at_activate sshrv
/Users/chant/.ssh/sshnp@xchan already exists.
Overwrite (y/n)? y
Installing sshnp@xchan to /Users/chant/.local/bin/sshnp@xchan


Installation complete!

sshnoports on  install-version [$+] took 5s 
➜ sshnp
Version : 3.3.0
-k, --key-file             Sending atSign's atKeys file if not in ~/.atsign/keys/
-f, --from (mandatory)     Sending atSign
-t, --to (mandatory)       Send a notification to this atSign
-d, --device               Send a notification to this device
                           (defaults to "default")
-h, --host (mandatory)     atSign of sshrvd daemon or FQDN/IP address to connect back to 
-p, --port                 TCP port to connect back to (only required if --host specified a FQDN/IP)
                           (defaults to "22")
-l, --local-port           Reverse ssh port to listen on, on your local machine, by sshnp default finds a spare port
                           (defaults to "0")
-s, --ssh-public-key       Public key file from ~/.ssh to be appended to authorized_hosts on the remote device
                           (defaults to "false")
-o, --local-ssh-options    Add these commands to the local ssh command
-v, --[no-]verbose         More logging
-r, --[no-]rsa             Use RSA 4096 keys rather than the default ED25519 keys
Invalid argument(s): Option from is mandatory.

sshnoports on  install-version [$+] 
➜ ./packages/sshnoports/scripts/install_sshnp -c xavierchanth -d xchan -h am -v 3.2.0

Downloading sshnp from https://github.com/atsign-foundation/sshnoports/releases/download/v3.2.0/sshnp-macos-arm64.zip
Installed binaries: sshnp at_activate sshrv
/Users/chant/.ssh/sshnp@xchan already exists.
Overwrite (y/n)? y
Installing sshnp@xchan to /Users/chant/.local/bin/sshnp@xchan


Installation complete!

sshnoports on  install-version [$+] took 4s 
➜ sshnp                                                                              
Version : 3.2.0
-k, --key-file             Sending atSign's atKeys file if not in ~/.atsign/keys/
-f, --from (mandatory)     Sending atSign
-t, --to (mandatory)       Send a notification to this atSign
-d, --device               Send a notification to this device
                           (defaults to "default")
-h, --host (mandatory)     atSign of sshrvd daemon or FQDN/IP address to connect back to 
-p, --port                 TCP port to connect back to (only required if --host specified a FQDN/IP)
                           (defaults to "22")
-l, --local-port           Reverse ssh port to listen on, on your local machine, by sshnp default finds a spare port
                           (defaults to "0")
-s, --ssh-public-key       Public key file from ~/.ssh to be appended to authorized_hosts on the remote device
                           (defaults to "false")
-o, --local-ssh-options    Add these commands to the local ssh command
-v, --[no-]verbose         More logging
-r, --[no-]rsa             Use RSA 4096 keys rather than the default ED25519 keys
Invalid argument(s): Option from is mandatory.

@XavierChanth
Copy link
Member Author

XavierChanth commented Jul 20, 2023

And of course, no -v selects the latest (which is currently 3.3.0):

sshnoports on  install-version [$+] 
➜ ./packages/sshnoports/scripts/install_sshnp -c xavierchanth -d xchan -h am         

Downloading sshnp from https://github.com/atsign-foundation/sshnoports/releases/download/v3.3.0/sshnp-macos-arm64.zip
Installed binaries: sshnp at_activate sshrv
/Users/chant/.ssh/sshnp@xchan already exists.
Overwrite (y/n)? y
Installing sshnp@xchan to /Users/chant/.local/bin/sshnp@xchan

sshnoports on  install-version [$] took 10s 
➜ sshnp
Version : 3.3.0
-k, --key-file             Sending atSign's atKeys file if not in ~/.atsign/keys/
-f, --from (mandatory)     Sending atSign
-t, --to (mandatory)       Send a notification to this atSign
-d, --device               Send a notification to this device
                           (defaults to "default")
-h, --host (mandatory)     atSign of sshrvd daemon or FQDN/IP address to connect back to 
-p, --port                 TCP port to connect back to (only required if --host specified a FQDN/IP)
                           (defaults to "22")
-l, --local-port           Reverse ssh port to listen on, on your local machine, by sshnp default finds a spare port
                           (defaults to "0")
-s, --ssh-public-key       Public key file from ~/.ssh to be appended to authorized_hosts on the remote device
                           (defaults to "false")
-o, --local-ssh-options    Add these commands to the local ssh command
-v, --[no-]verbose         More logging
-r, --[no-]rsa             Use RSA 4096 keys rather than the default ED25519 keys
Invalid argument(s): Option from is mandatory.

@XavierChanth XavierChanth marked this pull request as ready for review July 20, 2023 02:28
@XavierChanth XavierChanth merged commit aa7c83f into trunk Jul 20, 2023
13 checks passed
@XavierChanth XavierChanth deleted the install-version branch July 21, 2023 18:17
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

2 participants