Fix up nginx-plus element
Change-Id: I4eea93d1a3761c3d11f1eb1920ede98558fae3d4 Closes-Bug: #1502993
This commit is contained in:
parent
474afc3e77
commit
ef07377bb3
2
.gitignore
vendored
2
.gitignore
vendored
@ -10,3 +10,5 @@ build
|
||||
dist
|
||||
fpm.log*
|
||||
packages/
|
||||
.DS_Store
|
||||
._.DS_Store
|
||||
|
@ -1,3 +1,10 @@
|
||||
Before using this element copy your nginx-repo.key and nginx-repo.crt into ./bin
|
||||
This element requires that you have already downloaded a crt and key file from
|
||||
nginx.
|
||||
|
||||
Download nginx-repo.crt and nginx-repo.key into any directory. Then when
|
||||
executing set DIB_NGINX_PLUS_CERT_PATH to that directory.
|
||||
|
||||
i.e.
|
||||
|
||||
ELEMENTS_PATH=diskimage-builder/elements DIB_RELEASE=wheezy DIB_EXTLINUX=1 DIB_NGINX_PLUS_CERT_PATH=/home/david/nginxcerts \
|
||||
disk-image-create debian vm nginx-plus -o nginxplus
|
||||
|
@ -1,2 +1 @@
|
||||
cloud-init-datasources
|
||||
source-repositories
|
||||
|
22
diskimage-builder/elements/nginx-plus/extra-data.d/00-copy-in-keys
Executable file
22
diskimage-builder/elements/nginx-plus/extra-data.d/00-copy-in-keys
Executable file
@ -0,0 +1,22 @@
|
||||
#!/bin/bash -e
|
||||
# Copyright (c) 2015 Akanda, Inc. All Rights Reserved.
|
||||
#
|
||||
# Licensed under the Apache License, Version 2.0 (the "License"); you may
|
||||
# not use this file except in compliance with the License. You may obtain
|
||||
# a copy of the License at
|
||||
#
|
||||
# http://www.apache.org/licenses/LICENSE-2.0
|
||||
#
|
||||
# Unless required by applicable law or agreed to in writing, software
|
||||
# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
|
||||
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
|
||||
# License for the specific language governing permissions and limitations
|
||||
# under the License.
|
||||
|
||||
if [ -z "${DIB_NGINX_PLUS_CERT_PATH}" ]; then
|
||||
echo "DIB_NGINX_PLUS_CERT_PATH is not set - not importing keys"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
cat $DIB_NGINX_PLUS_CERT_PATH/nginx-repo.crt >> $TMP_HOOKS_PATH/nginx-repo.crt
|
||||
cat $DIB_NGINX_PLUS_CERT_PATH/nginx-repo.key >> $TMP_HOOKS_PATH/nginx-repo.key
|
@ -0,0 +1 @@
|
||||
nginx-plus
|
16
diskimage-builder/elements/nginx-plus/post-install.d/99-cleanup
Executable file
16
diskimage-builder/elements/nginx-plus/post-install.d/99-cleanup
Executable file
@ -0,0 +1,16 @@
|
||||
#!/bin/bash -xe
|
||||
# Copyright (c) 2015 Akanda, Inc. All Rights Reserved.
|
||||
#
|
||||
# Licensed under the Apache License, Version 2.0 (the "License"); you may
|
||||
# not use this file except in compliance with the License. You may obtain
|
||||
# a copy of the License at
|
||||
#
|
||||
# http://www.apache.org/licenses/LICENSE-2.0
|
||||
#
|
||||
# Unless required by applicable law or agreed to in writing, software
|
||||
# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
|
||||
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
|
||||
# License for the specific language governing permissions and limitations
|
||||
# under the License.
|
||||
|
||||
rm -rf /etc/nginx/conf.d/default
|
@ -1,19 +0,0 @@
|
||||
#!/bin/bash
|
||||
# this is an install script for nginx plus
|
||||
|
||||
# make nginx ssl dir
|
||||
mkdir /etc/ssl/nginx
|
||||
cp $(dirname $0)/../bin/* /etc/ssl/nginx/
|
||||
|
||||
wget https://cs.nginx.com/static/files/CA.crt -P /etc/ssl/nginx/
|
||||
wget http://nginx.org/keys/nginx_signing.key -P /etc/ssl/nginx/
|
||||
|
||||
apt-key add nginx_signing.key
|
||||
|
||||
printf "deb https://plus-pkgs.nginx.com/debian `lsb_release -cs` nginx-plus\n" >/etc/apt/sources.list.d/nginx-plus.list
|
||||
|
||||
wget https://cs.nginx.com/static/files/90nginx -P /etc/apt/apt.conf.d
|
||||
|
||||
apt-get update
|
||||
|
||||
apt-get install nginx-plus -y
|
34
diskimage-builder/elements/nginx-plus/pre-install.d/02-nginx-plus-prep
Executable file
34
diskimage-builder/elements/nginx-plus/pre-install.d/02-nginx-plus-prep
Executable file
@ -0,0 +1,34 @@
|
||||
#!/bin/bash -e
|
||||
# Copyright (c) 2015 Akanda, Inc. All Rights Reserved.
|
||||
#
|
||||
# Licensed under the Apache License, Version 2.0 (the "License"); you may
|
||||
# not use this file except in compliance with the License. You may obtain
|
||||
# a copy of the License at
|
||||
#
|
||||
# http://www.apache.org/licenses/LICENSE-2.0
|
||||
#
|
||||
# Unless required by applicable law or agreed to in writing, software
|
||||
# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
|
||||
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
|
||||
# License for the specific language governing permissions and limitations
|
||||
# under the License.
|
||||
# This scripts preps apt with the nginx plus repo
|
||||
|
||||
# install required deps for this script
|
||||
apt-get install lsb-release ca-certificates krb5-locales libsasl2-modules apt-utils apt-transport-https wget -y
|
||||
|
||||
# make nginx ssl dir
|
||||
mkdir -p /etc/ssl/nginx
|
||||
cp /tmp/in_target.d/nginx-repo.crt /etc/ssl/nginx/
|
||||
cp /tmp/in_target.d/nginx-repo.key /etc/ssl/nginx/
|
||||
|
||||
wget https://cs.nginx.com/static/files/CA.crt -P /etc/ssl/nginx/
|
||||
wget http://nginx.org/keys/nginx_signing.key -P /etc/ssl/nginx/
|
||||
|
||||
apt-key add /etc/ssl/nginx/nginx_signing.key
|
||||
|
||||
printf "deb https://plus-pkgs.nginx.com/debian `lsb_release -cs` nginx-plus\n" >/etc/apt/sources.list.d/nginx-plus.list
|
||||
|
||||
wget https://cs.nginx.com/static/files/90nginx -P /etc/apt/apt.conf.d
|
||||
|
||||
apt-get update
|
Loading…
x
Reference in New Issue
Block a user