From: Ravi Pendurty Date: Thu, 12 Jun 2025 10:23:13 +0000 (+0530) Subject: Include distribution artifacts X-Git-Url: https://gerrit.o-ran-sc.org/r/gitweb?a=commitdiff_plain;h=refs%2Fchanges%2F56%2F14556%2F1;p=oam%2Foam-controller.git Include distribution artifacts Provides infrastucture for building sdnc-image and sdnc-web-image Issue-ID: OAM-469 Change-Id: Ic97d9c208c38c4c4c934a7bf608ae6a0fd001148 Signed-off-by: Ravi Pendurty --- diff --git a/distribution/TagVersion.groovy b/distribution/TagVersion.groovy new file mode 100644 index 0000000..bcf2452 --- /dev/null +++ b/distribution/TagVersion.groovy @@ -0,0 +1,41 @@ +/*- + * ============LICENSE_START======================================================= + * ONAP CCSDK + * ================================================================================ + * Copyright (C) 2017 AT&T Intellectual Property. 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. + * ============LICENSE_END============================================ + * =================================================================== + * + */ + +package org.onap.sdnc.oam + + +def versionArray; +if ( project.properties['sdnc.project.version'] != null ) { + versionArray = project.properties['sdnc.project.version'].split('\\.'); +} + +if ( project.properties['sdnc.project.version'].endsWith("-SNAPSHOT") ) { + patchArray = versionArray[2].split('-'); + project.properties['project.docker.latestminortag.version']=versionArray[0] + '.' + versionArray[1] + "-SNAPSHOT-latest"; + project.properties['project.docker.latestfulltag.version']=versionArray[0] + '.' + versionArray[1] + '.' + patchArray[0] + "-SNAPSHOT-latest"; + project.properties['project.docker.latesttagtimestamp.version']=versionArray[0] + '.' + versionArray[1] + '.' + patchArray[0] + "-SNAPSHOT-"+project.properties['sdnc.build.timestamp']; +} else { + project.properties['project.docker.latestminortag.version']=versionArray[0] + '.' + versionArray[1] + "-STAGING-latest"; + project.properties['project.docker.latestfulltag.version']=versionArray[0] + '.' + versionArray[1] + '.' + versionArray[2] + "-STAGING-latest"; + project.properties['project.docker.latesttagtimestamp.version']=versionArray[0] + '.' + versionArray[1] + '.' + versionArray[2] + "-STAGING-"+project.properties['sdnc.build.timestamp']; +} diff --git a/distribution/oam-controller-web/README.md b/distribution/oam-controller-web/README.md new file mode 100644 index 0000000..834b93a --- /dev/null +++ b/distribution/oam-controller-web/README.md @@ -0,0 +1,56 @@ +# sdnc web image + + +## folder structure + +| folder | description | +| ------ | ----------- | +| /opt/bitnami/nginx/conf/server_blocks/http(s)_site.conf | nginx config | +| /opt/bitnami/nginx/conf/server_blocks/location.rules | forwarding rules for nginx | +| /app/odlux | http content files (html, js, css, ...) | +| /app/odlux.application.list | application list file | +| /app/opm.py | Odlux package manager for install or uninstall apps | +| /app/init.d/ | autoinstall folder for opm | + +## Default app order + +| index | application | +| ----- | ----------- | +| 1 | connectApp | +| 10 | faultApp | +| 20 | maintenanceApp | +| 30 | configurationApp | +| 55 | performanceHistoryApp | +| 70 | inventoryApp | +| 75 | eventLogApp | +| 90 | mediatorApp | +| 200 | helpApp | + + +## usage + +### auto installation + +To auto install additional applications for odlux they can be easily injected before startup into the ```/app/init.d/``` folder. There are two options of file format allowed. + +[1] The first fileformat is e.g. 55microwaveApp.jar but also .zip is allowed. The important thing is that a number is leading the app package to specify the order number where the menu item is ordered in the menu bar. So the microwaveApp would be located between performanceApp and inventoryApp. + +[2] The second is the default jar format, like it would be installed into the opendaylight karaf environment, including a blueprint and the sources. There the filename is not important because application name and index will be detected by the blueprint information. + + +### manual method +``` +opm install --name myApp --index 53 --file myarchive.zip +``` +``` +opm install --url https://link-to-my-odlux-application.jar +``` + +``` +opm uninstall --name myApp +``` + +``` +opm list +``` + diff --git a/distribution/oam-controller-web/certs/cacert.pem b/distribution/oam-controller-web/certs/cacert.pem new file mode 100644 index 0000000..0146e6b --- /dev/null +++ b/distribution/oam-controller-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SMEGDAWgBRTVTPyS+vQ +UbHBeJrBKDF77+rtSTAPBgNVHRMBAf8EBTADAQH/MA4GA1UdDwEB/wQEAwIBhjAN +BgkqhkiG9w0BAQsFAAOCAgEAPx/IaK94n02wPxpnYTy+LVLIxwdq/kawNd6IbiMz +L87zmNMDmHcGbfoRCj8OkhuggX9Lx1/CkhpXimuYsZOFQi5blr/u+v4mIbsgbmi9 +7j+cUHDP0zLycvSvxKHty51LwmaX9a4wkJl5zBU4O1sd/H9tWcEmwJ39ltKoBKBx +c94Zc3iMm5ytRWGj+0rKzLDAXEWpoZ5bE5PLJauA6UDCxDLfs3FwhbS7uDggxYvf +jySF5FCNET94oJ+m8s7VeHvoa8iPGKvXrIqdd7XDHnqJJlVKr7m9S0fMbyEB8ci2 +RtOXDt93ifY1uhoEtEykn4dqBSp8ezvNMnwoXdYPDvTd9uCAFeWFLVreBAWxd25h +PsBTkZA5hpa/rA+mKv6Af4VBViYr8cz4dZCsFChuioVebe9ighrfjB//qKepFjPF +CyjzKN1u0JKm/2x/ORqxkTONG8p3uDwoIOyimUcTtTMv42bfYD88RKakqSFXE9G+ +Z0LlaKABqfjK49o/tsAp+c5LoNlYllKhnetO3QAdraHwdmC36BhoghzR1jpX751A +cZn2VH3Q4XKyp01cJNCJIrua+A+bx6zh3RyW6zIIkbRCbET+UD+4mr8WIcSE3mtR +ZVlnhUDO4z9//WKMVzwS9Rh8/kuszrGFI1KQozXCHLrce3YP6RYZfOed79LXaRwX +dYY= +-----END CERTIFICATE----- diff --git a/distribution/oam-controller-web/certs/cert.pem b/distribution/oam-controller-web/certs/cert.pem new file mode 100644 index 0000000..1195a12 --- /dev/null +++ b/distribution/oam-controller-web/certs/cert.pem @@ -0,0 +1,102 @@ +Bag Attributes + friendlyName: sdnc@sdnc.onap.org + localKeyID: 54 69 6D 65 20 31 36 31 31 36 38 33 32 39 38 35 32 32 +Key Attributes: +-----BEGIN ENCRYPTED PRIVATE KEY----- +MIIFHDBOBgkqhkiG9w0BB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Rk9H4iHTyFRyoPViX6wYxlD7B9hJWggEyDVg9RvJImOSKyWk+NKd +WmfxaywgUJkxsJeEBCso8V690lm//oWrc17qWEd29h/9J0MPNa2zXJyG1Yq1RohZ +JW3IcnE8gCoyHVjxBCVjKPA6dXtfDNfmCDyEG+GgPglQUj9TBIRGmn9e067M6dB9 +vhnK12SBQNTyoH5vWSbP2u5wk6jV5QKYyqMbNHAD1uvsBbWy4FpoI+epp2Y3XcAr +kgBzopKSaCbj1thxxUHsMYBspVDR+D0SR4fsHhj+Y3jmr37s3q1NOSkWUMcMa7Hi +zaozRSo8hYUwP5RHpPcNCTcK0dhFPAWXyGPtP7IribGQDhUAdde/s4yPuSLa28zy +uTKWU5vSlaE+9WRSKvbA8HdKTPv45dV/qUCHITvPOdsqkWJ3qhNQMrrD9Mx17oj/ +zGZTcRGQG62dfYUR9v2rGE6Gj7MzaE1SrQgYqtCzWfJ9e3fBqOlko5jtZ5Kz86DU +ZFISrkb1sATngzWFtvyNgHFx4fUsYDJbc8XlB47H5Byyj/6SypS6dMpwqpNezn8s +xQi3yUfpg7GQzTFKdwmqK/KVeh0KZF/0FM+ZCUPh6IaRDcp8+Hm7H72ZD4vPxs4s +8bvLx9bxfiI+/6Om51IQrQ== +-----END ENCRYPTED PRIVATE KEY----- +Bag Attributes + friendlyName: sdnc@sdnc.onap.org + localKeyID: 54 69 6D 65 20 31 36 31 31 36 38 33 32 39 38 35 32 32 +subject=CN = sdnc, OU = sdnc@sdnc.onap.org:DEV, OU = OSAAF, O = ONAP, C = US + +issuer=C = US, O = ONAP, OU = OSAAF, CN = intermediateCA_9 + +-----BEGIN CERTIFICATE----- +MIIE6zCCA9OgAwIBAgIJALyx+8HFJuYTMA0GCSqGSIb3DQEBCwUAMEcxCzAJBgNV +BAYTAlVTMQ0wCwYDVQQKDARPTkFQMQ4wDAYDVQQLDAVPU0FBRjEZMBcGA1UEAwwQ +aW50ZXJtZWRpYXRlQ0FfOTAeFw0yMTAxMjYxNzQ4MTha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cc2RuYy5hcGkuc2ltcGxlZGVtby5vbmFwLm9yZ4IJc2RuYy5vbmFwghx2 +bTEuc2RuYy5zaW1wbGVkZW1vLm9uYXAub3JnMA0GCSqGSIb3DQEBCwUAA4IBAQAg +7fybHysjWyKejSfPnodYuLfQoCIaXe5C4JbwLGKweAost5E6ud2rscN/c5UYNPs/ +IskfnMxULLzJpEXdUHwLQaLJj0fQQBRHq23s8P7Emu44ZeEzxAQfI+4pKRzTYxag +4dIitf91nhUq5SQI/pcki+/ElkwfeKHYQLBDU8ygG/gZKh1UHxIjfva7v/ENqL2h +H8UDXsLhOx/guaJzH2CRQdKMminsdtnNgSRRPzWRe4EMc2ah6G6E4B/Za/n7Rhq5 +r6jpvM/XIxPCY4ci5jJIbvdahS4I54kMaLRTSl4gT8+n8ie/GzhZlXX+1MR8HCZc +8SWDYxmc8MkJ20iekiSc +-----END CERTIFICATE----- +Bag Attributes + friendlyName: CN=intermediateCA_9,OU=OSAAF,O=ONAP,C=US +subject=C = US, O = ONAP, OU = OSAAF, CN = intermediateCA_9 + +issuer=OU = OSAAF, O = ONAP, C = US + +-----BEGIN CERTIFICATE----- +MIIEdTCCAl2gAwIBAgIBBzANBgkqhkiG9w0BAQsFADAsMQ4wDAYDVQQLDAVPU0FB +RjENMAsGA1UECgwET05BUDELMAkGA1UEBhMCVVMwHhcNMTgwODE3MTg1MTM3WhcN +MjMwODE3MTg1MTM3WjBHMQswCQYDVQQGEwJVUzENMAsGA1UECgwET05BUDEOMAwG +A1UECwwFT1NBQUYxGTAXBgNVBAMMEGludGVybWVkaWF0ZUNBXzkwggEiMA0GCSqG +SIb3DQEBAQUAA4IBDwAwggEKAoIBAQCv0HHUkba3uNtNI3jPKimUcd6RNwmhSCJL +neMWpnjqp5/A+HCKyNsEaT4y177hNLmCm/aMm1u2JIfikc+8wEqLCSBBPz+P0h+d +o+sZ7U+4oeQizdYYpEdzHJ2SieHHa8vtu80rU3nO2NEIkuYC20HcKSEtl8fFKsk3 +nqlhY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mCkZ5CQVjfGL9DTOYteR5hw+k= +-----END CERTIFICATE----- diff --git a/distribution/oam-controller-web/certs/key.pem b/distribution/oam-controller-web/certs/key.pem new file mode 100644 index 0000000..04bc849 --- /dev/null +++ b/distribution/oam-controller-web/certs/key.pem @@ -0,0 +1,29 @@ +-----BEGIN PRIVATE KEY----- +MIIEvwIBADANBgkqhkiG9w0BAQEFAASCBKkwggSlAgEAAoIBAQC0LcK1txIq7tfA +QA1IgSGxFLK7oi7ut4eow6ay6q8Rree3eTEqcWkaDj6FgzxP2ei7zMExn4kCD7BZ +2dh92LQ7CP6dXzhQB8QlJeQrOB52IyVJA7NlO3V1GGUfHpzT2UXxWTVDmo8REVIM +hP9IPsh0tQJcrDCJxQ25ZjRGIEKDYjffehaQWph4rwg18OtdmwZJGUDk3iiWgmdA +zxiGBgCbX0NZCC+2NQ93NwtFQ9/YaJrcaiG9ta43ut2FSEqa23yl9EcYo5FsNMF4 +2kQ8MTxsB06wx4LKzx/87/R2pOnCZE8OXu1QRx5S9bB2ID0gy3f/DxRpJg+Gvzfy +Ci8v9eCjAgMBAAECggEAbB+J2MIjhOAPWK8XSYs0TK+/EhohT9+S6RN/1Z4/sLxL +cS6o8m9cQuaJXlWCu+hoYUpeJQk3jqUbjs/LurlwbnzXTlj10hDXA/PZGJZ0sTAm +D8rIvNcRhVM+W45jTj30WwDNleQKNpPOSPUGvLPwVxjIchRijEpUEg3jELILOAuW +ebloKLqc5SDAPKIpepZO7bz4L/dVlQSEBp3OTzyfeecbBNS2Vfw0K+I5BqGJAssZ +Dq+ixSHRj6mdvm7tf5e14j65W8VKvUoHbktp9z2OBCItySV4g1dqrfM7T9SqsosH +cbwR5dIieiFnhdg94rfpzH2QTCBt5MGUpCcv+CbQAQKBgQDkenCAImG1jAjzQNxb +7LXLJeIqJC2E3290hEYge2Bi+1/WmV222AAwNUEPQfKa7qUJRLpX8a4p+9kTaZos +93szyYEyp4vf93GDHvQPmKMJDCbbxa94txd5dnrtYTN+MCPjpwr+75++JRUUwcNr +k3mkzM87zhSBkyYcGiCsza4gQQKBgQDJ4enp8Zly3GqufbWJNpKut6e9hC6f4qWi +4qRUBmjnogm0HiGmn83n9B6SI6OnaRy/dXgPBogZDeETyzGu78nArDK+cy8wSy0H +aPuApqGJzsuAl6YWudYt4ooBcJL99XgTGxFAb2q04JKxh18V6DRfj7pY2uhZongI +OdcMSE2H4wKBgQCUzNEcAkhUbmEd264oCB/VsFR9UZZ7pPD3l3X8jZ2WmVQvdS69 +eCuXOfenMjIIiUfeo24g/HuLSER2Ch6pDnykm6WTEd9c+9Bnru8QgT4dFFbyZusC +2WtmZa1lkBpzInMdPptAsVr+ATSbkh3tn9xnYiPNNUfRo738K2AAauvugQKBgQCd +dzbqoOXdr4sOm0LzybtTyDBwJB/x2ej0Se9/EpjUw5DqCu6YduE2YTVPK7lEpTol +JE0G+0NAt5CtzbntB1/Ihwf1gQZ3lsuCkiJJ0K8DPGeC38ZOx5kFpUObp+EfcU29 +KUmlhsImX1xMWJiUD9B6ETN6hxTghVc2o1bXX7YJnQKBgQCGiRnjCEmKd8hefkS8 +ub9F4kdOzXmG4XhK+oZWVGPXIGfnoxm6IbWcjSArA/m8TLfJSHPKujnLOnOkffpi +7+PWzTHn5BFDGUb8z3mxwJV8e9szoDkljoiUwYU/S8eatAm6lyJv1gp2wmDI9DfT +86BefCEvGk3EzAo3L6hhHdICzA== +-----END PRIVATE KEY----- + diff --git a/distribution/oam-controller-web/pom.xml b/distribution/oam-controller-web/pom.xml new file mode 100644 index 0000000..7e6365b --- /dev/null +++ b/distribution/oam-controller-web/pom.xml @@ -0,0 +1,200 @@ + + + 4.0.0 + + org.o-ran-sc.sdnc.oam + installation-sdnc-web + 2.6.1-SNAPSHOT + pom + + sdnc-oam :: installation :: ${project.artifactId} + Creates SDN Controller WebUI Docker container + + + docker.io/bitnami/nginx:1.21-debian-10 + o-ran-sc/sdnc-web-image + ${project.version} + 1.7.0-SNAPSHOT + ${maven.build.timestamp} + ${https_proxy} + yyyyMMdd'T'HHmmss'Z' + deploy + true + + + + + org.o-ran-sc.oam-controller.features.sdnr.odlux + sdnr-odlux-installer + ${ccsdk.features.version} + zip + repo + + + + + + + org.codehaus.gmaven + groovy-maven-plugin + 2.1.1 + + + validate + + execute + + + ${basedir}/../TagVersion.groovy + + + + + + maven-resources-plugin + 2.6 + + + copy-dockerfile + + copy-resources + + validate + + ${basedir}/target/docker-stage + + + src/main/docker + + Dockerfile + + true + + + + + + copy-siteconf + + copy-resources + + validate + + ${basedir}/target/docker-stage/conf + + + src/main/resources + + *.conf + *.rules + + true + + + + + + copy-scripts + + copy-resources + + validate + + ${basedir}/target/docker-stage/bin + + + src/main/scripts + + *.sh + *.py + + true + + + + + + copy-favicon + + copy-resources + + validate + + ${basedir}/target/docker-stage/html + + + src/main/resources + + favicon.ico + odlux.application.list + + false + + + + + + + + org.apache.maven.plugins + maven-dependency-plugin + + + unpack features + generate-sources + + unpack-dependencies + + + ${basedir}/target/docker-stage/html + true + false + true + true + + + + + + io.fabric8 + docker-maven-plugin + 0.30.0 + false + + + + ${image.name} + + try + ${basedir}/target/docker-stage + + + ${project.docker.latestminortag.version} + ${project.docker.latestfulltag.version} + ${project.docker.latesttagtimestamp.version} + + + + + + + + generate-images + package + + build + + + + push-images + ${docker.push.phase} + + build + push + + + + + + + diff --git a/distribution/oam-controller-web/src/main/docker/Dockerfile b/distribution/oam-controller-web/src/main/docker/Dockerfile new file mode 100644 index 0000000..b2b45a3 --- /dev/null +++ b/distribution/oam-controller-web/src/main/docker/Dockerfile @@ -0,0 +1,65 @@ +### +#============LICENSE_START======================================================= +# ONAP : ccsdk distribution web +# ================================================================================ +# Copyright (C) 2020 highstreet technologies GmbH Intellectual Property. +# 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. +# ============LICENSE_END========================================================= +### + +# Base bitnami nginx image +FROM ${base.image.repo} +LABEL maintainer="CCSDK Team (onap-ccsdk@lists.onap.org)" +USER root +RUN apt-get update && apt-get install python3-minimal python3-urllib3 unzip openssl -y +USER 1001 +# copy ODLUX files to nginx +COPY html /opt/bitnami/nginx/html + +# copy site conf files +COPY conf/* /opt/bitnami/nginx/conf/server_blocks/ + +# setup environment variables +ENV WEBPROTOCOL="HTTP" \ + WEBPORT="8080" \ + SDNRPROTOCOL="HTTP" \ + SDNRHOST="172.18.0.3" \ + SDNRPORT="8181" \ + ONETONSETUP="false" \ + TRPCEURL="" \ + TOPOURL="" \ + TILEURL="" \ + SITEDOCURL="" \ + DNS_RESOLVER="1.1.1.1 ipv6=off" \ + DNS_INTERNAL_RESOLVER="127.0.0.11" \ + SSL_CERT_DIR="/app/cert" \ + SSL_CERTIFICATE="cert.pem" \ + SSL_CERTIFICATE_KEY="cert.key" + +# Check if /app can be used. If so, create "custom" directory and copy the files there. +COPY bin/* /opt/bitnami/nginx/sbin/ + +USER root +RUN chmod +x /opt/bitnami/nginx/sbin/run.sh /opt/bitnami/nginx/sbin/opm.py +# By default, docker copies files with the permissions of the build user. To avoid cases where build user +# has 644 which can result in failure of certain commands +RUN chmod -R g+w /opt/bitnami/nginx/html/odlux && mkdir /app/init.d +RUN chmod 666 /opt/bitnami/nginx/conf/server_blocks/*.rules +#RUN chown 1001:1001 /app/odlux.application.list && chmod 777 /app/odlux.application.list +RUN chown -R 1001:1001 /app +RUN ln -s /opt/bitnami/nginx/sbin/opm.py /usr/local/bin/opm +USER 1001 +CMD [ "/opt/bitnami/nginx/sbin/run.sh" ] + diff --git a/distribution/oam-controller-web/src/main/resources/favicon.ico b/distribution/oam-controller-web/src/main/resources/favicon.ico new file mode 100644 index 0000000..650067e Binary files /dev/null and b/distribution/oam-controller-web/src/main/resources/favicon.ico differ diff --git a/distribution/oam-controller-web/src/main/resources/http_custom.conf b/distribution/oam-controller-web/src/main/resources/http_custom.conf new file mode 100644 index 0000000..fd637dd --- /dev/null +++ b/distribution/oam-controller-web/src/main/resources/http_custom.conf @@ -0,0 +1,4 @@ +map $http_authorization $auth_header { + ~^Basic $http_authorization; + default "Bearer $cookie_token"; +} diff --git a/distribution/oam-controller-web/src/main/resources/http_site.conf b/distribution/oam-controller-web/src/main/resources/http_site.conf new file mode 100644 index 0000000..1fe4303 --- /dev/null +++ b/distribution/oam-controller-web/src/main/resources/http_site.conf @@ -0,0 +1,66 @@ +### +# ============LICENSE_START======================================================= +# ONAP : ccsdk distribution web +# ================================================================================ +# Copyright (C) 2020 highstreet technologies GmbH Intellectual Property. +# 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. +# ============LICENSE_END========================================================= +### + +## +# You should look at the following URL's in order to grasp a solid understanding +# of Nginx configuration files in order to fully unleash the power of Nginx. +# https://www.nginx.com/resources/wiki/start/ +# https://www.nginx.com/resources/wiki/start/topics/tutorials/config_pitfalls/ +# https://wiki.debian.org/Nginx/DirectoryStructure +# +# In most cases, administrators will remove this file from sites-enabled/ and +# leave it as reference inside of sites-available where it will continue to be +# updated by the nginx packaging team. +# +# This file will automatically load configuration files provided by other +# applications, such as Drupal or Wordpress. These applications will be made +# available underneath a path with that package name, such as /drupal8. +# +# Please see /usr/share/doc/nginx-doc/examples/ for more detailed examples. +## + +# Default server configuration +# +server { + listen WEBPORT default_server ; + listen [::]:WEBPORT default_server; + +# root /var/www; + + index index.html index.htm index.nginx-debian.html; + + server_name _; + + include server_blocks/location.rules; + + gzip on; + gzip_min_length 1000; + gzip_comp_level 5; + gzip_proxied any; + gzip_vary on; + gzip_types text/plain + application/json + application/xml + application/yang-data+json + application/yang-data+xml + text/javascript + application/javascript; +} diff --git a/distribution/oam-controller-web/src/main/resources/https_site.conf b/distribution/oam-controller-web/src/main/resources/https_site.conf new file mode 100644 index 0000000..734a48b --- /dev/null +++ b/distribution/oam-controller-web/src/main/resources/https_site.conf @@ -0,0 +1,85 @@ +### +# ============LICENSE_START======================================================= +# ONAP : ccsdk distribution web +# ================================================================================ +# Copyright (C) 2020 highstreet technologies GmbH Intellectual Property. +# 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. +# ============LICENSE_END========================================================= +### + +## +# You should look at the following URL's in order to grasp a solid understanding +# of Nginx configuration files in order to fully unleash the power of Nginx. +# https://www.nginx.com/resources/wiki/start/ +# https://www.nginx.com/resources/wiki/start/topics/tutorials/config_pitfalls/ +# https://wiki.debian.org/Nginx/DirectoryStructure +# +# In most cases, administrators will remove this file from sites-enabled/ and +# leave it as reference inside of sites-available where it will continue to be +# updated by the nginx packaging team. +# +# This file will automatically load configuration files provided by other +# applications, such as Drupal or Wordpress. These applications will be made +# available underneath a path with that package name, such as /drupal8. +# +# Please see /usr/share/doc/nginx-doc/examples/ for more detailed examples. +## + +# Default server configuration +# +server { + listen WEBPORT ssl default_server ; + listen [::]:WEBPORT ssl default_server; + + # SSL configuration + # + # listen 443 ssl default_server; + # listen [::]:443 ssl default_server; + # + # Note: You should disable gzip for SSL traffic. + # See: https://bugs.debian.org/773332 + # + # Read up on ssl_ciphers to ensure a secure configuration. + # See: https://bugs.debian.org/765782 + # + # Self signed certs generated by the ssl-cert package + # Don't use them in a production server! + # + # include snippets/snakeoil.conf; + + ssl_certificate SSL_CERT_DIR/SSL_CERTIFICATE; + ssl_certificate_key SSL_CERT_DIR/SSL_CERTIFICATE_KEY; + +# root /var/www; + + index index.html index.htm index.nginx-debian.html; + + server_name _; + + include server_blocks/location.rules; + + gzip on; + gzip_min_length 1000; + gzip_comp_level 5; + gzip_proxied any; + gzip_vary on; + gzip_types text/plain + application/json + application/xml + application/yang-data+json + application/yang-data+xml + text/javascript + application/javascript; +} diff --git a/distribution/oam-controller-web/src/main/resources/location.rules b/distribution/oam-controller-web/src/main/resources/location.rules new file mode 100644 index 0000000..0342e31 --- /dev/null +++ b/distribution/oam-controller-web/src/main/resources/location.rules @@ -0,0 +1,64 @@ +location ~ ^/$ { + return 301 " /odlux/index.html"; +} +location ~ ^/help/$ { + try_files /help/$args.json $uri; +} +location ~ ^/transportpce { + resolver DNS_INTERNAL_RESOLVER; + if ($request_uri ~* "/transportpce/(.*)") { + proxy_pass TRPCEURL/$1; + } +} +location ~ ^/topology/ { + resolver DNS_INTERNAL_RESOLVER; + proxy_pass TOPOURL; +} +location ~ ^/sitedoc/ { + resolver DNS_INTERNAL_RESOLVER; + if ($request_uri ~* "/sitedoc/(.*)") { + proxy_pass SITEDOCURL/topology/stadok/$1; + } +} +location ~ ^/tiles/ { + resolver DNS_RESOLVER; + if ($request_uri ~* "/tiles/(.*)") { + proxy_pass TILEURL/$1; + } +} +location ~ ^/terrain/ { + resolver DNS_INTERNAL_RESOLVER; + if ($request_uri ~* "/terrain/(.*)") { + proxy_pass TERRAINURL/$1; + } +} +location ~ ^/electromagnetic-field/ { + resolver DNS_RESOLVER; + proxy_set_header Authorization "Basic ELECTROMAGNETICFIELDBAUTHTOKEN"; + proxy_pass_header Authorization; + if ($request_uri ~* "/electromagnetic-field/(.*)") { + proxy_pass ELECTROMAGNETICFIELDURL/$1; + } +} +location / { + try_files $uri $uri/ @backend; +} +location /websocket { + proxy_pass http://SDNRHOST:SDNRWEBSOCKETPORT/websocket; + proxy_http_version 1.1; + proxy_set_header Upgrade $http_upgrade; + proxy_set_header Connection "upgrade"; +} +location /apidoc/ { + proxy_pass SDNRPROTOCOL://SDNRHOST:SDNRPORT; + + # Inject Authorization header + proxy_set_header Authorization $auth_header; + # + # Optional CORS settings + #add_header Access-Control-Allow-Origin *; + add_header Access-Control-Allow-Headers Authorization,Content-Type; +} +location @backend { + proxy_pass SDNRPROTOCOL://SDNRHOST:SDNRPORT; +} \ No newline at end of file diff --git a/distribution/oam-controller-web/src/main/resources/odlux.application.list b/distribution/oam-controller-web/src/main/resources/odlux.application.list new file mode 100644 index 0000000..c56559c --- /dev/null +++ b/distribution/oam-controller-web/src/main/resources/odlux.application.list @@ -0,0 +1,8 @@ +1 connectApp +10 faultApp +20 maintenanceApp +30 configurationApp +55 performanceHistoryApp +70 inventoryApp +75 eventLogApp +200 helpApp diff --git a/distribution/oam-controller-web/src/main/scripts/configure.py b/distribution/oam-controller-web/src/main/scripts/configure.py new file mode 100644 index 0000000..255cbcd --- /dev/null +++ b/distribution/oam-controller-web/src/main/scripts/configure.py @@ -0,0 +1,34 @@ +#!/bin/bash + +### +# ============LICENSE_START======================================================= +# ONAP : ccsdk distribution web +# ================================================================================ +# Copyright (C) 2020 highstreet technologies GmbH Intellectual Property. +# 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. +# ============LICENSE_END========================================================= +### + +# load core methods to call +from core import * + +# Comment listening on 8080 in nginx.conf as we don't want nginx to listen on any port other than SDNR +sedInFile('listen','\#listen', '/opt/bitnami/nginx/conf/nginx.conf') +initial_load() +update_index_html() + +check_for_rule_template() + +update_nginx_site_conf() diff --git a/distribution/oam-controller-web/src/main/scripts/core.py b/distribution/oam-controller-web/src/main/scripts/core.py new file mode 100644 index 0000000..461f8cd --- /dev/null +++ b/distribution/oam-controller-web/src/main/scripts/core.py @@ -0,0 +1,358 @@ +### +# ============LICENSE_START======================================================= +# ONAP : ccsdk distribution web +# ================================================================================ +# Copyright (C) 2020 highstreet technologies GmbH Intellectual Property. +# 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. +# ============LICENSE_END========================================================= +### +import subprocess +import os +import json +import zipfile +import re +import uuid +import urllib3 +import shutil +import re +import ssl +urllib3.disable_warnings() + +APPLICATION_LISTFILE="/app/odlux.application.list" +INIT_FOLDER="/app/init.d" +ODLUX_BASE_FOLDER='/app/odlux' +INDEX_HTML=ODLUX_BASE_FOLDER+'/index.html' +INDEX_HTML_TEMPLATE=INDEX_HTML+'.template' +DEFAULT_APPLICATIONS=["connectApp" "faultApp" "maintenanceApp" "configurationApp" "performanceHistoryApp" "inventoryApp" "eventLogApp" "mediatorApp" "helpApp"] +http = urllib3.PoolManager(cert_reqs=ssl.CERT_NONE) + +def exec(command): + output = subprocess.Popen(command, shell=True, stdout=subprocess.PIPE).stdout.read() + return output +def execToStdOut(commandArray): + process = subprocess.Popen(commandArray, shell=False) + process.communicate() + +def download(url, dst): + print("downloading from {}...".format(url),end="") + with open(dst, 'wb') as out_file: + resp= http.request('GET',url, preload_content=False) + shutil.copyfileobj(resp, out_file) + resp.release_conn() + print("done") + +def getEnv(key, defaultValue=None): + x=os.getenv(key) + return x if x is not None and len(x)>0 else defaultValue + +def sedInFile(old, nu, fn): + execToStdOut(['sed', '-i', 's|{}|{}|g'.format(old,nu),fn]) + +def add_application(name, index, file=None): + apps = load_applications() + if index==0: + print("no index given. put it to last position") + index=apps[len(apps)-1]['index']+10 + apps.append(dict(index=index,name=name)) + if file is not None and os.path.exists(file): + extract(file) + else: + print('unable to find file {}'.format(file)) + write_applications(apps) + print("{} installed on index {}".format(name, index)) + +def initial_load(): + files = os.listdir(INIT_FOLDER) + regex = r"([0-9]+)([a-zA-Z]+)\.(jar|zip)" + regexUrl = r"([0-9]+)([a-zA-Z]+)\.(url)" + for file in files: + matches = re.finditer(regex,file) + match = next(matches, None) + matchesUrl = re.finditer(regexUrl,file) + matchUrl = next(matchesUrl, None) + if match is not None: + print("installing {}".format(file)) + index = int(match.group(1)) + name = match.group(2) + add_application(name,index,INIT_FOLDER+'/'+file) + elif matchUrl is not None: + print("installing {}".format(file)) + index = int(match.group(1)) + name = match.group(2) + add_application(name,index,INIT_FOLDER+'/'+file) + else: + print("no index naming format found. try to autodetect") + infos = autoDetectInfosFromJar(file) + if infos is None: + print("unable to detect index and application name for {}".format(file)) + else: + add_application(infos['name'],infos['index'],INIT_FOLDER+'/'+file) + + + +def containsBlueprintExpression(file) -> bool: + print("check if file {} is blueprint".format(file)) + with open(file, 'r') as fp: + lines = fp.readlines() + for line in lines: + if "[^<]*<\/script>/