Commit 387c9494 authored by Emeric Verschuur's avatar Emeric Verschuur

[env-setup] Improve ca-certificates setup part

parent 6bc2c5a8
# Cangelog
## __next release__
* [env-setup] Improve ca-certificates setup part
## 3.2.0
* [env-setup] Modular setup
+ add ability to limit setup on specified elements
......
......@@ -61,3 +61,15 @@ install_ci_toolbox() {
_sudo curl -ksLo /usr/local/bin/$CITBX_TOOLBOX_NAME https://gitlab.com/ercom/citbx4gitlab/raw/master/tools/gitlab-ci/citbx4gitlab/citbx4gitlab
_sudo chmod +x /usr/local/bin/$CITBX_TOOLBOX_NAME
}
install_ca_certificates_system() {
test -d $CITBX_ABS_DIR/ca-certificates || return 0
_sudo cp $CITBX_ABS_DIR/ca-certificates/*.crt /usr/local/share/ca-certificates/
_sudo update-ca-certificates
}
install_ca_certificates_docker() {
test -d $CITBX_ABS_DIR/ca-certificates || return 0
_sudo mkdir -p /etc/docker/certs.d
_sudo cp $CITBX_ABS_DIR/ca-certificates/*.crt /etc/docker/certs.d/
}
......@@ -3,7 +3,7 @@
INSTALL_PKGS=()
if setup_component_enabled base-pkgs; then
for pkg in app-emulation/docker sys-apps/gawk dev-python/pyyaml app-misc/jq; do
for pkg in app-emulation/docker sys-apps/gawk dev-python/pyyaml app-misc/jq app-misc/ca-certificates; do
if ! equery -q list $pkg > /dev/null; then
INSTALL_PKGS+=($pkg)
fi
......@@ -29,13 +29,9 @@ fi
if setup_component_enabled ca-certs; then
print_info "Installing CA certificates..."
# Add user SSL ROOT CA
if [ -d $CITBX_ABS_DIR/ca-certificates ]; then
_sudo cp $CITBX_ABS_DIR/ca-certificates/*.crt /usr/local/share/ca-certificates/
_sudo update-ca-certificates
_sudo mkdir -p /etc/docker/certs.d
_sudo cp $CITBX_ABS_DIR/ca-certificates/*.crt /etc/docker/certs.d/
fi
# Add custom SSL ROOT CAs
install_ca_certificates_system
install_ca_certificates_docker
fi
if setup_component_enabled docker-cfg; then
......
......@@ -73,13 +73,9 @@ fi
if setup_component_enabled ca-certs; then
print_info "Installing CA certificates..."
# Add user SSL ROOT CA
if [ -d $CITBX_ABS_DIR/ca-certificates ]; then
_sudo cp $CITBX_ABS_DIR/ca-certificates/*.crt /usr/local/share/ca-certificates/
_sudo update-ca-certificates
_sudo mkdir -p /etc/docker/certs.d
_sudo cp $CITBX_ABS_DIR/ca-certificates/*.crt /etc/docker/certs.d/
fi
# Add custom SSL ROOT CAs
install_ca_certificates_system
install_ca_certificates_docker
fi
if setup_component_enabled docker-cfg; then
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment