Skip to content

Commit

Permalink
Merge pull request #896 from atsign-foundation/xc/universal-versioned…
Browse files Browse the repository at this point in the history
…-installer

feat: universal versioned installer
  • Loading branch information
XavierChanth authored Mar 26, 2024
2 parents 2eba8e9 + 43bdded commit 12d6d92
Show file tree
Hide file tree
Showing 15 changed files with 954 additions and 457 deletions.
30 changes: 28 additions & 2 deletions .github/workflows/multibuild.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -158,8 +158,34 @@ jobs:
path: ./packages/dart/tarballs/${{ matrix.output-name }}.tgz
if-no-files-found: error

universal_sh:
if: startsWith(github.ref, 'refs/tags/v')
defaults:
run:
working-directory: ./packages/dart/sshnoports/bundles
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@9bb56186c3b09b4f86b1c65136769dd318469633 # v4.1.2
- run: |
write_metadata() {
start_line="# SCRIPT METADATA"
end_line="# END METADATA"
file=$1
variable=$2
value=$3
# since this is linux only, sed -i is safe without a file ext.
sed -i "/$start_line/,/$end_line/s|$variable=\".*\"|$variable=\"$value\"|g" "$file"
}
REF=${{ github.ref }}
TAG=${REF:11}
write_metadata universal.sh sshnp_version "$TAG"
- uses: actions/upload-artifact@5d5d22a31266ced268874388b861e4b58bb5c2f3 # v4.3.1
with:
name: universal.sh
path: ./packages/dart/sshnoports/bundles/universal.sh
if-no-files-found: error
notify_on_completion:
needs: [main_build, other_build]
needs: [main_build, other_build, universal_sh]
runs-on: ubuntu-latest
steps:
- name: Google Chat Notification
Expand All @@ -171,7 +197,7 @@ jobs:

notify_on_failure:
if: failure()
needs: [main_build, other_build]
needs: [main_build, other_build, universal_sh]
runs-on: ubuntu-latest
steps:
- name: Google Chat Notification
Expand Down

This file was deleted.

17 changes: 17 additions & 0 deletions packages/dart/sshnoports/bundles/create-test-archive.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
#!/bin/sh

script_dir="$(dirname -- "$(readlink -f -- "$0")")"
time_stamp=$(date +%s)

tempdir="$script_dir/temp-$time_stamp/sshnp"
outfile="$script_dir/sshnp-$time_stamp"

mkdir -p "$tempdir"
cp -R "$script_dir"/core/* "$tempdir/"
cp -R "$script_dir"/shell/* "$tempdir/"

if [ "$(uname)" = 'Darwin' ]; then
ditto -c -k --keepParent "$tempdir" "$outfile.zip"
else
tar -cvzf "$outfile.tgz" "$script_dir/temp-$time_stamp"
fi
36 changes: 0 additions & 36 deletions packages/dart/sshnoports/bundles/shell/README.md

This file was deleted.

20 changes: 0 additions & 20 deletions packages/dart/sshnoports/bundles/shell/headless/root_srvd.sh

This file was deleted.

33 changes: 0 additions & 33 deletions packages/dart/sshnoports/bundles/shell/headless/root_sshnpd.sh

This file was deleted.

12 changes: 4 additions & 8 deletions packages/dart/sshnoports/bundles/shell/headless/srvd.sh
Original file line number Diff line number Diff line change
@@ -1,20 +1,16 @@
#!/bin/sh
# disable "var is referenced but not assigned" warning for template
# shellcheck disable=SC2154

# Configuration of srvd service
# This unit script is a template for the srvd background service.
# You can configure the service by editing the variables below.
# This service file covers the common configuration options for srvd.
# To see all available options, run `srvd` with no arguments.

# SCRIPT METADATA
binary_path="$HOME/.local/bin"
atsign="@my_rvd" # MANDATORY: Srvd atSign
internet_address="" # MANDATORY: Public FQDN or IP address of the machine running the srvd
v="-v" # Comment to disable verbose logging
# END METADATA

sleep 10 # allow machine to bring up network
export USER="$user"
while true; do
"$HOME"/.local/bin/srvd -a "$atsign" -i "$internet_address" "$v"
"$binary_path"/srvd -a "$atsign" -i "$internet_address" "$v"
sleep 10
done
23 changes: 6 additions & 17 deletions packages/dart/sshnoports/bundles/shell/headless/sshnpd.sh
Original file line number Diff line number Diff line change
@@ -1,33 +1,22 @@
#!/bin/sh
# disable "var is referenced but not assigned" warning for template
# shellcheck disable=SC2154

# Configuration of sshnpd service
# This script is a template for the sshnpd background service.
# You can configure the service by editing the variables below.
# This service file covers the common configuration options for sshnpd.
# To see all available options, run `sshnpd` with no arguments.

# SCRIPT METADATA
binary_path="$HOME/.local/bin"
manager_atsign="@example_client" # MANDATORY: Manager/client address (atSign)
device_atsign="@example_device" # MANDATORY: Device address (atSign)
device_name="default" # Device name
user="$(whoami)" # MANDATORY: Username
v="-v" # Comment to disable verbose logging

# Uncomment if you wish the daemon to update authorized_keys to include public
# keys sent by authorized manager atSigns
# s="-s"

# Uncomment if you wish to have the daemon make various information visible to
# the manager atsign - e.g. username, version, etc - without the manager atSign
# needing to know this daemon's device name
# u="-u"
s="-s" # Comment to disable sending public keys
u="-u" # Comment to disable sending user information
# END METADATA

sleep 10 # allow machine to bring up network
export USER="$user"
while true; do
# The line below runs the sshnpd service, with the options set above.
# You can edit this line to further customize the service to your needs.
"$HOME"/.local/bin/sshnpd -a "$device_atsign" -m "$manager_atsign" -d "$device_name" "$s" "$u" "$v"
"$binary_path"/sshnpd -a "$device_atsign" -m "$manager_atsign" -d "$device_name" "$s" "$u" "$v"
sleep 10
done
Loading

0 comments on commit 12d6d92

Please sign in to comment.