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

IAM-483-Enable update-ca-certificates #38

Merged
merged 2 commits into from
Oct 24, 2023
Merged
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
42 changes: 36 additions & 6 deletions rockcraft.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -20,10 +20,14 @@ parts:
util:
plugin: nil
stage-packages:
# This is needed to pipe the stdout/stderr to a file for log forwarding
# This is needed to pipe the stdout/stderr to a file for log forwarding and to update certificates
- coreutils
prime:
- usr/bin/tee

openssl:
plugin: nil
stage-packages:
# This is needed to update certificates
- openssl

shell:
plugin: nil
Expand All @@ -33,8 +37,36 @@ parts:

certificates:
plugin: nil
stage-packages:
build-packages:
- ca-certificates
override-build: |
mkdir -p $CRAFT_PART_INSTALL/etc/ssl/certs
mkdir -p $CRAFT_PART_INSTALL/usr/share/ca-certificates/mozilla/
mkdir -p $CRAFT_PART_INSTALL/usr/sbin
mkdir -p $CRAFT_PART_INSTALL/tmp

touch $CRAFT_PART_INSTALL/etc/ssl/certs/ca-certificates.crt
touch $CRAFT_PART_INSTALL/etc/ca-certificates.conf
for cert in /usr/share/ca-certificates/mozilla/* ; do
echo "mozilla/$(basename $cert)" >> $CRAFT_PART_INSTALL/etc/ca-certificates.conf
cat "$cert" >> $CRAFT_PART_INSTALL/etc/ssl/certs/ca-certificates.crt
nsklikas marked this conversation as resolved.
Show resolved Hide resolved
done
cp /usr/share/ca-certificates/mozilla/* $CRAFT_PART_INSTALL/usr/share/ca-certificates/mozilla
cp /usr/sbin/update-ca-certificates $CRAFT_PART_INSTALL/usr/sbin/update-ca-certificates
chmod 777 $CRAFT_PART_INSTALL/tmp
chmod -R 777 $CRAFT_PART_INSTALL/etc/ssl/certs

sed:
plugin: nil
stage-packages:
- sed

find:
plugin: nil
stage-packages:
- findutils
prime:
- usr/bin/find

kratos:
plugin: go
Expand All @@ -58,5 +90,3 @@ parts:

go mod download
go build -ldflags="${go_linker_flags}" -o ${CRAFT_PART_INSTALL}/bin/kratos
stage-packages:
- ca-certificates_data