Fix up nginx-plus element

Change-Id: I4eea93d1a3761c3d11f1eb1920ede98558fae3d4
Closes-Bug: #1502993
This commit is contained in:
David Lenwell 2015-10-01 00:57:00 -07:00
parent 474afc3e77
commit ef07377bb3
8 changed files with 83 additions and 21 deletions

2
.gitignore vendored
View File

@ -10,3 +10,5 @@ build
dist
fpm.log*
packages/
.DS_Store
._.DS_Store

View File

@ -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

View File

@ -1,2 +1 @@
cloud-init-datasources
source-repositories

View 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

View File

@ -0,0 +1 @@
nginx-plus

View 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

View File

@ -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

View 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