Skip to content

Commit

Permalink
Replace cas with cosign (#44)
Browse files Browse the repository at this point in the history
* Replace cas with cosign

* try fix docker

* Fix LN

* fix v2

* use according docker

* adjust more

* verify
  • Loading branch information
pvizeli committed Jun 26, 2023
1 parent 6850729 commit 636f90b
Show file tree
Hide file tree
Showing 8 changed files with 33 additions and 25 deletions.
2 changes: 1 addition & 1 deletion addons/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ RUN \
&& common_install_packages \
docker \
shellcheck \
cas \
cosign \
os-agent \
&& usermod -aG docker vscode

Expand Down
15 changes: 0 additions & 15 deletions common/install/cas

This file was deleted.

15 changes: 15 additions & 0 deletions common/install/cosign
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
#!/bin/bash

set -e

ARCH=$(get_arch docker)

COSIGN_VERSION=$(get_package_version cosign)

curl -fLs \
"https://github.com/sigstore/cosign/releases/download/v${COSIGN_VERSION}/cosign-linux-${ARCH}" \
--output ./cosign

chmod +x ./cosign
mv -f ./cosign /usr/local/bin/cosign
rm -f ./cosign
13 changes: 8 additions & 5 deletions common/install/docker
Original file line number Diff line number Diff line change
Expand Up @@ -4,15 +4,18 @@ set -e

apt-get update
apt-get install -y --no-install-recommends \
apt-transport-https \
ca-certificates \
curl \
software-properties-common \
gpg-agent
gnupg

curl -fsSL https://download.docker.com/linux/debian/gpg | apt-key add -
install -m 0755 -d /etc/apt/keyrings
curl -fsSL https://download.docker.com/linux/debian/gpg | gpg --dearmor -o /etc/apt/keyrings/docker.gpg
chmod a+r /etc/apt/keyrings/docker.gpg

add-apt-repository "deb https://download.docker.com/linux/debian $(lsb_release -cs) stable"
echo \
"deb [arch="$(dpkg --print-architecture)" signed-by=/etc/apt/keyrings/docker.gpg] https://download.docker.com/linux/debian \
"$(. /etc/os-release && echo "$VERSION_CODENAME")" stable" | \
tee /etc/apt/sources.list.d/docker.list > /dev/null

apt-get update
apt-get install -y --no-install-recommends \
Expand Down
4 changes: 2 additions & 2 deletions common/install/versions.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"cas": "v1.0.2",
"cosign": "2.0.2",
"os-agent": "1.5.1",
"nvm": "v0.38.0"
"nvm": "0.38.0"
}
2 changes: 1 addition & 1 deletion common/install/yarn
Original file line number Diff line number Diff line change
Expand Up @@ -20,5 +20,5 @@ apt-get install -y --no-install-recommends \
nodejs \
yarn

curl -o - "https://raw.githubusercontent.com/nvm-sh/nvm/${NVM_VERSION}/install.sh" | bash
curl -o - "https://raw.githubusercontent.com/nvm-sh/nvm/v${NVM_VERSION}/install.sh" | bash
rm -rf /var/lib/apt/lists/*
2 changes: 1 addition & 1 deletion supervisor/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ RUN \
&& common_install_packages \
docker \
shellcheck \
cas \
cosign \
os-agent \
yarn

Expand Down
5 changes: 5 additions & 0 deletions supervisor/rootfs/usr/bin/supervisor_run
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,11 @@ trap "stop_docker" ERR

function build_supervisor() {
docker pull "ghcr.io/home-assistant/${HA_ARCH}-builder:dev"
cosign verify \
--certificate-oidc-issuer https://token.actions.githubusercontent.com \
--certificate-identity-regexp https://github.com/home-assistant/builder/.* \
"ghcr.io/home-assistant/${HA_ARCH}-builder:dev"

docker run --rm \
--privileged \
-v /run/docker.sock:/run/docker.sock \
Expand Down

0 comments on commit 636f90b

Please sign in to comment.