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

Fix installing CA on Solus #321

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
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
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
## {{ UNRELEASED_VERSION }} - [{{ UNRELEASED_DATE }}]({{ UNRELEASED_LINK }})

* Fixed installing CA on Solus

## v3.23.24 - [January 14, 2025](https://github.com/lando/core/releases/tag/v3.23.24)

* Fixed bug causing service script moving to fail when receiving non-stringy inputs
Expand Down
3 changes: 3 additions & 0 deletions scripts/environment.sh
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,9 @@ set_package_manager() {
ol)
export LANDO_LINUX_PACKAGE_MANAGER="microdnf"
;;
solus)
export LANDO_LINUX_PACKAGE_MANAGER="eopkg"
;;
*)
return 1
;;
Expand Down
20 changes: 19 additions & 1 deletion scripts/install-system-ca-linux.sh
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,9 @@ set_package_manager() {
ol)
export LANDO_LINUX_PACKAGE_MANAGER="microdnf"
;;
solus)
export LANDO_LINUX_PACKAGE_MANAGER="eopkg"
;;
*)
return 1
;;
Expand Down Expand Up @@ -146,8 +149,16 @@ if [ ! -x "$(command -v update-ca-trust)" ]; then
esac
fi

if [ ! -x "$(command -v certutil)" ]; then
case $LANDO_LINUX_PACKAGE_MANAGER in
eopkg)
eopkg install -y ca-certs libnss
;;
esac
fi

# abort if we cannot install the things we need
if [ ! -x "$(command -v update-ca-certificates)" ] && [ ! -x "$(command -v update-ca-trust)" ]; then
if [ ! -x "$(command -v update-ca-certificates)" ] && [ ! -x "$(command -v update-ca-trust)" ] && [ ! -x "$(command -v certutil)" ]; then
echo "$LANDO_LINUX_PACKAGE_MANAGER not supported! Could not install ca-certs!" >&2
exit 1
fi
Expand All @@ -164,6 +175,13 @@ case $LANDO_LINUX_PACKAGE_MANAGER in
cp -rf "$CA" /etc/ca-certificates/trust-source/anchors/
update-ca-trust
;;
eopkg)
mkdir -p /etc/ssl/certs
cp -rf "$CA" /etc/ssl/certs/
NONROOT_USER=$(logname)
NONROOT_HOME=$(getent passwd "$NONROOT_USER" | cut -d: -f6)
certutil -d "sql:$NONROOT_HOME/.pki/nssdb" -A -t "C,," -n Lando-Root-CA -i "$CA"
;;
*)
mkdir -p /usr/local/share/ca-certificates
cp -rf "$CA" /usr/local/share/ca-certificates/
Expand Down