Skip to content

Commit

Permalink
Merge pull request #602 from atsign-foundation/new-bundles
Browse files Browse the repository at this point in the history
feat: New bundles to replace templates in releases
  • Loading branch information
XavierChanth authored Dec 4, 2023
2 parents d718e6e + 6fcc968 commit 2b70c6f
Show file tree
Hide file tree
Showing 30 changed files with 583 additions and 166 deletions.
6 changes: 5 additions & 1 deletion .github/workflows/multibuild.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -25,12 +25,15 @@ jobs:
- os: ubuntu-latest
output-name: sshnp-linux-x64
ext: ''
bundle: 'shell'
- os: macOS-latest
output-name: sshnp-macos-x64
ext: ''
bundle: 'shell'
- os: windows-latest
output-name: sshnp-windows-x64
ext: '.exe'
bundle: 'windows'

steps:
- uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
Expand All @@ -51,7 +54,8 @@ jobs:
run: dart compile exe bin/sshrvd.dart -v -o sshnp/sshrvd${{ matrix.ext }}
- if: ${{ matrix.os != 'windows-latest' }}
run: dart compile exe bin/sshrvd.dart -D ENABLE_SNOOP=true -v -o sshnp/debug/sshrvd${{ matrix.ext }}
- run: cp -r templates sshnp/templates
- run: cp -r bundles/core/ sshnp/
- run: cp -r bundles/${{ matrix.bundle }}/ sshnp/
- run: cp LICENSE sshnp
- run: tar -cvzf tarball/${{ matrix.output-name }}.tgz sshnp
- uses: actions/upload-artifact@a8a3f3ad30e3422c9c7b888a15615d19a852ae32 # v3.1.3
Expand Down
36 changes: 36 additions & 0 deletions packages/sshnoports/bundles/shell/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
# SSH No Ports Suite

## Installation

To install a member of the SSH No Ports suite, use the `install.sh` script.
View the full usage of the installation script by running:

```sh
./install.sh --help
```

### Common install commands

To install the sshnp client:

```sh
./install.sh sshnp
```

To install the sshnpd daemon using systemd (must be run as root):

```sh
sudo ./install.sh systemd sshnpd
```

To install the sshnpd daemon using a headless cron job:

```sh
./install.sh headless sshnpd
```

To install the sshnpd daemon into a detached tmux session:

```sh
./install.sh tmux sshnpd
```
76 changes: 76 additions & 0 deletions packages/sshnoports/bundles/shell/headless/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,76 @@
# Headless Scripts

This directory contains headless scripts for running various components of the
SSH No Ports suite.

## sshnpd

### Installation

The `sshnpd.sh` file should be placed in `~/.local/bin`.

Modify the `sshnpd.sh` unit to use the appropriate host and client atSigns,
(The boilerplate uses $device_atsign $manager_atsign) as well as the devicename.
Also make sure that username running sshnpd has the .atkeys file in place at
'~/.atsign/keys'.

Run the following command to view full usage information of the sshnpd binary:
```sh
/usr/local/bin/sshnpd
```
or if you didn't install the binaries as root:
```sh
~/.local/bin/sshnpd
```

### Usage

A cron entry is created which automatically runs this script upon boot using the
`@reboot` directive. You can use the `crontab` command to view and edit the
configuration:

To view the crontab:
```sh
crontab -l
```

To edit the crontab:
```sh
crontab -e
```

## sshrvd

### Installation

The `sshrvd.service` file should be placed in `/etc/systemd/system` (as root).

Modify the `sshrvd.service` unit to use the appropriate atSign,
(The boilerplate uses @atsign) as well as the internet address.
Also change the username and make sure that username running sshrvd has the
.atkeys file in place at '~/.atsign/keys'.

Run the following command to view full usage information of the sshrvd binary:
```sh
/usr/local/bin/sshrvd
```
or if you didn't install the binaries as root:
```sh
~/.local/bin/sshrvd
```

### Usage

A cron entry is created which automatically runs this script upon boot using the
`@reboot` directive. You can use the `crontab` command to view and edit the
configuration:

To view the crontab:
```sh
crontab -l
```

To edit the crontab:
```sh
crontab -e
```
8 changes: 8 additions & 0 deletions packages/sshnoports/bundles/shell/headless/sshnpd.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
#!/bin/sh
sleep 10; # allow machine to bring up network
while true; do
# disable "var is referenced but not assigned" warning for template
# shellcheck disable=SC2154
"$HOME"/.local/bin/sshnpd -a "$device_atsign" -m "$manager_atsign" -d "$device_name" -v
sleep 10
done
8 changes: 8 additions & 0 deletions packages/sshnoports/bundles/shell/headless/sshrvd.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
#!/bin/sh
sleep 10; # allow machine to bring up network
while true; do
# disable "var is referenced but not assigned" warning for template
# shellcheck disable=SC2154
"$HOME"/.local/bin/sshrvd -a "$atsign" -i "$internet_address"
sleep 10
done
Loading

0 comments on commit 2b70c6f

Please sign in to comment.