4 # ============LICENSE_START=======================================================
5 # ONAP : ccsdk distribution web
6 # ================================================================================
7 # Copyright (C) 2020 highstreet technologies GmbH Intellectual Property.
9 # ================================================================================
10 # Licensed under the Apache License, Version 2.0 (the "License");
11 # you may not use this file except in compliance with the License.
12 # You may obtain a copy of the License at
14 # http://www.apache.org/licenses/LICENSE-2.0
16 # Unless required by applicable law or agreed to in writing, software
17 # distributed under the License is distributed on an "AS IS" BASIS,
18 # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
19 # See the License for the specific language governing permissions and
20 # limitations under the License.
21 # ============LICENSE_END=========================================================
24 # Comment listening on 8080 in nginx.conf as we don't want nginx to listen on any port other than SDNR
25 sed -i 's/listen/\#listen/g' /opt/bitnami/nginx/conf/nginx.conf
29 # Backup the index.html file
30 cp /opt/bitnami/nginx/html/odlux/index.html /opt/bitnami/nginx/html/odlux/index.html.backup
31 sed -z 's/<script>[^<]*<\/script>/<script>\n \/\/ run the application \n require\(\[\"connectApp\",\"faultApp\",\"maintenanceApp\",\"configurationApp\",\"performanceHistoryApp\",\"inventoryApp\",\"eventLogApp\",\"mediatorApp\",\"helpApp\",\"run\"\], function \(connectApp,faultApp,maintenanceApp,configurationApp,performanceHistoryApp,inventoryApp,eventLogApp,mediatorApp,helpApp,run\) \{ \n connectApp.register\(\); \n faultApp.register\(\);\n maintenanceApp.register\(\); \n configurationApp.register\(\);\n performanceHistoryApp.register\(\); \n inventoryApp.register\(\);\n eventLogApp.register\(\);\n mediatorApp.register\(\);\n helpApp.register\(\);\n run.runApplication();\n \}\);\n <\/script>/' -i /opt/bitnami/nginx/html/odlux/index.html
35 update_nginx_site_conf() {
37 if [ "$WEBPROTOCOL" == "HTTPS" ]
40 sed -i 's|WEBPORT|'$WEBPORT'|g' /opt/bitnami/nginx/conf/server_blocks/https_site.conf
41 sed -i 's|SSL_CERT_DIR|'$SSL_CERT_DIR'|g' /opt/bitnami/nginx/conf/server_blocks/https_site.conf
42 sed -i 's|\bSSL_CERTIFICATE\b|'$SSL_CERTIFICATE'|g' /opt/bitnami/nginx/conf/server_blocks/https_site.conf
43 sed -i 's|\bSSL_CERTIFICATE_KEY\b|'$SSL_CERTIFICATE_KEY'|g' /opt/bitnami/nginx/conf/server_blocks/https_site.conf
44 sed -i 's|SDNRPROTOCOL|'$SDNRPROTOCOL'|g' /opt/bitnami/nginx/conf/server_blocks/https_site.conf
45 sed -i 's|SDNRHOST|'$SDNRHOST'|g' /opt/bitnami/nginx/conf/server_blocks/https_site.conf
46 sed -i 's|SDNRPORT|'$SDNRPORT'|g' /opt/bitnami/nginx/conf/server_blocks/https_site.conf
47 sed -i 's|LOCALDNS|'$LOCALDNS'|g' /opt/bitnami/nginx/conf/server_blocks/https_site.conf
49 #cp /opt/bitnami/nginx/sbin/https_site.conf /opt/bitnami/nginx/conf/server_blocks
50 rm /opt/bitnami/nginx/conf/server_blocks/http_site.conf
51 elif [ "$WEBPROTOCOL" == "HTTP" ]
53 sed -i 's|WEBPORT|'$WEBPORT'|g' /opt/bitnami/nginx/conf/server_blocks/http_site.conf
54 sed -i 's|SDNRPROTOCOL|'$SDNRPROTOCOL'|g' /opt/bitnami/nginx/conf/server_blocks/http_site.conf
55 sed -i 's|SDNRHOST|'$SDNRHOST'|g' /opt/bitnami/nginx/conf/server_blocks/http_site.conf
56 sed -i 's|SDNRPORT|'$SDNRPORT'|g' /opt/bitnami/nginx/conf/server_blocks/http_site.conf
57 sed -i 's|LOCALDNS|'$LOCALDNS'|g' /opt/bitnami/nginx/conf/server_blocks/http_site.conf
58 #cp /opt/bitnami/nginx/sbin/http_site.conf /opt/bitnami/nginx/conf/server_blocks
59 rm /opt/bitnami/nginx/conf/server_blocks/https_site.conf
66 update_nginx_site_conf