mirror of
				https://github.com/Telecominfraproject/wlan-cloud-ucentralgw.git
				synced 2025-11-03 20:27:45 +00:00 
			
		
		
		
	Compare commits
	
		
			12 Commits
		
	
	
		
			v2.10.0
			...
			release/v2
		
	
	| Author | SHA1 | Date | |
|---|---|---|---|
| 
						 | 
					4405c01b73 | ||
| 
						 | 
					c1db70d8c4 | ||
| 
						 | 
					ef6e4809f5 | ||
| 
						 | 
					4b190a571f | ||
| 
						 | 
					c6b84434ea | ||
| 
						 | 
					acad0cd99f | ||
| 
						 | 
					7f675733df | ||
| 
						 | 
					4f1d05467f | ||
| 
						 | 
					27bffaa734 | ||
| 
						 | 
					b005b57137 | ||
| 
						 | 
					2bae52e67e | ||
| 
						 | 
					7766fe08cd | 
@@ -39,6 +39,10 @@ if [[ "$TEMPLATE_CONFIG" = 'true' && ! -f "$OWGW_CONFIG"/owgw.properties ]]; the
 | 
				
			|||||||
  SYSTEM_URI_PUBLIC=${SYSTEM_URI_PUBLIC:-"https://localhost:16002"} \
 | 
					  SYSTEM_URI_PUBLIC=${SYSTEM_URI_PUBLIC:-"https://localhost:16002"} \
 | 
				
			||||||
  SYSTEM_URI_UI=${SYSTEM_URI_UI:-"http://localhost"} \
 | 
					  SYSTEM_URI_UI=${SYSTEM_URI_UI:-"http://localhost"} \
 | 
				
			||||||
  SIMULATORID=${SIMULATORID:-""} \
 | 
					  SIMULATORID=${SIMULATORID:-""} \
 | 
				
			||||||
 | 
					  IPTOCOUNTRY_PROVIDER=${IPTOCOUNTRY_PROVIDER:-"ipinfo"} \
 | 
				
			||||||
 | 
					  IPTOCOUNTRY_IPINFO_TOKEN=${IPTOCOUNTRY_IPINFO_TOKEN:-""} \
 | 
				
			||||||
 | 
					  IPTOCOUNTRY_IPDATA_APIKEY=${IPTOCOUNTRY_IPDATA_APIKEY:-""} \
 | 
				
			||||||
 | 
					  AUTOPROVISIONING_PROCESS=${AUTOPROVISIONING_PROCESS:-"prov,default"} \
 | 
				
			||||||
  RTTY_ENABLED=${RTTY_ENABLED:-"false"} \
 | 
					  RTTY_ENABLED=${RTTY_ENABLED:-"false"} \
 | 
				
			||||||
  RTTY_SERVER=${RTTY_SERVER:-"localhost"} \
 | 
					  RTTY_SERVER=${RTTY_SERVER:-"localhost"} \
 | 
				
			||||||
  RTTY_PORT=${RTTY_PORT:-"5912"} \
 | 
					  RTTY_PORT=${RTTY_PORT:-"5912"} \
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -1,12 +1,12 @@
 | 
				
			|||||||
dependencies:
 | 
					dependencies:
 | 
				
			||||||
- name: postgresql
 | 
					- name: postgresql
 | 
				
			||||||
  repository: https://charts.bitnami.com/bitnami
 | 
					  repository: https://tip.jfrog.io/artifactory/tip-wlan-cloud-ucentral-helm/
 | 
				
			||||||
  version: 10.9.2
 | 
					  version: 10.9.2
 | 
				
			||||||
- name: mysql
 | 
					- name: mysql
 | 
				
			||||||
  repository: https://charts.bitnami.com/bitnami
 | 
					  repository: https://tip.jfrog.io/artifactory/tip-wlan-cloud-ucentral-helm/
 | 
				
			||||||
  version: 8.8.3
 | 
					  version: 8.8.3
 | 
				
			||||||
- name: mariadb
 | 
					- name: mariadb
 | 
				
			||||||
  repository: https://charts.bitnami.com/bitnami
 | 
					  repository: https://tip.jfrog.io/artifactory/tip-wlan-cloud-ucentral-helm/
 | 
				
			||||||
  version: 9.4.2
 | 
					  version: 9.4.2
 | 
				
			||||||
digest: sha256:1fdae7cbea906e41dccd8618ff9e2c68d0c684724ae27c79a12bb6089968df5c
 | 
					digest: sha256:e9df5a5d8a0a193bfda33ea06060203aace01f0f7df9eda662a84185322c7ab5
 | 
				
			||||||
generated: "2021-08-17T12:18:40.341427893+03:00"
 | 
					generated: "2022-06-03T15:38:31.063022252+03:00"
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -5,14 +5,14 @@ name: owgw
 | 
				
			|||||||
version: 0.1.0
 | 
					version: 0.1.0
 | 
				
			||||||
dependencies:
 | 
					dependencies:
 | 
				
			||||||
- name: postgresql
 | 
					- name: postgresql
 | 
				
			||||||
  repository: https://charts.bitnami.com/bitnami
 | 
					  repository: https://tip.jfrog.io/artifactory/tip-wlan-cloud-ucentral-helm/
 | 
				
			||||||
  version: 10.9.2
 | 
					  version: 10.9.2
 | 
				
			||||||
  condition: postgresql.enabled
 | 
					  condition: postgresql.enabled
 | 
				
			||||||
- name: mysql
 | 
					- name: mysql
 | 
				
			||||||
  repository: https://charts.bitnami.com/bitnami
 | 
					  repository: https://tip.jfrog.io/artifactory/tip-wlan-cloud-ucentral-helm/
 | 
				
			||||||
  version: 8.8.3
 | 
					  version: 8.8.3
 | 
				
			||||||
  condition: mysql.enabled
 | 
					  condition: mysql.enabled
 | 
				
			||||||
- name: mariadb
 | 
					- name: mariadb
 | 
				
			||||||
  repository: https://charts.bitnami.com/bitnami
 | 
					  repository: https://tip.jfrog.io/artifactory/tip-wlan-cloud-ucentral-helm/
 | 
				
			||||||
  version: 9.4.2
 | 
					  version: 9.4.2
 | 
				
			||||||
  condition: mariadb.enabled
 | 
					  condition: mariadb.enabled
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -30,3 +30,13 @@ Create chart name and version as used by the chart label.
 | 
				
			|||||||
{{- define "owgw.chart" -}}
 | 
					{{- define "owgw.chart" -}}
 | 
				
			||||||
{{- printf "%s-%s" .Chart.Name .Chart.Version | replace "+" "_" | trunc 63 | trimSuffix "-" -}}
 | 
					{{- printf "%s-%s" .Chart.Name .Chart.Version | replace "+" "_" | trunc 63 | trimSuffix "-" -}}
 | 
				
			||||||
{{- end -}}
 | 
					{{- end -}}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					{{- define "owgw.ingress.apiVersion" -}}
 | 
				
			||||||
 | 
					  {{- if .Capabilities.APIVersions.Has "networking.k8s.io/v1" -}}
 | 
				
			||||||
 | 
					      {{- print "networking.k8s.io/v1" -}}
 | 
				
			||||||
 | 
					  {{- else if .Capabilities.APIVersions.Has "networking.k8s.io/v1beta1" -}}
 | 
				
			||||||
 | 
					    {{- print "networking.k8s.io/v1beta1" -}}
 | 
				
			||||||
 | 
					  {{- else -}}
 | 
				
			||||||
 | 
					    {{- print "extensions/v1beta1" -}}
 | 
				
			||||||
 | 
					  {{- end -}}
 | 
				
			||||||
 | 
					{{- end -}}
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -2,7 +2,7 @@
 | 
				
			|||||||
{{- range $ingress, $ingressValue := .Values.ingresses }}
 | 
					{{- range $ingress, $ingressValue := .Values.ingresses }}
 | 
				
			||||||
{{- if $ingressValue.enabled }}
 | 
					{{- if $ingressValue.enabled }}
 | 
				
			||||||
---
 | 
					---
 | 
				
			||||||
apiVersion: extensions/v1beta1
 | 
					apiVersion: {{ include "owgw.ingress.apiVersion" $root }}
 | 
				
			||||||
kind: Ingress
 | 
					kind: Ingress
 | 
				
			||||||
metadata:
 | 
					metadata:
 | 
				
			||||||
  name: {{ include "owgw.fullname" $root }}-{{ $ingress }}
 | 
					  name: {{ include "owgw.fullname" $root }}-{{ $ingress }}
 | 
				
			||||||
@@ -36,11 +36,25 @@ spec:
 | 
				
			|||||||
      paths:
 | 
					      paths:
 | 
				
			||||||
      {{- range $ingressValue.paths }}
 | 
					      {{- range $ingressValue.paths }}
 | 
				
			||||||
        - path: {{ .path }}
 | 
					        - path: {{ .path }}
 | 
				
			||||||
 | 
					          {{- if $root.Capabilities.APIVersions.Has "networking.k8s.io/v1" }}
 | 
				
			||||||
 | 
					          pathType: {{ .pathType | default "ImplementationSpecific" }}
 | 
				
			||||||
 | 
					          {{- end }}
 | 
				
			||||||
          backend:
 | 
					          backend:
 | 
				
			||||||
 | 
					            {{- if $root.Capabilities.APIVersions.Has "networking.k8s.io/v1" }}
 | 
				
			||||||
 | 
					            service:
 | 
				
			||||||
 | 
					              name: {{ include "owgw.fullname" $root }}-{{ .serviceName }}
 | 
				
			||||||
 | 
					              port:
 | 
				
			||||||
 | 
					              {{- if kindIs "string" .servicePort }}
 | 
				
			||||||
 | 
					                name: {{ .servicePort }}
 | 
				
			||||||
 | 
					              {{- else }}
 | 
				
			||||||
 | 
					                number: {{ .servicePort }}
 | 
				
			||||||
 | 
					              {{- end }}
 | 
				
			||||||
 | 
					            {{- else }}
 | 
				
			||||||
            serviceName: {{ include "owgw.fullname" $root }}-{{ .serviceName }}
 | 
					            serviceName: {{ include "owgw.fullname" $root }}-{{ .serviceName }}
 | 
				
			||||||
            servicePort: {{ .servicePort }}
 | 
					            servicePort: {{ .servicePort }}
 | 
				
			||||||
            {{- end }}
 | 
					            {{- end }}
 | 
				
			||||||
      {{- end }}
 | 
					      {{- end }}
 | 
				
			||||||
 | 
					  {{- end }}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
{{- end }}
 | 
					{{- end }}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -9,7 +9,7 @@ fullnameOverride: ""
 | 
				
			|||||||
images:
 | 
					images:
 | 
				
			||||||
  owgw:
 | 
					  owgw:
 | 
				
			||||||
    repository: tip-tip-wlan-cloud-ucentral.jfrog.io/owgw
 | 
					    repository: tip-tip-wlan-cloud-ucentral.jfrog.io/owgw
 | 
				
			||||||
    tag: master
 | 
					    tag: v2.5.3
 | 
				
			||||||
    pullPolicy: Always
 | 
					    pullPolicy: Always
 | 
				
			||||||
#    regcred:
 | 
					#    regcred:
 | 
				
			||||||
#      registry: tip-tip-wlan-cloud-ucentral.jfrog.io
 | 
					#      registry: tip-tip-wlan-cloud-ucentral.jfrog.io
 | 
				
			||||||
@@ -62,6 +62,7 @@ ingresses:
 | 
				
			|||||||
    - restapi.chart-example.local
 | 
					    - restapi.chart-example.local
 | 
				
			||||||
    paths:
 | 
					    paths:
 | 
				
			||||||
    - path: /
 | 
					    - path: /
 | 
				
			||||||
 | 
					      pathType: ImplementationSpecific
 | 
				
			||||||
      serviceName: owgw
 | 
					      serviceName: owgw
 | 
				
			||||||
      servicePort: restapi
 | 
					      servicePort: restapi
 | 
				
			||||||
  fileuploader:
 | 
					  fileuploader:
 | 
				
			||||||
@@ -73,6 +74,7 @@ ingresses:
 | 
				
			|||||||
    - fileuploader.chart-example.local
 | 
					    - fileuploader.chart-example.local
 | 
				
			||||||
    paths:
 | 
					    paths:
 | 
				
			||||||
    - path: /
 | 
					    - path: /
 | 
				
			||||||
 | 
					      pathType: ImplementationSpecific
 | 
				
			||||||
      serviceName: owgw
 | 
					      serviceName: owgw
 | 
				
			||||||
      servicePort: fileuploader
 | 
					      servicePort: fileuploader
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -52,8 +52,8 @@ openwifi.fileuploader.host.0.cert = ${FILEUPLOADER_HOST_CERT}
 | 
				
			|||||||
openwifi.fileuploader.host.0.key = ${FILEUPLOADER_HOST_KEY}
 | 
					openwifi.fileuploader.host.0.key = ${FILEUPLOADER_HOST_KEY}
 | 
				
			||||||
openwifi.fileuploader.host.0.key.password = ${FILEUPLOADER_HOST_KEY_PASSWORD}
 | 
					openwifi.fileuploader.host.0.key.password = ${FILEUPLOADER_HOST_KEY_PASSWORD}
 | 
				
			||||||
openwifi.fileuploader.path = ${FILEUPLOADER_PATH}
 | 
					openwifi.fileuploader.path = ${FILEUPLOADER_PATH}
 | 
				
			||||||
openwifi.fileuploader.uri = ${FILEUPLOADER_URI}
 | 
					 | 
				
			||||||
openwifi.fileuploader.maxsize = 10000
 | 
					openwifi.fileuploader.maxsize = 10000
 | 
				
			||||||
 | 
					openwifi.fileuploader.uri = ${FILEUPLOADER_URI}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
#
 | 
					#
 | 
				
			||||||
# Generic section that all microservices must have
 | 
					# Generic section that all microservices must have
 | 
				
			||||||
@@ -75,9 +75,15 @@ openwifi.devicetypes.0 = AP:linksys_ea8300,edgecore_eap101,linksys_e8450-ubi
 | 
				
			|||||||
openwifi.devicetypes.1 = SWITCH:edgecore_ecs4100-12ph
 | 
					openwifi.devicetypes.1 = SWITCH:edgecore_ecs4100-12ph
 | 
				
			||||||
openwifi.devicetypes.2 = IOT:esp32
 | 
					openwifi.devicetypes.2 = IOT:esp32
 | 
				
			||||||
oui.download.uri = https://linuxnet.ca/ieee/oui.txt
 | 
					oui.download.uri = https://linuxnet.ca/ieee/oui.txt
 | 
				
			||||||
firmware.autoupdate.policy.default = auto
 | 
					 | 
				
			||||||
simulatorid = ${SIMULATORID}
 | 
					simulatorid = ${SIMULATORID}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					iptocountry.default = US
 | 
				
			||||||
 | 
					iptocountry.provider = ${IPTOCOUNTRY_PROVIDER}
 | 
				
			||||||
 | 
					iptocountry.ipinfo.token = ${IPTOCOUNTRY_IPINFO_TOKEN}
 | 
				
			||||||
 | 
					iptocountry.ipdata.apikey = ${IPTOCOUNTRY_IPDATA_APIKEY}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					autoprovisioning.process = ${AUTOPROVISIONING_PROCESS}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
#
 | 
					#
 | 
				
			||||||
# rtty
 | 
					# rtty
 | 
				
			||||||
#
 | 
					#
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -258,21 +258,35 @@ namespace OpenWifi {
 | 
				
			|||||||
	}
 | 
						}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	bool WSConnection::ExtractBase64CompressedData(const std::string &CompressedData,
 | 
						bool WSConnection::ExtractBase64CompressedData(const std::string &CompressedData,
 | 
				
			||||||
												   std::string &UnCompressedData) {
 | 
																	   std::string &UnCompressedData, uint64_t compress_sz) {
 | 
				
			||||||
		std::istringstream ifs(CompressedData);
 | 
							std::istringstream ifs(CompressedData);
 | 
				
			||||||
		Poco::Base64Decoder b64in(ifs);
 | 
							Poco::Base64Decoder b64in(ifs);
 | 
				
			||||||
		std::ostringstream ofs;
 | 
							std::ostringstream ofs;
 | 
				
			||||||
		Poco::StreamCopier::copyStream(b64in, ofs);
 | 
							Poco::StreamCopier::copyStream(b64in, ofs);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
		unsigned long MaxSize = ofs.str().size() * 10;
 | 
							int factor = 20;
 | 
				
			||||||
 | 
							unsigned long MaxSize = compress_sz ? (unsigned long) (compress_sz + 5000) : (unsigned long) (ofs.str().size() * factor);
 | 
				
			||||||
 | 
							while(true) {
 | 
				
			||||||
			std::vector<uint8_t> UncompressedBuffer(MaxSize);
 | 
								std::vector<uint8_t> UncompressedBuffer(MaxSize);
 | 
				
			||||||
			unsigned long FinalSize = MaxSize;
 | 
								unsigned long FinalSize = MaxSize;
 | 
				
			||||||
		if (uncompress((uint8_t *)&UncompressedBuffer[0], &FinalSize, (uint8_t *)ofs.str().c_str(),
 | 
								auto status = uncompress((uint8_t *)&UncompressedBuffer[0], &FinalSize,
 | 
				
			||||||
					   ofs.str().size()) == Z_OK) {
 | 
														 (uint8_t *)ofs.str().c_str(), ofs.str().size());
 | 
				
			||||||
 | 
								if(status==Z_OK) {
 | 
				
			||||||
				UncompressedBuffer[FinalSize] = 0;
 | 
									UncompressedBuffer[FinalSize] = 0;
 | 
				
			||||||
				UnCompressedData = (char *)&UncompressedBuffer[0];
 | 
									UnCompressedData = (char *)&UncompressedBuffer[0];
 | 
				
			||||||
				return true;
 | 
									return true;
 | 
				
			||||||
			}
 | 
								}
 | 
				
			||||||
 | 
								if(status==Z_BUF_ERROR) {
 | 
				
			||||||
 | 
									if(factor<300) {
 | 
				
			||||||
 | 
										factor+=10;
 | 
				
			||||||
 | 
										MaxSize = ofs.str().size() * factor;
 | 
				
			||||||
 | 
										continue;
 | 
				
			||||||
 | 
									} else {
 | 
				
			||||||
 | 
										return false;
 | 
				
			||||||
 | 
									}
 | 
				
			||||||
 | 
								}
 | 
				
			||||||
 | 
								return false;
 | 
				
			||||||
 | 
							}
 | 
				
			||||||
		return false;
 | 
							return false;
 | 
				
			||||||
	}
 | 
						}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
@@ -300,9 +314,13 @@ namespace OpenWifi {
 | 
				
			|||||||
		auto ParamsObj = Doc->get(uCentralProtocol::PARAMS).extract<Poco::JSON::Object::Ptr>();
 | 
							auto ParamsObj = Doc->get(uCentralProtocol::PARAMS).extract<Poco::JSON::Object::Ptr>();
 | 
				
			||||||
		if (ParamsObj->has(uCentralProtocol::COMPRESS_64)) {
 | 
							if (ParamsObj->has(uCentralProtocol::COMPRESS_64)) {
 | 
				
			||||||
			std::string UncompressedData;
 | 
								std::string UncompressedData;
 | 
				
			||||||
 | 
								uint64_t compress_sz = 0 ;
 | 
				
			||||||
 | 
								if(ParamsObj->has("compress_sz")) {
 | 
				
			||||||
 | 
									compress_sz = ParamsObj->get("compress_sz");
 | 
				
			||||||
 | 
								}
 | 
				
			||||||
			try {
 | 
								try {
 | 
				
			||||||
				if (ExtractBase64CompressedData(
 | 
									if (ExtractBase64CompressedData(
 | 
				
			||||||
						ParamsObj->get(uCentralProtocol::COMPRESS_64).toString(), UncompressedData)) {
 | 
											ParamsObj->get(uCentralProtocol::COMPRESS_64).toString(), UncompressedData, compress_sz)) {
 | 
				
			||||||
					poco_trace(Logger(),Poco::format("EVENT(%s): Found compressed payload expanded to '%s'.",
 | 
										poco_trace(Logger(),Poco::format("EVENT(%s): Found compressed payload expanded to '%s'.",
 | 
				
			||||||
													  CId_, UncompressedData));
 | 
																		  CId_, UncompressedData));
 | 
				
			||||||
					Poco::JSON::Parser Parser;
 | 
										Poco::JSON::Parser Parser;
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -31,7 +31,8 @@ namespace OpenWifi {
 | 
				
			|||||||
		void OnSocketShutdown(const Poco::AutoPtr<Poco::Net::ShutdownNotification>& pNf);
 | 
							void OnSocketShutdown(const Poco::AutoPtr<Poco::Net::ShutdownNotification>& pNf);
 | 
				
			||||||
		void OnSocketError(const Poco::AutoPtr<Poco::Net::ErrorNotification>& pNf);
 | 
							void OnSocketError(const Poco::AutoPtr<Poco::Net::ErrorNotification>& pNf);
 | 
				
			||||||
		bool LookForUpgrade(uint64_t UUID);
 | 
							bool LookForUpgrade(uint64_t UUID);
 | 
				
			||||||
		static bool ExtractBase64CompressedData(const std::string & CompressedData, std::string & UnCompressedData);
 | 
							static bool ExtractBase64CompressedData(const std::string &CompressedData,
 | 
				
			||||||
 | 
																	std::string &UnCompressedData, uint64_t compress_sz);
 | 
				
			||||||
		void LogException(const Poco::Exception &E);
 | 
							void LogException(const Poco::Exception &E);
 | 
				
			||||||
		inline Poco::Logger & Logger() { return Logger_; }
 | 
							inline Poco::Logger & Logger() { return Logger_; }
 | 
				
			||||||
		bool SetWebSocketTelemetryReporting(uint64_t interval, uint64_t TelemetryWebSocketTimer);
 | 
							bool SetWebSocketTelemetryReporting(uint64_t interval, uint64_t TelemetryWebSocketTimer);
 | 
				
			||||||
 
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user