atsign-foundation / noports

Connect to any device with no external listening ports open
https://noports.com
BSD 3-Clause "New" or "Revised" License
271 stars 15 forks source link

universal.sh fails when adding client and device and atSigns in place #974

Closed cconstab closed 6 months ago

cconstab commented 6 months ago

Describe the bug

Adding device and client when at least one atSign is in place the device is not asked for correctly and the system files set up incorrectly.

Steps to reproduce

  1. New machine install an atSign in .atsign/keys
  2. Install using unerversal.sh
  3. device atSign never gets asked for but a select atSign does appear without mentioning the device note the error
    Installing device part...
    Enter client atSign: @cconstab
    1 atKeys file found: cconstab
    Would you like to use @cconstab? y
    Enter device name: avon

    The config file is setup with @cconstab as the device atsign...

Expected behavior

device atSign should be asked for.

Screenshots

╰$ sudo sh universal.sh           
[sudo] password for cconstab: 
Environment:
  Platform name: linux
  System arch: x64
  Temp path: /tmp
  As root: true
  Binary path: /usr/local/bin
  User: cconstab
  User home: /home/cconstab
Downloading archive from https://github.com/atsign-foundation/noports/releases/download/v5.1.0/sshnp-linux-x64.tgz
Install type (device, client, both):  both

Installing device part...
Enter client atSign: @cconstab
1 atKeys file found: cconstab
Would you like to use @cconstab? y
Enter device name: avon
=> Installed at_activate to /usr/local/bin
=> Linked /home/cconstab/.local/bin/at_activate to /usr/local/bin/at_activate
Created symlink /etc/systemd/system/multi-user.target.wants/sshnpd.service → /etc/systemd/system/sshnpd.service.
sshnpd installed with systemd. To see logs use:
journalctl -u sshnpd.service -f

Installing client part...
=> Installed sshnp to /usr/local/bin
=> Linked /home/cconstab/.local/bin/sshnp to /usr/local/bin/sshnp
=> Installed npt to /usr/local/bin
=> Linked /home/cconstab/.local/bin/npt to /usr/local/bin/npt
=> Renamed existing binary /usr/local/bin/srv to /usr/local/bin/srv.old
=> Installed srv to /usr/local/bin
=> Renamed existing binary /usr/local/bin/at_activate to /usr/local/bin/at_activate.old
=> Installed at_activate to /usr/local/bin
ln: failed to create symbolic link '/home/cconstab/.local/bin/@sshnp/np.sh': No such file or directory

Ubuntu

Were you using an atApplication when the bug was found?

No response

Additional context

No response

cconstab commented 6 months ago

Additional error permission/ownserhip of ~/.ssh/authorized_keys

-rw-r--r--  1 root     root        0 Apr 23 19:00 authorized_keys
XavierChanth commented 6 months ago

"1 atKeys file found" is for the device atsign, but we need to label that as device. Also I am removing both from the next iteration of universal.sh, it is a surface for too many bugs.

XavierChanth commented 6 months ago

@gkc has been working on the client / device atSign flow to add APKAM, so I don't think this ticket is actionable.

XavierChanth commented 6 months ago

Ah, we had the client/device string for typing it in (0 atsigns available) and select one (> 1) but if only a single atsign is on the machine we don't print whether this is for client / device