diff options
author | 2019-04-11 14:37:52 +0800 | |
---|---|---|
committer | 2019-04-11 06:48:09 +0000 | |
commit | eb26703e56f69bf8a018f9160de53c4ff290a8f6 (patch) | |
tree | 873fa9193d3b97804cfc0f932e1172ea7068a8fb /gvnfmadapter | |
parent | 53a997f9ffd7cbdf49154dacaf54042344ed594a (diff) |
Add https support for gvnfm
Change-Id: I36506eb50de226275862cf4e5af30fe231bc4e71
Issue-ID: VFC-1342
Signed-off-by: yangyan <yangyanyj@chinamobile.com>
Diffstat (limited to 'gvnfmadapter')
-rw-r--r-- | gvnfmadapter/assembly.xml | 2 | ||||
-rw-r--r-- | gvnfmadapter/docker/Dockerfile | 5 | ||||
-rw-r--r-- | gvnfmadapter/driver/pub/ssl/cert/foobar.crt | 20 | ||||
-rw-r--r-- | gvnfmadapter/driver/pub/ssl/cert/foobar.csr | 18 | ||||
-rw-r--r-- | gvnfmadapter/driver/pub/ssl/cert/foobar.key | 27 | ||||
-rw-r--r-- | gvnfmadapter/requirements.txt | 6 | ||||
-rwxr-xr-x | gvnfmadapter/run.sh | 8 | ||||
-rwxr-xr-x | gvnfmadapter/stop.sh | 3 |
8 files changed, 85 insertions, 4 deletions
diff --git a/gvnfmadapter/assembly.xml b/gvnfmadapter/assembly.xml index 594a153..f05076c 100644 --- a/gvnfmadapter/assembly.xml +++ b/gvnfmadapter/assembly.xml @@ -28,6 +28,8 @@ <include>**/*.py</include> <include>**/*.json</include> <include>**/*.yml</include> + <include>**/*.crt</include> + <include>**/*.key</include> </includes> </fileSet> <fileSet> diff --git a/gvnfmadapter/docker/Dockerfile b/gvnfmadapter/docker/Dockerfile index d27ed1f..8b55f83 100644 --- a/gvnfmadapter/docker/Dockerfile +++ b/gvnfmadapter/docker/Dockerfile @@ -10,6 +10,7 @@ RUN sed -i "s|set compatible|set nocompatible|" /etc/vim/vimrc.tiny RUN echo "set backspace=2" >> /etc/vim/vimrc.tiny RUN apt-get update && \ + apt-get install -y wget unzip gcc libssl-dev && \ apt-get install -y python-virtualenv && \ apt-get install -y python-setuptools && \ apt-get install -y python-dev && \ @@ -19,7 +20,7 @@ RUN apt-get update && \ apt-get install -y unzip && \ apt-get install -y curl && \ apt-get install -y build-essential && \ - apt-get install -y libssl-dev && \ +# apt-get install -y libssl-dev && \ apt-get install -y libffi-dev ADD . /service @@ -33,6 +34,8 @@ RUN wget -q -O vfc-nfvo-driver-vnfm-gvnfm-gvnfmadapter.zip 'https://nexus.onap.o WORKDIR /service/vfc/nfvo/driver/vnfm/gvnfm/gvnfmadapter RUN pip install -r requirements.txt +RUN apt-get --purge remove -y wget unzip gcc libssl-dev + EXPOSE 8484 WORKDIR /service diff --git a/gvnfmadapter/driver/pub/ssl/cert/foobar.crt b/gvnfmadapter/driver/pub/ssl/cert/foobar.crt new file mode 100644 index 0000000..7ab6dd3 --- /dev/null +++ b/gvnfmadapter/driver/pub/ssl/cert/foobar.crt @@ -0,0 +1,20 @@ +-----BEGIN CERTIFICATE----- +MIIDRDCCAiwCCQD8zmUqCHOp2zANBgkqhkiG9w0BAQsFADBjMQswCQYDVQQGEwJD +TjEQMA4GA1UECAwHQmVpSmluZzEQMA4GA1UEBwwHQmVpSmluZzENMAsGA1UECgwE +Q21jYzESMBAGA1UECwwJQ21jYy1vbmFwMQ0wCwYDVQQDDARDbWNjMCAXDTE5MDMy +NjAyNTI0N1oYDzIxMTkwMzAyMDI1MjQ3WjBjMQswCQYDVQQGEwJDTjEQMA4GA1UE +CAwHQmVpSmluZzEQMA4GA1UEBwwHQmVpSmluZzENMAsGA1UECgwEQ21jYzESMBAG +A1UECwwJQ21jYy1vbmFwMQ0wCwYDVQQDDARDbWNjMIIBIjANBgkqhkiG9w0BAQEF +AAOCAQ8AMIIBCgKCAQEA4DurchTgEw/A1y/Q5gpSSJTLC+KFOV4Vmbz2hlvOGLwV +NIX1+r7DpaiJTGjEKLCtGsD2tGm69KiUX9FBY1CStnwK2R4wA5NKW+ZKQLd3sRTc +Hl+2bLFk7E5KvmKZZM4xhsN3ey7Ia8H0sSfKiGlxB1hZI2HibRNy8GWyi95j8MkP +v+H7HbJlX1kIKb7p2y8aG8AnAzBWikJFcQ1y3bJA2r31wOht63pIekwh+nntt5u+ +Yh/STXHiAe2gT7b9x6RAn09tC6TsBKzdZ4ZKrBLfRwPv6+cbDLcqkhbPukqaFaEs +rDCLhuWX10sGLEsqXULDwZRoYxTUueLek9v+/8f5EwIDAQABMA0GCSqGSIb3DQEB +CwUAA4IBAQCenowNpFiy9vH18+9PL4rZjZ1NH+frGqsWvDiyHPnLpneCLOuiXvgv +kcuLJDYatc6vTlXkJElxwF1fCaJEn6dNq3WtQxdJjhXidAKx8Hsf1Nxkwbvmahv2 +TIWV/FMvop+9SdonDBGZojrYKRsY3EilQf+7/rGEM52HE8S3yE8CCe9xTZSYUs1B +B8CzOPBVU7SWSRSLUKfdRhjyl4Rqsslxzal+8A36yViHBPhJgmDRoVWVR+E289IH +FCQ0d8qVvdTGkM79dvZrEH9WSzPwlTR0NSkBMWTNLcWyP8caDjg+fbSVOF+s+sd/ +bLuAyHyeXUzClJx6CA5zwLZz5K5SVxw+ +-----END CERTIFICATE----- diff --git a/gvnfmadapter/driver/pub/ssl/cert/foobar.csr b/gvnfmadapter/driver/pub/ssl/cert/foobar.csr new file mode 100644 index 0000000..30b381b --- /dev/null +++ b/gvnfmadapter/driver/pub/ssl/cert/foobar.csr @@ -0,0 +1,18 @@ +-----BEGIN CERTIFICATE REQUEST----- +MIIC1DCCAbwCAQAwYzELMAkGA1UEBhMCQ04xEDAOBgNVBAgMB0JlaUppbmcxEDAO +BgNVBAcMB0JlaUppbmcxDTALBgNVBAoMBENtY2MxEjAQBgNVBAsMCUNtY2Mtb25h +cDENMAsGA1UEAwwEQ21jYzCCASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoCggEB +AOA7q3IU4BMPwNcv0OYKUkiUywvihTleFZm89oZbzhi8FTSF9fq+w6WoiUxoxCiw +rRrA9rRpuvSolF/RQWNQkrZ8CtkeMAOTSlvmSkC3d7EU3B5ftmyxZOxOSr5imWTO +MYbDd3suyGvB9LEnyohpcQdYWSNh4m0TcvBlsoveY/DJD7/h+x2yZV9ZCCm+6dsv +GhvAJwMwVopCRXENct2yQNq99cDobet6SHpMIfp57bebvmIf0k1x4gHtoE+2/cek +QJ9PbQuk7ASs3WeGSqwS30cD7+vnGwy3KpIWz7pKmhWhLKwwi4bll9dLBixLKl1C +w8GUaGMU1Lni3pPb/v/H+RMCAwEAAaAsMBMGCSqGSIb3DQEJAjEGDARDbWNjMBUG +CSqGSIb3DQEJBzEIDAYxMjM0NTYwDQYJKoZIhvcNAQELBQADggEBAGr8XkV5G9bK +lPc3jUvmS+KSg9UB1wrvf6kQUGDvCvXqZCGw1mRZekN4rH5c1fk9iLwLqDkWDnNo +79jzAWV76U62GarTOng32TLTItxI/EeUhQFCf+AI/YcJEdHf8HGrDuvC0iSz6/9q +Fe5HhVSO7zsHdP28J05wTyII+2k4ecAj3oXutUnGCBg0nlexDmxAZoe8x4XHpqkt +tEKquZdq3l17+v5DKlKwczQcXUBC1yGw0ki67U5w9fVKzpAf7Frr7YnbGS35i5Pv +ny4SlXPW167hRQKXCniY5QtCocP+GoPD+81uWwf+bjHyAZ3HCd532YFgXW01yJhM +imRDxx2gDds= +-----END CERTIFICATE REQUEST----- diff --git a/gvnfmadapter/driver/pub/ssl/cert/foobar.key b/gvnfmadapter/driver/pub/ssl/cert/foobar.key new file mode 100644 index 0000000..266f502 --- /dev/null +++ b/gvnfmadapter/driver/pub/ssl/cert/foobar.key @@ -0,0 +1,27 @@ +-----BEGIN RSA PRIVATE KEY----- +MIIEpQIBAAKCAQEA4DurchTgEw/A1y/Q5gpSSJTLC+KFOV4Vmbz2hlvOGLwVNIX1 ++r7DpaiJTGjEKLCtGsD2tGm69KiUX9FBY1CStnwK2R4wA5NKW+ZKQLd3sRTcHl+2 +bLFk7E5KvmKZZM4xhsN3ey7Ia8H0sSfKiGlxB1hZI2HibRNy8GWyi95j8MkPv+H7 +Hb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iIlK1DkRkEYRxIRYuR4jNl +8H5V5BsBGipcZfUsYjT+FzQBQDgII+ILbIOH1Im2lG6ctbx+TSyXlrzaavu1oJ0t +5zmoVvVOQzcR5pwphI4dxZsFYoV3cFWXVw8dgXoNG7vF3qgoLbbxq57JG/UJTSXA +Y4oq8kECgYEAlgh6v+o6jCUD7l0JWdRtZy52rhC3W/HrhcHE0/l3RjeV+kLIWr9u +WbNltgZQGvPVQ+ZwPIYj1gaGP17wm5pAsJNSN4LQ1v4Fj/XjT7zdwYwYOrXIJati +5HTeyHjm+wwOPYrmH4YLGwAh6T1is42E0K2L7LG8HnO4bHbfV2mKji0= +-----END RSA PRIVATE KEY----- diff --git a/gvnfmadapter/requirements.txt b/gvnfmadapter/requirements.txt index 8789a86..bb2c93d 100644 --- a/gvnfmadapter/requirements.txt +++ b/gvnfmadapter/requirements.txt @@ -18,4 +18,8 @@ flex>=6.11.1 swagger-spec-validator>=2.1.0 # for onap logging -onappylog>=1.0.6
\ No newline at end of file +onappylog>=1.0.6 + + +# uwsgi for parallel processing +uwsgi
\ No newline at end of file diff --git a/gvnfmadapter/run.sh b/gvnfmadapter/run.sh index 6f77c0f..fe669f5 100755 --- a/gvnfmadapter/run.sh +++ b/gvnfmadapter/run.sh @@ -18,7 +18,13 @@ if [ ! -x $logDir ]; then mkdir -p $logDir fi -nohup python manage.py runserver 0.0.0.0:8484 > /dev/null & +# nohup python manage.py runserver 0.0.0.0:8484 > /dev/null & + +if [ ${SSL_ENABLED} = "true" ]; then + nohup uwsgi --https :8484,driver/pub/ssl/cert/foobar.crt,driver/pub/ssl/cert/foobar.key, -t 120 --module driver.wsgi --master --processes 4 & +else + nohup uwsgi --http :8484 -t 120 --module driver.wsgi --master --processes 4 & +fi while [ ! -f $logDir/runtime_gvnfmdriver.log ]; do sleep 1 diff --git a/gvnfmadapter/stop.sh b/gvnfmadapter/stop.sh index b514403..d719541 100755 --- a/gvnfmadapter/stop.sh +++ b/gvnfmadapter/stop.sh @@ -13,4 +13,5 @@ # See the License for the specific language governing permissions and # limitations under the License. -ps auxww | grep 'manage.py runserver 0.0.0.0:8484' | awk '{print $2}' | xargs kill -9 +# ps auxww | grep 'manage.py runserver 0.0.0.0:8484' | awk '{print $2}' | xargs kill -9 +ps auxww |grep 'uwsgi --http :8484 --module driver.wsgi --master' |awk '{print $2}' |xargs kill -9 |