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

Conversation

XavierChanth
Copy link
Member

@XavierChanth XavierChanth commented Mar 21, 2024

- What I did

  • Created a new universal.sh installer which is opinionated and makes the installation process easier.

- How I did it

- How to verify it

- Description for the changelog
feat: universal versioned installer

@XavierChanth XavierChanth changed the title [DRAFT] feat: universal versioned installer feat: universal versioned installer Mar 21, 2024
}
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.

FROM=

# Receiving (a.k.a. remote) device atSign
TO=
Copy link
Member Author

Choose a reason for hiding this comment

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

We don't really encourage people to use this, and it's not up to date, so let's just remove the template. People can still create config files if they want.

Copy link
Member Author

@XavierChanth XavierChanth Mar 21, 2024

Choose a reason for hiding this comment

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

This file is for creating a test archive (since the v5.0.2 release doesn't contain all the bits needed by universal.sh), not 100% sure that the linux side works, but it is meant for development.

Copy link
Member Author

Choose a reason for hiding this comment

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

This readme doesn't really add much value, since it just reiterates the usage of the script.

@@ -1,20 +0,0 @@
#!/bin/sh
Copy link
Member Author

Choose a reason for hiding this comment

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

Replaced by the metadata functions which overwrite this

Copy link
Member Author

Choose a reason for hiding this comment

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

Some of the changes here are to formatting.

sed -i '' "$@"
else
sed -i "$@"
fi
Copy link
Member Author

Choose a reason for hiding this comment

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

because macos sed -i requires an argument after, and gnu sed expects the argument omitted if there's no backup extension...

echo "$arg_zero [...options] [command]"
echo "Available commands:"
echo "at_activate - install at_activate"
echo "npt - install npt"
Copy link
Member Author

Choose a reason for hiding this comment

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

added npt

echo ""
echo "launchd <unit> - install a launchd unit"
echo " available units: [sshnpd]"
fi
Copy link
Member Author

Choose a reason for hiding this comment

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

added launchd

echo "Options:"
echo "-b <dir> - override the directory in which the binaries are written to"
echo "-u <username> - override the user to install the binaries for"
echo "-f <flags> - additional flags services"
Copy link
Member Author

Choose a reason for hiding this comment

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

added these override flags

# 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

# 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


# 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
; Environment=u="-u"
# Comment if you don't want the daemon to share various information with the manager atsign - e.g. username, version, etc - without the manager atSign needing to know this daemon's device name
Copy link
Member Author

Choose a reason for hiding this comment

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

default -su on

Copy link
Member Author

Choose a reason for hiding this comment

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

The new script that will included directly as an asset in the release.

Copy link
Member Author

@XavierChanth XavierChanth Mar 21, 2024

Choose a reason for hiding this comment

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

This is opinionated and will guide the person through providing the appropriate information to complete installation.

For device installation, the priority order is:
macos : launchd
linux & root : systemd
tmux installed : tmux
fallback : cron

@XavierChanth XavierChanth requested review from gkc, cpswan and cconstab March 21, 2024 22:18
@XavierChanth XavierChanth marked this pull request as ready for review March 21, 2024 22:19
cpswan
cpswan previously approved these changes Mar 22, 2024
@XavierChanth
Copy link
Member Author

Looks like something I did on this branch is incompatible with the new e2e tests, will need further investigation

@gkc
Copy link
Contributor

gkc commented Mar 26, 2024

Looks like something I did on this branch is incompatible with the new e2e tests, will need further investigation

More likely network / atServer weather. I'm re-running the tests now

@gkc
Copy link
Contributor

gkc commented Mar 26, 2024

Looks like something I did on this branch is incompatible with the new e2e tests, will need further investigation

More likely network / atServer weather. I'm re-running the tests now

succeeded on re-run

@XavierChanth XavierChanth merged commit 12d6d92 into trunk Mar 26, 2024
7 checks passed
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.

3 participants