~gandelman-a/charms/precise/swift-proxy/utils_sync

« back to all changes in this revision

Viewing changes to hooks/swift-proxy-common

  • Committer: Ryan Finnie
  • Date: 2012-10-04 12:08:02 UTC
  • Revision ID: ryan.finnie@canonical.com-20121004120802-c7turf67dd3l7f2t
Add whether to use HTTPS on the proxy

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
1
#!/bin/bash
2
2
set -u
3
3
# For openssl cert generation
 
4
USE_HTTPS=$(config-get use-https)
4
5
COUNTRY=$(config-get country)
5
6
STATE=$(config-get state)
6
7
LOCALE=$(config-get locale)
59
60
SWIFT_DEB_VERSION="$(dpkg-query -W -f='${Version}' 'swift-proxy')"
60
61
cat >/etc/swift/proxy-server.conf <<EOF
61
62
[DEFAULT]
 
63
EOF
 
64
if [ "$USE_HTTPS" = "1" ]; then
 
65
  cat >>/etc/swift/proxy-server.conf <<EOF
62
66
cert_file = /etc/swift/cert.crt
63
67
key_file = /etc/swift/cert.key
 
68
EOF
 
69
fi
64
70
bind_port = $BINDPORT
65
71
workers = $WORKERS
66
72
user = swift