Skip to content

Commit e4c95c4

Browse files
committed
Update method of installing apt keys
This changes the method of installing apt keys in the stand-alone install script to the newer way of doing it. Signed-off-by: Elijah Zupancic <[email protected]>
1 parent 54653a8 commit e4c95c4

File tree

1 file changed

+12
-8
lines changed

1 file changed

+12
-8
lines changed

standalone_ubuntu_oss_install.sh

Lines changed: 12 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -95,17 +95,21 @@ echo "CORS Enabled: ${CORS_ENABLED}"
9595

9696
set -o nounset # abort on unbound variable
9797

98+
if [ ! -f /usr/share/keyrings/nginx-archive-keyring.gpg ]; then
99+
echo "▶ Adding NGINX signing key"
100+
key_tmp_file="$(mktemp)"
101+
wget --quiet --max-redirect=3 --output-document="${key_tmp_file}" https://nginx.org/keys/nginx_signing.key
102+
echo "dd4da5dc599ef9e7a7ac20a87275024b4923a917a306ab5d53fa77871220ecda ${key_tmp_file}" | sha256sum --check
103+
gpg --dearmor < "${key_tmp_file}" | tee /usr/share/keyrings/nginx-archive-keyring.gpg >/dev/null
104+
rm -f "${key_tmp_file}"
105+
fi
106+
98107
if [ ! -f /etc/apt/sources.list.d/nginx.list ]; then
99108
release="$(grep 'VERSION_CODENAME' /etc/os-release | cut --delimiter='=' --field=2)"
100109
echo "▶ Adding NGINX package repository"
101-
102-
cat > "/etc/apt/sources.list.d/nginx.list" << EOF
103-
deb https://nginx.org/packages/ubuntu/ $release nginx
104-
deb-src https://nginx.org/packages/ubuntu/ $release nginx
105-
EOF
106-
107-
key="ABF5BD827BD9BF62"
108-
apt-key adv --keyserver keyserver.ubuntu.com --recv-keys $key
110+
echo "deb [signed-by=/usr/share/keyrings/nginx-archive-keyring.gpg] \
111+
http://nginx.org/packages/ubuntu ${release} nginx" \
112+
| sudo tee /etc/apt/sources.list.d/nginx.list
109113
apt-get -qq update
110114
fi
111115

0 commit comments

Comments
 (0)