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: universal versioned installer #896

Merged
merged 22 commits into from
Mar 26, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
22 commits
Select commit Hold shift + click to select a range
150840a
feat: crerate new universal install script
XavierChanth Mar 21, 2024
0d72edd
Merge branch 'trunk' into xc/universal-versioned-installer
XavierChanth Mar 21, 2024
996dc7e
ci: auto build universal.sh in multibuild ci
XavierChanth Mar 21, 2024
e91358e
ci: bump to 5.1.0-rc.1
XavierChanth Mar 21, 2024
fb6a8bf
fix: needs name in multibuild
XavierChanth Mar 21, 2024
9510c7f
chore: bump version to v5.1.0-rc.2
XavierChanth Mar 21, 2024
1f26a25
fix: metadata tag
XavierChanth Mar 21, 2024
7528d2c
fix: unset and applying value
XavierChanth Mar 21, 2024
2db228d
fix: sed being the most incompatible shell tool ever
XavierChanth Mar 21, 2024
b950d8a
chore: bump sshnoports to 5.1.0-rc.3
XavierChanth Mar 21, 2024
4ba8a72
chore: make sure to truncate the v in the TAG
XavierChanth Mar 21, 2024
6a38d54
chore: bump sshnoports to v5.1.0-rc.4
XavierChanth Mar 21, 2024
094a8ad
Merge pull request #897 from atsign-foundation/xc/test-universal
XavierChanth Mar 21, 2024
061229a
chore: final cleanup from testing
XavierChanth Mar 21, 2024
52c9a1e
chore: remove todo
XavierChanth Mar 21, 2024
31620b1
chore: remove example parameters
XavierChanth Mar 21, 2024
8a64e1a
chore: bump to v5.1.0-rc.5
XavierChanth Mar 21, 2024
60426bf
fix: local_archive var
XavierChanth Mar 21, 2024
a4c4c4d
fix: install_type var
XavierChanth Mar 21, 2024
e3f0b7b
chore: final cleanup of universal.sh
XavierChanth Mar 21, 2024
dceb112
Merge branch 'xc/release-v5.1.0-rc.5' into xc/universal-versioned-ins…
XavierChanth Mar 25, 2024
43bdded
Merge branch 'trunk' into xc/universal-versioned-installer
XavierChanth Mar 26, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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"
Copy link
Member Author

Choose a reason for hiding this comment

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

If the action is called from a tag, then it will replace the version in the universal.sh script with the version from the tag, then it will upload that as an artifact.

- 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"
Copy link
Member Author

Choose a reason for hiding this comment

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

Did this so we could remove the separate root version, by simply replacing the string here

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"
Copy link
Member Author

Choose a reason for hiding this comment

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

Same thing here

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