This repository has been archived by the owner on Feb 6, 2024. It is now read-only.
forked from blue-build/legacy-template
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Revert "chore: switch to new signing module"
This reverts commit 29ccd82.
- Loading branch information
1 parent
c57bfac
commit 34e2212
Showing
4 changed files
with
47 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -4,3 +4,4 @@ scripts: | |
- printer-drivers.sh | ||
- power-scheduler.sh | ||
- systemwide-themes.sh | ||
- signing.sh |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
#!/usr/bin/env bash | ||
|
||
# Tell build process to exit if there are any errors. | ||
set -euo pipefail | ||
|
||
IMAGE_VENDOR=silverflow | ||
IMAGE_TAG=latest | ||
IMAGE_INFO=/usr/share/ublue-os/image-info.json | ||
|
||
echo "Setting up container signing in policy.json and cosign.yaml for $IMAGE_NAME" | ||
echo "Registry to write: $IMAGE_REGISTRY" | ||
|
||
cp /usr/share/ublue-os/cosign.pub /usr/etc/pki/containers/"$IMAGE_NAME".pub | ||
|
||
FILE=/usr/etc/containers/policy.json | ||
|
||
yq -i -o=j '.transports.docker |= | ||
{"'"$IMAGE_REGISTRY"'/'"$IMAGE_NAME"'": [ | ||
{ | ||
"type": "sigstoreSigned", | ||
"keyPath": "/usr/etc/pki/containers/'"$IMAGE_NAME"'.pub", | ||
"signedIdentity": { | ||
"type": "matchRepository" | ||
} | ||
} | ||
] | ||
} | ||
+ .' "$FILE" | ||
|
||
IMAGE_REF="ostree-image-signed:docker://$IMAGE_REGISTRY/$IMAGE_NAME" | ||
|
||
touch $IMAGE_INFO | ||
cat >$IMAGE_INFO <<EOF | ||
{ | ||
"image-name": "$IMAGE_NAME", | ||
"image-flavor": "$BASE_IMAGE", | ||
"image-vendor": "$IMAGE_VENDOR", | ||
"image-ref": "$IMAGE_REF", | ||
"image-tag": "$IMAGE_TAG", | ||
"fedora-version": "$OS_VERSION" | ||
} | ||
EOF | ||
|
||
sed -i '/^PRETTY_NAME/s/Silverblue/SilverFlow/' /usr/lib/os-release | ||
cp /usr/etc/containers/registries.d/ublue-os.yaml /usr/etc/containers/registries.d/"$IMAGE_NAME".yaml | ||
sed -i "s ghcr.io/ublue-os $IMAGE_REGISTRY g" /usr/etc/containers/registries.d/"$IMAGE_NAME".yaml |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters